Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update vendored dependencies, relevant API usage, and CI config #4169

Merged
merged 49 commits into from
Apr 12, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
d9cddcb
Updated and re-patched vendored dependencies
techalchemy Dec 21, 2019
b5892c1
Add missing dependencies, fix patched pip path
techalchemy Mar 4, 2020
e629c0c
Update vendor.txt and ecosystem libraries
techalchemy Mar 25, 2020
1456675
Fix outline table conversion for new tomlkit release
techalchemy Mar 25, 2020
e7fc6e9
Re-vendor dependencies
techalchemy Mar 25, 2020
662e7c7
Update tomlkit patch
techalchemy Mar 26, 2020
01157a2
Fix tomlkit patch and update library
techalchemy Mar 26, 2020
bff39c5
Update piptools patches
techalchemy Mar 30, 2020
00bef5e
Fix outline table test to avoid pep517 builder
techalchemy Mar 30, 2020
ee093c5
Update pip version-specific code
techalchemy Mar 30, 2020
7923151
Update vendoring script
techalchemy Mar 30, 2020
6aa9d66
Update test url for discord link in tests
techalchemy Mar 30, 2020
5ef9598
Add importlib_resources package to vendored pkgs
techalchemy Mar 30, 2020
ed8ae21
Fix tomlkit functools32 import
techalchemy Mar 31, 2020
feed2dd
Update requirementslib
techalchemy Mar 31, 2020
e03878d
Add news entry and fix lockfile
techalchemy Mar 31, 2020
a79c91f
Update azure templates
techalchemy Apr 3, 2020
d91a9d4
Normalize paths in test_run_in_virtualenv for windows
techalchemy Apr 3, 2020
c1061bd
Use vistir path normalization for shortened windows paths
techalchemy Apr 3, 2020
13c91f7
stop using verbose mode in windows tests
techalchemy Apr 3, 2020
fdea18e
Only use wrapped streams if not running CI
techalchemy Apr 3, 2020
e911c9a
Use monkeypatch instead of mock for setting dotenv test attributes
techalchemy Apr 4, 2020
f90e183
Fix failing test
techalchemy Apr 4, 2020
5c525ed
Redo test structure for azure
techalchemy Apr 5, 2020
6652157
Fix vendor test
techalchemy Apr 5, 2020
e513404
Fix package build test
techalchemy Apr 5, 2020
1d63308
AP: Update windows tests tempdir path
techalchemy Apr 5, 2020
8a7d3b5
Update ACL scripts
techalchemy Apr 7, 2020
511a144
Update test artifacts
techalchemy Apr 7, 2020
6a12408
Add new pendulum versions
techalchemy Apr 7, 2020
1d151cd
Fix broken exception on windows
techalchemy Apr 7, 2020
8b0f5ad
Don't use pytest-timeout on windows
techalchemy Apr 7, 2020
4c68e20
Don't rely on old requests versions in tests'
techalchemy Apr 8, 2020
9942755
Update test dependencies
techalchemy Apr 8, 2020
e976737
Include data-requires-python in test pypi server
techalchemy Apr 9, 2020
85f10b9
Add comment on resolver functionality
techalchemy Apr 9, 2020
4bbcefb
Update marker resolution
techalchemy Apr 9, 2020
5e68bca
Allow github tests to finish even if one fails, tweak windows tests
techalchemy Apr 9, 2020
4a656b3
Rewrite egg-links on failure to use expanded paths
techalchemy Apr 9, 2020
520e9be
adjust virtualenv installation order
techalchemy Apr 9, 2020
8cf5ee5
GA: Don't run on non-master branches
pradyunsg Apr 10, 2020
ab3e80a
AP: Remove Linux job
pradyunsg Apr 10, 2020
8807630
AP: Re-add Linux job
pradyunsg Apr 10, 2020
d668af0
GA: Nicer naming!
pradyunsg Apr 10, 2020
d75cc6e
AP: Nicer names!
pradyunsg Apr 10, 2020
2eb3d5b
Fix missing normalization import
techalchemy Apr 10, 2020
88fe850
Fix monkeypatch warnings on python 2.7
techalchemy Apr 10, 2020
b493c77
Only include first two requires_python markers
techalchemy Apr 10, 2020
8eddee6
Fix incorrect marker in test
techalchemy Apr 10, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
75 changes: 75 additions & 0 deletions .azure-pipelines/scripts/New-Ramdisk.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
# Taken from https://github.com/pypa/pip/blob/ceaf75b9ede9a9c25bcee84fe512fa6774889685/.azure-pipelines/scripts/New-RAMDisk.ps1
[CmdletBinding()]
param(
[Parameter(Mandatory=$true,
HelpMessage="Drive letter to use for the RAMDisk")]
[String]$drive,
[Parameter(HelpMessage="Size to allocate to the RAMDisk")]
[UInt64]$size=1GB
)

$ErrorActionPreference = "Stop"
Set-StrictMode -Version Latest

Write-Output "Installing FS-iSCSITarget-Server"
Install-WindowsFeature -Name FS-iSCSITarget-Server

