Skip to content

Commit ca34b2e

Browse files
authored
Merge pull request #4169 from pypa/feature/vendor-update
Update vendored dependencies, relevant API usage, and CI config
2 parents b5a7204 + 8eddee6 commit ca34b2e

File tree

574 files changed

+48979
-25994
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

574 files changed

+48979
-25994
lines changed
+75
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
# Taken from https://github.com/pypa/pip/blob/ceaf75b9ede9a9c25bcee84fe512fa6774889685/.azure-pipelines/scripts/New-RAMDisk.ps1
2+
[CmdletBinding()]
3+
param(
4+
[Parameter(Mandatory=$true,
5+
HelpMessage="Drive letter to use for the RAMDisk")]
6+
[String]$drive,
7+
[Parameter(HelpMessage="Size to allocate to the RAMDisk")]
8+
[UInt64]$size=1GB
9+
)
10+
11+
$ErrorActionPreference = "Stop"
12+
Set-StrictMode -Version Latest
13+
14+
Write-Output "Installing FS-iSCSITarget-Server"
15+
Install-WindowsFeature -Name FS-iSCSITarget-Server
16+
17+
Write-Output "Starting MSiSCSI"
18+
Start-Service MSiSCSI
19+
$retry = 10
20+
do {
21+
$service = Get-Service MSiSCSI
22+
if ($service.Status -eq "Running") {
23+
break;
24+
}
25+
$retry--
26+
Start-Sleep -Milliseconds 500
27+
} until ($retry -eq 0)
28+
29+
$service = Get-Service MSiSCSI
30+
if ($service.Status -ne "Running") {
31+
throw "MSiSCSI is not running"
32+
}
33+
34+
Write-Output "Configuring Firewall"
35+
Get-NetFirewallServiceFilter -Service MSiSCSI | Enable-NetFirewallRule
36+
37+
Write-Output "Configuring RAMDisk"
38+
# Must use external-facing IP address, otherwise New-IscsiTargetPortal is
39+
# unable to connect.
40+
$ip = (
41+
Get-NetIPAddress -AddressFamily IPv4 |
42+
Where-Object {$_.IPAddress -ne "127.0.0.1"}
43+
)[0].IPAddress
44+
if (
45+
-not (Get-IscsiServerTarget -ComputerName localhost | Where-Object {$_.TargetName -eq "ramdisks"})
46+
) {
47+
New-IscsiServerTarget `
48+
-ComputerName localhost `
49+
-TargetName ramdisks `
50+
-InitiatorId IPAddress:$ip
51+
}
52+
53+
$newVirtualDisk = New-IscsiVirtualDisk `
54+
-ComputerName localhost `
55+
-Path ramdisk:local$drive.vhdx `
56+
-Size $size
57+
Add-IscsiVirtualDiskTargetMapping `
58+
-ComputerName localhost `
59+
-TargetName ramdisks `
60+
-Path ramdisk:local$drive.vhdx
61+
62+
Write-Output "Connecting to iSCSI"
63+
New-IscsiTargetPortal -TargetPortalAddress $ip
64+
Get-IscsiTarget | Where-Object {!$_.IsConnected} | Connect-IscsiTarget
65+
66+
Write-Output "Configuring disk"
67+
$newDisk = Get-IscsiConnection |
68+
Get-Disk |
69+
Where-Object {$_.SerialNumber -eq $newVirtualDisk.SerialNumber}
70+
71+
Set-Disk -InputObject $newDisk -IsOffline $false
72+
Initialize-Disk -InputObject $newDisk -PartitionStyle MBR
73+
New-Partition -InputObject $newDisk -UseMaximumSize -DriveLetter $drive
74+
75+
Format-Volume -DriveLetter $drive -NewFileSystemLabel Temp -FileSystem NTFS

.azure-pipelines/steps/build-package.yml

+5-4
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,17 @@ steps:
66
addToPath: true
77
displayName: Use Python $(python.version)
88

9-
- template: install-dependencies.yml
9+
- bash: |
10+
PYTHON_PATH=$(python -c 'import sys; print(sys.executable)')
11+
echo "##vso[task.setvariable variable=PY_EXE]$PYTHON_PATH"
12+
displayName: Set Python Path
1013

1114
- script: |
1215
echo '##vso[task.setvariable variable=PIPENV_DEFAULT_PYTHON_VERSION]'$(python.version)
1316
env:
1417
PYTHON_VERSION: $(python.version)
1518

16-
- template: create-virtualenv.yml
17-
parameters:
18-
python_version: $(python.version)
19+
- template: install-dependencies.yml
1920

2021
- script: |
2122
python -m pip install --upgrade wheel pip setuptools twine readme_renderer[md]

.azure-pipelines/steps/create-virtualenv.yml

-44
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,31 @@
1+
parameters:
2+
python_version: ''
3+
14
steps:
2-
- script: 'python -m pip install --upgrade pip setuptools wheel -e .[dev,tests] --upgrade'
5+
6+
- script: |
7+
echo "##vso[task.setvariable variable=LANG]C.UTF-8"
8+
echo "##vso[task.setvariable variable=PIP_PROCESS_DEPENDENCY_LINKS]1"
9+
displayName: Set Environment Variables
10+
11+
- script: |
12+
echo "Python path: $(PY_EXE)"
13+
echo "GIT_SSL_CAINFO: $(GIT_SSL_CAINFO)"
14+
echo "PIPENV PYTHON VERSION: $(python.version)"
15+
echo "python_version: ${{ parameters.python_version }}"
16+
git submodule sync
17+
git submodule update --init --recursive
18+
$(PY_EXE) -m pip install --upgrade --upgrade-strategy=eager pip setuptools wheel
19+
$(PY_EXE) -m pip install "virtualenv<20"
20+
env:
21+
PIPENV_DEFAULT_PYTHON_VERSION: ${{ parameters.python_version }}
22+
PYTHONWARNINGS: 'ignore:DEPRECATION'
23+
PIPENV_NOSPIN: '1'
24+
displayName: Make Virtualenv
25+
26+
- script: |
27+
$(PY_EXE) -m pip install -e . --upgrade
28+
$(PY_EXE) -m pipenv install --deploy --dev --python="$(PY_EXE)"
329
displayName: Upgrade Pip & Install Pipenv
430
env:
531
PYTHONWARNINGS: 'ignore:DEPRECATION'

.azure-pipelines/steps/reinstall-pythons.yml

-34
This file was deleted.

.azure-pipelines/steps/run-tests-linux.yml

+17-1
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,29 @@ parameters:
22
python_version: ''
33

44
steps:
5+
6+
- bash: |
7+
pip install certifi
8+
PYTHON_PATH=$(python -c 'import sys; print(sys.executable)')
9+
CERTIFI_CONTENT=$(python -m certifi)
10+
echo "##vso[task.setvariable variable=GIT_SSL_CAINFO]$CERTIFI_CONTENT"
11+
echo "##vso[task.setvariable variable=PY_EXE]$PYTHON_PATH"
12+
displayName: Set Python Path
13+
env:
14+
PYTHONWARNINGS: 'ignore:DEPRECATION'
15+
16+
- template: install-dependencies.yml
17+
parameters:
18+
python_version: ${{ parameters.python_version }}
19+
520
- script: |
621
# Fix Git SSL errors
722
echo "Using pipenv python version: $(PIPENV_DEFAULT_PYTHON_VERSION)"
823
git submodule sync && git submodule update --init --recursive
9-
pipenv run pytest --junitxml=test-results.xml
24+
pipenv run pytest -n 4 --junitxml=junit/test-results.xml
1025
displayName: Run integration tests
1126
env:
1227
PYTHONWARNINGS: ignore:DEPRECATION
1328
PIPENV_NOSPIN: '1'
1429
PIPENV_DEFAULT_PYTHON_VERSION: ${{ parameters.python_version }}
30+
GIT_SSH_COMMAND: ssh -o StrictHostKeyChecking=accept-new -o CheckHostIP=no
+51-16
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,56 @@
11
parameters:
22
python_version: ''
3+
python_architecture: ''
34

45
steps:
5-
- powershell: |
6-
subst T: "$env:TEMP"
7-
Write-Host "##vso[task.setvariable variable=TEMP]T:\"
8-
Write-Host "##vso[task.setvariable variable=TMP]T:\"
9-
Write-Host "##vso[task.setvariable variable=PIPENV_DEFAULT_PYTHON_VERSION]$env:PYTHON_VERSION"
10-
Write-Host "##vso[task.setvariable variable=PIPENV_NOSPIN]1"
11-
displayName: Fix Temp Variable
12-
env:
13-
PYTHON_VERSION: ${{ parameters.python_version }}
6+
- task: PowerShell@2
7+
inputs:
8+
filePath: .azure-pipelines/scripts/New-RAMDisk.ps1
9+
arguments: "-Drive R -Size 2GB"
10+
displayName: Setup RAMDisk
1411

15-
- script: |
16-
git submodule sync && git submodule update --init --recursive
17-
pipenv run pytest -ra --ignore=pipenv\patched --ignore=pipenv\vendor --junitxml=test-results.xml tests
18-
displayName: Run integration tests
19-
env:
20-
PYTHONWARNINGS: 'ignore:DEPRECATION'
21-
PIPENV_NOSPIN: '1'
12+
- powershell: |
13+
mkdir R:\virtualenvs
14+
$acl = Get-Acl "R:\"
15+
$rule = New-Object System.Security.AccessControl.FileSystemAccessRule(
16+
"Everyone", "FullControl", "ContainerInherit,ObjectInherit", "None", "Allow"
17+
)
18+
$acl.AddAccessRule($rule)
19+
Set-Acl "R:\" $acl
20+
displayName: Set RAMDisk Permissions
21+
22+
- powershell: |
23+
Write-Host "##vso[task.setvariable variable=TEMP]R:\"
24+
Write-Host "##vso[task.setvariable variable=TMP]R:\"
25+
Write-Host "##vso[task.setvariable variable=WORKON_HOME]R:\virtualenvs"
26+
Write-Host "##vso[task.setvariable variable=PIPENV_DEFAULT_PYTHON_VERSION]$env:PYTHON_VERSION"
27+
Write-Host "##vso[task.setvariable variable=PIPENV_NOSPIN]1"
28+
displayName: Fix Temp Variable
29+
env:
30+
PYTHON_VERSION: ${{ parameters.python_version }}
31+
32+
- powershell: |
33+
pip install certifi
34+
$env:PYTHON_PATH=$(python -c "import sys; print(sys.executable)")
35+
$env:CERTIFI_CONTENT=$(python -m certifi)
36+
echo "##vso[task.setvariable variable=GIT_SSL_CAINFO]$env:CERTIFI_CONTENT"
37+
echo "##vso[task.setvariable variable=PY_EXE]$env:PYTHON_PATH"
38+
displayName: Set Python Path
39+
env:
40+
PYTHONWARNINGS: 'ignore:DEPRECATION'
41+
42+
- template: install-dependencies.yml
43+
parameters:
44+
python_version: ${{ parameters.python_version }}
45+
46+
- script: |
47+
git submodule sync
48+
git submodule update --init --recursive
49+
pipenv run pytest -ra -n 4 --junit-xml=junit/test-results.xml tests/
50+
failOnStderr: false
51+
displayName: Run integration tests
52+
env:
53+
TEMP: 'R:\'
54+
PYTHONWARNINGS: 'ignore:DEPRECATION'
55+
PIPENV_NOSPIN: 1
56+
GIT_SSH_COMMAND: ssh -o StrictHostKeyChecking=accept-new -o CheckHostIP=no

.azure-pipelines/steps/run-tests.yml

+3-9
Original file line numberDiff line numberDiff line change
@@ -6,29 +6,23 @@ steps:
66
addToPath: true
77
displayName: Use Python $(python.version)
88

9-
- template: install-dependencies.yml
10-
119
- script: |
1210
echo '##vso[task.setvariable variable=PIPENV_DEFAULT_PYTHON_VERSION]'$(python.version)
1311
env:
1412
PYTHON_VERSION: $(python.version)
1513

16-
- template: create-virtualenv.yml
17-
parameters:
18-
python_version: $(python.version)
19-
20-
- ${{ if eq(parameters.vmImage, 'windows-2019') }}:
14+
- ${{ if eq(parameters.vmImage, 'windows-latest') }}:
2115
- template: run-tests-windows.yml
2216
parameters:
2317
python_version: $(python.version)
24-
- ${{ if ne(parameters.vmImage, 'windows-2019') }}:
18+
- ${{ if ne(parameters.vmImage, 'windows-latest') }}:
2519
- template: run-tests-linux.yml
2620
parameters:
2721
python_version: $(python.version)
2822

2923
- task: PublishTestResults@2
3024
displayName: Publish Test Results
3125
inputs:
32-
testResultsFiles: '**/test-results.xml'
26+
testResultsFiles: '**/junit/*.xml'
3327
testRunTitle: 'Python $(python.version)'
3428
condition: succeededOrFailed()

.azure-pipelines/steps/run-vendor-scripts.yml

+10-11
Original file line numberDiff line numberDiff line change
@@ -9,25 +9,24 @@ steps:
99
addToPath: true
1010
displayName: Use Python $(python.version)
1111

12-
- template: install-dependencies.yml
12+
- bash: |
13+
python -m pip install --upgrade --upgrade-strategy=eager pip requests certifi wheel setuptools
14+
PYTHON_PATH=$(python -c 'import sys; print(sys.executable)')
15+
CERTIFI_CONTENT=$(python -m certifi)
16+
echo "##vso[task.setvariable variable=PY_EXE]$PYTHON_PATH"
17+
echo "##vso[task.setvariable variable=GIT_SSL_CAINFO]$CERTIFI_CONTENT"
18+
displayName: Set Python Path
1319

14-
- script: |
15-
echo '##vso[task.setvariable variable=PIPENV_DEFAULT_PYTHON_VERSION]'$(python.version)
16-
env:
17-
PYTHON_VERSION: $(python.version)
18-
19-
- template: create-virtualenv.yml
20-
parameters:
21-
python_version: $(python.version)
20+
- template: install-dependencies.yml
2221

2322
- script: |
24-
python -m pip install --upgrade invoke requests parver bs4 vistir towncrier pip setuptools wheel --upgrade-strategy=eager
23+
python -m pip install --upgrade invoke parver bs4 vistir towncrier --upgrade-strategy=eager
2524
python -m invoke vendoring.update
2625
displayName: Run Vendor Scripts
2726
env:
2827
PY_EXE: $(PY_EXE)
2928
GIT_SSL_CAINFO: $(GIT_SSL_CAINFO)
3029
LANG: $(LANG)
31-
PIPENV_DEFAULT_PYTHON_VERSION: '${{ parameters.python_version }}'
30+
PIPENV_DEFAULT_PYTHON_VERSION: $(python.version)
3231
PYTHONWARNINGS: ignore:DEPRECATION
3332
PIPENV_NOSPIN: '1'

0 commit comments

Comments
 (0)