Skip to content

Commit

Permalink
Add installation of missing python versions.
Browse files Browse the repository at this point in the history
  • Loading branch information
jamadden committed Nov 11, 2020
1 parent a68b182 commit e77433c
Showing 1 changed file with 51 additions and 1 deletion.
52 changes: 51 additions & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,57 +30,107 @@ environment:
- PYTHON_ROOT: "C:\\Python27"
PYTHON_ARCH: "32"
PYTHON_VERSION: "2.7.x"
PYTHON_EXE: python

- PYTHON_ROOT: "C:\\Python27-x64"
PYTHON_ARCH: "64"
PYTHON_VERSION: "2.7.x"
PYTHON_EXE: python

- PYTHON_ROOT: "C:\\Python35"
PYTHON_ARCH: "32"
PYTHON_VERSION: "3.5.x"
PYTHON_EXE: python

- PYTHON_ROOT: "C:\\Python35-x64"
PYTHON_ARCH: "64"
PYTHON_VERSION: "3.5.x"
PYTHON_EXE: python

- PYTHON_ROOT: "C:\\Python36"
PYTHON_ARCH: "32"
PYTHON_VERSION: "3.6.x"
PYTHON_EXE: python

- PYTHON_ROOT: "C:\\Python36-x64"
PYTHON_ARCH: "64"
PYTHON_VERSION: "3.6.x"
PYTHON_EXE: python

- PYTHON_ROOT: "C:\\Python37"
PYTHON_ARCH: "32"
PYTHON_VERSION: "3.7.x"
PYTHON_EXE: python

- PYTHON_ROOT: "C:\\Python37-x64"
PYTHON_ARCH: "64"
PYTHON_VERSION: "3.7.x"
PYTHON_EXE: python

- PYTHON_ROOT: "C:\\Python38"
PYTHON_ARCH: "32"
PYTHON_VERSION: "3.8.x"
PYTHON_EXE: python

- PYTHON_ROOT: "C:\\Python38-x64"
PYTHON_ARCH: "64"
PYTHON_VERSION: "3.8.x"
PYTHON_EXE: python

- PYTHON_ROOT: "C:\\Python39"
PYTHON_ARCH: "32"
PYTHON_VERSION: "3.9.x"
PYTHON_EXE: python

- PYTHON_ROOT: "C:\\Python39-x64"
PYTHON_ARCH: "64"
PYTHON_VERSION: "3.9.x"
PYTHON_EXE: python

cache:
- "%TMP%\\py\\"
- '%LOCALAPPDATA%\pip\Cache -> appveyor.yml,setup.py'

install:
- "SET PATH=%PYTHON_ROOT%;%PYTHON_ROOT%\\Scripts;%PATH%"
# If there is a newer build queued for the same PR, cancel this one.
# The AppVeyor 'rollout builds' option is supposed to serve the same
# purpose but it is problematic because it tends to cancel builds pushed
# directly to master instead of just PR builds (or the converse).
# credits: JuliaLang developers.
- ps: if ($env:APPVEYOR_PULL_REQUEST_NUMBER -and $env:APPVEYOR_BUILD_NUMBER -ne ((Invoke-RestMethod `
https://ci.appveyor.com/api/projects/$env:APPVEYOR_ACCOUNT_NAME/$env:APPVEYOR_PROJECT_SLUG/history?recordsNumber=50).builds | `
Where-Object pullRequestId -eq $env:APPVEYOR_PULL_REQUEST_NUMBER)[0].buildNumber) { `
throw "There are newer queued builds for this pull request, failing early." }
- ECHO "Filesystem root:"
- ps: "ls \"C:/\""

- ECHO "Installed SDKs:"
- ps: "if(Test-Path(\"C:/Program Files/Microsoft SDKs/Windows\")) {ls \"C:/Program Files/Microsoft SDKs/Windows\";}"

# Install Python (from the official .msi of http://python.org) and pip when
# not already installed.
# PyPy portion based on https://github.com/wbond/asn1crypto/blob/master/appveyor.yml
- ps:
$env:PYTMP = "${env:TMP}\py";
if (!(Test-Path "$env:PYTMP")) {
New-Item -ItemType directory -Path "$env:PYTMP" | Out-Null;
}
if ("${env:PYTHON_ID}" -eq "pypy") {
if (!(Test-Path "${env:PYTMP}\pypy2-v7.3.1-win32.zip")) {
(New-Object Net.WebClient).DownloadFile('https://bitbucket.org/pypy/pypy/downloads/pypy2.7-v7.3.1-win32.zip', "${env:PYTMP}\pypy2-v7.3.1-win32.zip");
}
7z x -y "${env:PYTMP}\pypy2-v7.3.1-win32.zip" -oC:\ | Out-Null;
}
elseif (-not(Test-Path($env:PYTHON))) {
& appveyor\install.ps1;
}

# Prepend newly installed Python to the PATH of this build (this cannot be
# done from inside the powershell script as it would require to restart
# the parent CMD process).
- "SET PATH=%PYTHON%;%PYTHON%\\Scripts;%PYTHON%\\bin;%PATH%"
- "SET PYEXE=%PYTHON%\\%PYTHON_EXE%.exe"

- "python --version"
- "python -c \"import struct; print(struct.calcsize('P') * 8)\""

Expand Down

0 comments on commit e77433c

Please sign in to comment.