Skip to content

Commit e268b8f

Browse files
committed
generalize the script, assuming we always want revision 0 (3.8.0rc1 here)
1 parent 8623a66 commit e268b8f

File tree

2 files changed

+4
-9
lines changed

2 files changed

+4
-9
lines changed

.appveyor.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,5 +80,5 @@ test_script:
8080
- ps: .\install_python.ps1
8181
- set PYTHON=C:\Python37-x64
8282
- ps: .\install_python.ps1
83-
- set PYTHON=C:\Python38-x64
83+
- set PYTHON=C:\Python38rc1-x64
8484
- ps: .\install_python.ps1

install_python.ps1

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,9 @@ $py_exe = "${env:PYTHON}\Python.exe"
77
if ( [System.IO.File]::Exists($py_exe) ) {
88
exit 0
99
}
10-
$req_nodot = $env:PYTHON -replace '\D+Python(\d+)(?:-x64)?','$1'
10+
$req_nodot = $env:PYTHON -replace '\D+Python(\d+(?:rc\d+))(?:-x64)?','$1'
1111
$req_ver = $req_nodot -replace '(\d)(\d+)','$1.$2.0'
12+
$req_dir = $req_nodot -replace '(\d)(\d+)(.*)','$1.$2.0'
1213

1314
if ($env:PYTHON -eq "C:\Python${req_nodot}-x64") {
1415
$exe_suffix="-amd64"
@@ -21,13 +22,7 @@ if ($env:PYTHON -eq "C:\Python${req_nodot}-x64") {
2122
$py_url = "https://www.python.org/ftp/python"
2223
Write-Host "Installing Python ${req_ver}$exe_suffix..." -ForegroundColor Cyan
2324
$exePath = "$env:TEMP\python-${req_ver}${exe_suffix}.exe"
24-
25-
if ($req_nodot -eq "38") {
26-
$downloadFile = "$py_url/${req_ver}/python-${req_ver}rc1${exe_suffix}.exe"
27-
}
28-
else {
29-
$downloadFile = "$py_url/${req_ver}/python-${req_ver}${exe_suffix}.exe"
30-
}
25+
$downloadFile = "$py_url/${req_dir}/python-${req_ver}${exe_suffix}.exe"
3126

3227
Write-Host "Downloading $downloadFile..."
3328
(New-Object Net.WebClient).DownloadFile($downloadFile, $exePath)

0 commit comments

Comments
 (0)