Write-Output "Starting MSiSCSI"
Start-Service MSiSCSI
$retry = 10
do {
$service = Get-Service MSiSCSI
if ($service.Status -eq "Running") {
break;
}
$retry--
Start-Sleep -Milliseconds 500
} until ($retry -eq 0)

$service = Get-Service MSiSCSI
if ($service.Status -ne "Running") {
throw "MSiSCSI is not running"
}

Write-Output "Configuring Firewall"
Get-NetFirewallServiceFilter -Service MSiSCSI | Enable-NetFirewallRule

Write-Output "Configuring RAMDisk"
# Must use external-facing IP address, otherwise New-IscsiTargetPortal is
# unable to connect.
$ip = (
Get-NetIPAddress -AddressFamily IPv4 |
Where-Object {$_.IPAddress -ne "127.0.0.1"}
)[0].IPAddress
if (
-not (Get-IscsiServerTarget -ComputerName localhost | Where-Object {$_.TargetName -eq "ramdisks"})
) {
New-IscsiServerTarget `
-ComputerName localhost `
-TargetName ramdisks `
-InitiatorId IPAddress:$ip
}

$newVirtualDisk = New-IscsiVirtualDisk `
-ComputerName localhost `
-Path ramdisk:local$drive.vhdx `
-Size $size
Add-IscsiVirtualDiskTargetMapping `
-ComputerName localhost `
-TargetName ramdisks `
-Path ramdisk:local$drive.vhdx

Write-Output "Connecting to iSCSI"
New-IscsiTargetPortal -TargetPortalAddress $ip
Get-IscsiTarget | Where-Object {!$_.IsConnected} | Connect-IscsiTarget

Write-Output "Configuring disk"
$newDisk = Get-IscsiConnection |
Get-Disk |
Where-Object {$_.SerialNumber -eq $newVirtualDisk.SerialNumber}

Set-Disk -InputObject $newDisk -IsOffline $false
Initialize-Disk -InputObject $newDisk -PartitionStyle MBR
New-Partition -InputObject $newDisk -UseMaximumSize -DriveLetter $drive

Format-Volume -DriveLetter $drive -NewFileSystemLabel Temp -FileSystem NTFS
9 changes: 5 additions & 4 deletions .azure-pipelines/steps/build-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,17 @@ steps:
addToPath: true
displayName: Use Python $(python.version)

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

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

- template: create-virtualenv.yml
parameters:
python_version: $(python.version)
- template: install-dependencies.yml

- script: |
python -m pip install --upgrade wheel pip setuptools twine readme_renderer[md]
Expand Down
44 changes: 0 additions & 44 deletions .azure-pipelines/steps/create-virtualenv.yml

This file was deleted.

28 changes: 27 additions & 1 deletion .azure-pipelines/steps/install-dependencies.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,31 @@
parameters:
python_version: ''

steps:
- script: 'python -m pip install --upgrade pip setuptools wheel -e .[dev,tests] --upgrade'

- script: |
echo "##vso[task.setvariable variable=LANG]C.UTF-8"
echo "##vso[task.setvariable variable=PIP_PROCESS_DEPENDENCY_LINKS]1"
displayName: Set Environment Variables

- script: |
echo "Python path: $(PY_EXE)"
echo "GIT_SSL_CAINFO: $(GIT_SSL_CAINFO)"
echo "PIPENV PYTHON VERSION: $(python.version)"
echo "python_version: ${{ parameters.python_version }}"
git submodule sync
git submodule update --init --recursive
$(PY_EXE) -m pip install --upgrade --upgrade-strategy=eager pip setuptools wheel
$(PY_EXE) -m pip install "virtualenv<20"
env:
PIPENV_DEFAULT_PYTHON_VERSION: ${{ parameters.python_version }}
PYTHONWARNINGS: 'ignore:DEPRECATION'
PIPENV_NOSPIN: '1'
displayName: Make Virtualenv

- script: |
$(PY_EXE) -m pip install -e . --upgrade
$(PY_EXE) -m pipenv install --deploy --dev --python="$(PY_EXE)"
displayName: Upgrade Pip & Install Pipenv
env:
PYTHONWARNINGS: 'ignore:DEPRECATION'
34 changes: 0 additions & 34 deletions .azure-pipelines/steps/reinstall-pythons.yml

This file was deleted.

18 changes: 17 additions & 1 deletion .azure-pipelines/steps/run-tests-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,29 @@ parameters:
python_version: ''

steps:

- bash: |
pip install certifi
PYTHON_PATH=$(python -c 'import sys; print(sys.executable)')
CERTIFI_CONTENT=$(python -m certifi)
echo "##vso[task.setvariable variable=GIT_SSL_CAINFO]$CERTIFI_CONTENT"
echo "##vso[task.setvariable variable=PY_EXE]$PYTHON_PATH"
displayName: Set Python Path
env:
PYTHONWARNINGS: 'ignore:DEPRECATION'

- template: install-dependencies.yml
parameters:
python_version: ${{ parameters.python_version }}

- script: |
# Fix Git SSL errors
echo "Using pipenv python version: $(PIPENV_DEFAULT_PYTHON_VERSION)"
git submodule sync && git submodule update --init --recursive
pipenv run pytest --junitxml=test-results.xml
pipenv run pytest -n 4 --junitxml=junit/test-results.xml
displayName: Run integration tests
env:
PYTHONWARNINGS: ignore:DEPRECATION
PIPENV_NOSPIN: '1'
PIPENV_DEFAULT_PYTHON_VERSION: ${{ parameters.python_version }}
GIT_SSH_COMMAND: ssh -o StrictHostKeyChecking=accept-new -o CheckHostIP=no
67 changes: 51 additions & 16 deletions .azure-pipelines/steps/run-tests-windows.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,56 @@
parameters:
python_version: ''
python_architecture: ''

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

- script: |
git submodule sync && git submodule update --init --recursive
pipenv run pytest -ra --ignore=pipenv\patched --ignore=pipenv\vendor --junitxml=test-results.xml tests
displayName: Run integration tests
env:
PYTHONWARNINGS: 'ignore:DEPRECATION'
PIPENV_NOSPIN: '1'
- powershell: |
mkdir R:\virtualenvs
$acl = Get-Acl "R:\"
$rule = New-Object System.Security.AccessControl.FileSystemAccessRule(
"Everyone", "FullControl", "ContainerInherit,ObjectInherit", "None", "Allow"
)
$acl.AddAccessRule($rule)
Set-Acl "R:\" $acl
displayName: Set RAMDisk Permissions

- powershell: |
Write-Host "##vso[task.setvariable variable=TEMP]R:\"
Write-Host "##vso[task.setvariable variable=TMP]R:\"
Write-Host "##vso[task.setvariable variable=WORKON_HOME]R:\virtualenvs"
Write-Host "##vso[task.setvariable variable=PIPENV_DEFAULT_PYTHON_VERSION]$env:PYTHON_VERSION"
Write-Host "##vso[task.setvariable variable=PIPENV_NOSPIN]1"
displayName: Fix Temp Variable
env:
PYTHON_VERSION: ${{ parameters.python_version }}

- powershell: |
pip install certifi
$env:PYTHON_PATH=$(python -c "import sys; print(sys.executable)")
$env:CERTIFI_CONTENT=$(python -m certifi)
echo "##vso[task.setvariable variable=GIT_SSL_CAINFO]$env:CERTIFI_CONTENT"
echo "##vso[task.setvariable variable=PY_EXE]$env:PYTHON_PATH"
displayName: Set Python Path
env:
PYTHONWARNINGS: 'ignore:DEPRECATION'

- template: install-dependencies.yml
parameters:
python_version: ${{ parameters.python_version }}

- script: |
git submodule sync
git submodule update --init --recursive
pipenv run pytest -ra -n 4 --junit-xml=junit/test-results.xml tests/
failOnStderr: false
displayName: Run integration tests
env:
TEMP: 'R:\'
PYTHONWARNINGS: 'ignore:DEPRECATION'
PIPENV_NOSPIN: 1
GIT_SSH_COMMAND: ssh -o StrictHostKeyChecking=accept-new -o CheckHostIP=no
12 changes: 3 additions & 9 deletions .azure-pipelines/steps/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,29 +6,23 @@ steps:
addToPath: true
displayName: Use Python $(python.version)

- template: install-dependencies.yml

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

- template: create-virtualenv.yml
parameters:
python_version: $(python.version)

- ${{ if eq(parameters.vmImage, 'windows-2019') }}:
- ${{ if eq(parameters.vmImage, 'windows-latest') }}:
- template: run-tests-windows.yml
parameters:
python_version: $(python.version)
- ${{ if ne(parameters.vmImage, 'windows-2019') }}:
- ${{ if ne(parameters.vmImage, 'windows-latest') }}:
- template: run-tests-linux.yml
parameters:
python_version: $(python.version)

- task: PublishTestResults@2
displayName: Publish Test Results
inputs:
testResultsFiles: '**/test-results.xml'
testResultsFiles: '**/junit/*.xml'
testRunTitle: 'Python $(python.version)'
condition: succeededOrFailed()
21 changes: 10 additions & 11 deletions .azure-pipelines/steps/run-vendor-scripts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,25 +9,24 @@ steps:
addToPath: true
displayName: Use Python $(python.version)

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

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

- template: create-virtualenv.yml
parameters:
python_version: $(python.version)
- template: install-dependencies.yml

- script: |
python -m pip install --upgrade invoke requests parver bs4 vistir towncrier pip setuptools wheel --upgrade-strategy=eager
python -m pip install --upgrade invoke parver bs4 vistir towncrier --upgrade-strategy=eager
python -m invoke vendoring.update
displayName: Run Vendor Scripts
env:
PY_EXE: $(PY_EXE)
GIT_SSL_CAINFO: $(GIT_SSL_CAINFO)
LANG: $(LANG)
PIPENV_DEFAULT_PYTHON_VERSION: '${{ parameters.python_version }}'
PIPENV_DEFAULT_PYTHON_VERSION: $(python.version)
PYTHONWARNINGS: ignore:DEPRECATION
PIPENV_NOSPIN: '1'
Loading