Skip to content

Commit 5a21f3f

Browse files
committed
install python 3.9 via windows installer on appveyor
Signed-off-by: oleg.hoefling <[email protected]>
1 parent 0275bbe commit 5a21f3f

File tree

1 file changed

+22
-2
lines changed

1 file changed

+22
-2
lines changed

.appveyor.yml

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff 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

1818
install:
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

0 commit comments

Comments
 (0)