File tree Expand file tree Collapse file tree 1 file changed +22
-2
lines changed Expand file tree Collapse file tree 1 file changed +22
-2
lines changed Original file line number Diff line number Diff line change @@ -11,11 +11,31 @@ environment:
1111 - python : 38
1212 - python : 38-x64
1313 - python : 39
14- image : Visual Studio 2019
14+ python_version : 3.9.0
1515 - python : 39-x64
16- image : Visual Studio 2019
16+ python_version : 3.9.0
1717
1818install :
19+ - ps : |
20+ # from https://github.com/appveyor/build-images/blob/27bde614bc60d7ef7a8bc46182f4d7582fa11b56/scripts/Windows/install_python.ps1#L88-L108
21+ function InstallPythonEXE($targetPath, $version) {
22+ $urlPlatform = ""
23+ if ($targetPath -match '-x64$') {
24+ $urlPlatform = "-amd64"
25+ }
26+ Write-Host "Installing Python $version$urlPlatform to $($targetPath)..." -ForegroundColor Cyan
27+ $downloadUrl = "https://www.python.org/ftp/python/$version/python-$version$urlPlatform.exe"
28+ Write-Host "Downloading $($downloadUrl)..."
29+ $exePath = "$env:TEMP\python-$version.exe"
30+ (New-Object Net.WebClient).DownloadFile($downloadUrl, $exePath)
31+ Write-Host "Installing..."
32+ cmd /c start /wait $exePath /quiet TargetDir="$targetPath" Shortcuts=0 Include_launcher=1 InstallLauncherAllUsers=1 Include_debug=1
33+ Remove-Item $exePath
34+ Write-Host "Installed Python $version" -ForegroundColor Green
35+ }
36+ if ( -not ( Test-Path -Path C:\\Python$env:PYTHON -PathType Container ) ) {
37+ InstallPythonEXE C:\\Python$env:PYTHON $env:PYTHON_VERSION
38+ }
1939 - SET PATH=C:\\Python%PYTHON%;c:\\Python%PYTHON%\\scripts;%PATH%
2040 - python -m pip install -U pip wheel setuptools
2141
You can’t perform that action at this time.
0 commit comments