Skip to content

Commit 25479bb

Browse files
scbeddbenbp
andauthored
Retry Seed Download (Azure#23353)
* seed stage will attempt re-download. bump to newer version of virtualenv. bump to a newer version of pip in prep_environment * ensure we install wheel so that we aren't forced onto setup.py only during installation of ci_tools.txt * moving pin of black so we don't install it when it is unused Co-authored-by: Ben Broderick Phillips <[email protected]>
1 parent b0ba977 commit 25479bb

File tree

5 files changed

+58
-11
lines changed

5 files changed

+58
-11
lines changed

eng/ci_tools.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
cryptography<4
33
setuptools==44.1.0; python_version == '2.7'
44
setuptools==46.4.0; python_version >= '3.5'
5-
virtualenv==20.0.23
5+
virtualenv==20.13.2
66
wheel==0.37.0
77
Jinja2==2.11.2
88
packaging==20.4
@@ -17,7 +17,6 @@ codecov==2.1.0
1717
beautifulsoup4==4.9.1
1818
pkginfo==1.5.0.1
1919
pip==20.3.3
20-
black==21.6b0; python_version >= '3.6'
2120
wrapt<=1.12.1; python_version == '2.7'
2221
markupsafe==2.0.1; python_version > '2.7'
2322
markupsafe==1.1.1; python_version == '2.7'

eng/pipelines/templates/steps/build-test.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ steps:
3232
versionSpec: '${{ parameters.PythonVersion }}'
3333

3434
- script: |
35-
python -m pip install pip==20.1
35+
python -m pip install pip==20.3.3
36+
python -m pip install wheel==0.37.0
3637
pip install -r eng/ci_tools.txt
3738
pip --version
3839
pip freeze

eng/pipelines/templates/steps/run_black.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ steps:
1111
condition: succeededOrFailed()
1212

1313
- script: |
14-
pip install -r eng/ci_tools.txt
14+
pip install black==21.6b0
1515
displayName: 'Prep Environment'
1616
condition: succeededOrFailed()
1717

eng/pipelines/templates/steps/seed-virtualenv-wheels.yml

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,9 @@ steps:
1414
displayName: Set VIRTUALENV_OVERRIDE_APP_DATA
1515
1616
- pwsh: |
17-
# ensure these can be pulled down from pypi.
18-
$env:PIP_EXTRA_INDEX_URL="https://pypi.python.org/simple"
19-
virtualenv --download --reset-app-data `
20-
--pip="${{ parameters.PIP_VERSION }}" `
21-
--setuptools="${{ parameters.SETUPTOOLS_VERSION }}" `
22-
--wheel=="${{ parameters.WHEEL_VERSION }}" `
23-
$(Agent.TempDirectory)/seed_env
17+
$(Build.SourcesDirectory)/eng/scripts/seed-virtualenv-wheels.ps1 `
18+
-Pip "${{ parameters.PIP_VERSION }}" `
19+
-SetupTools "${{ parameters.SETUPTOOLS_VERSION }}" `
20+
-Wheel "${{ parameters.WHEEL_VERSION }}" `
21+
-SeedDirectory "$(Agent.TempDirectory)/seed_env"
2422
displayName: Populate the seed dir
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
<#
2+
.SYNOPSIS
3+
Creates a virtual environment while seeding with specific versions of setuptools, wheel, and pip.
4+
5+
.DESCRIPTION
6+
Creates a virtual environment with three specifically targeted wheel versions. When used in conjunction with the environment variable
7+
VIRTUALENV_OVERRIDE_APP_DATA, further virtualenv creations will leverage these targeted wheels specifically.
8+
9+
.PARAMETER Pip
10+
The targeted pip version.
11+
12+
.PARAMETER SetupTools
13+
The targeted setuptools version.
14+
15+
.PARAMETER Wheel
16+
The targeted wheel version.
17+
18+
.PARAMETER SeedDirectory
19+
The location of the virtualenv that will be created.
20+
#>
21+
param (
22+
$Pip,
23+
$SetupTools,
24+
$Wheel,
25+
$SeedDirectory
26+
)
27+
28+
$attempts = 0
29+
30+
# ensure these can be pulled down from pypi.
31+
$env:PIP_EXTRA_INDEX_URL="https://pypi.python.org/simple"
32+
33+
while ($attempts -lt 3) {
34+
virtualenv --download --reset-app-data `
35+
--pip="$Pip" `
36+
--setuptools="$SetupTools" `
37+
--wheel="$Wheel" `
38+
"$SeedDirectory"
39+
if ($LASTEXITCODE -eq 0) {
40+
break
41+
}
42+
43+
$attempts += 1
44+
}
45+
46+
if ($LASTEXITCODE -ne 0) {
47+
Write-Error "Unable to successfully populate an app data directory."
48+
exit $LASTEXITCODE
49+
}

0 commit comments

Comments
 (0)