diff options
author | Jason Madden <jamadden@gmail.com> | 2019-07-29 12:10:03 -0500 |
---|---|---|
committer | Jason Madden <jamadden@gmail.com> | 2019-07-29 12:10:03 -0500 |
commit | 439637de0a88959711b7f293e6ed0665796d0575 (patch) | |
tree | c18de8ea750f61364f2dbbb986efb45dfa74e812 | |
parent | cd162671d51427981cb40bb1866fcd81b25fcd0f (diff) | |
download | trollius-git-439637de0a88959711b7f293e6ed0665796d0575.tar.gz |
Copy logic from gevent to install pypy.
-rw-r--r-- | appveyor.yml | 39 |
1 files changed, 38 insertions, 1 deletions
diff --git a/appveyor.yml b/appveyor.yml index 255b638..c61e3e8 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -16,7 +16,44 @@ environment: PYTHON_ARCH: "32" install: - - "set PATH=%PYTHON%;%PYTHON%\\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: "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.1.0-win32.zip")) { + (New-Object Net.WebClient).DownloadFile('https://bitbucket.org/pypy/pypy/downloads/pypy2.7-v7.1.0-win32.zip', "${env:PYTMP}\pypy2-v7.1.0-win32.zip"); + } + 7z x -y "${env:PYTMP}\pypy2-v7.1.0-win32.zip" -oC:\ | Out-Null; + & "${env:PYTHON}\pypy.exe" "-mensurepip"; + + } + 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" |