|
| 1 | +environment: |
| 2 | + global: |
| 3 | + # SDK v7.0 MSVC Express 2008's SetEnv.cmd script will fail if the |
| 4 | + # /E:ON and /V:ON options are not enabled in the batch script intepreter |
| 5 | + # See: http://stackoverflow.com/a/13751649/163740 |
| 6 | + CMD_IN_ENV: "cmd /E:ON /V:ON /C .\\appveyor\\run_with_env.cmd" |
| 7 | + |
| 8 | + matrix: |
| 9 | + |
| 10 | + # Pre-installed Python versions, which Appveyor may upgrade to |
| 11 | + # a later point release. |
| 12 | + |
| 13 | + - PYTHON: "C:\\Python34-x64" |
| 14 | + PYTHON_VERSION: "3.4.x" # currently 3.4.3 |
| 15 | + PYTHON_ARCH: "64" |
| 16 | + PYTHON_EXE: python |
| 17 | + |
| 18 | + - PYTHON: "C:\\Python27-x64" |
| 19 | + PYTHON_VERSION: "2.7.x" # currently 2.7.11 |
| 20 | + PYTHON_ARCH: "64" |
| 21 | + PYTHON_EXE: python |
| 22 | + |
| 23 | + - PYTHON: "C:\\Python35-x64" |
| 24 | + PYTHON_VERSION: "3.5.x" # currently 3.5.1 |
| 25 | + PYTHON_ARCH: "64" |
| 26 | + PYTHON_EXE: python |
| 27 | + |
| 28 | + - PYTHON: "C:\\Python33-x64" |
| 29 | + PYTHON_VERSION: "3.3.x" # currently 3.3.5 |
| 30 | + PYTHON_ARCH: "64" |
| 31 | + PYTHON_EXE: python |
| 32 | + |
| 33 | + - PYTHON: "C:\\Python35" |
| 34 | + PYTHON_VERSION: "3.5.x" # currently 3.5.0 |
| 35 | + PYTHON_ARCH: "32" |
| 36 | + PYTHON_EXE: python |
| 37 | + |
| 38 | + - PYTHON: "C:\\Python27" |
| 39 | + PYTHON_VERSION: "2.7.x" # currently 2.7.11 |
| 40 | + PYTHON_ARCH: "32" |
| 41 | + PYTHON_EXE: python |
| 42 | + |
| 43 | + - PYTHON: "C:\\Python33" |
| 44 | + PYTHON_VERSION: "3.3.x" # currently 3.3.5 |
| 45 | + PYTHON_ARCH: "32" |
| 46 | + PYTHON_EXE: python |
| 47 | + |
| 48 | + - PYTHON: "C:\\Python34" |
| 49 | + PYTHON_VERSION: "3.4.x" # currently 3.4.3 |
| 50 | + PYTHON_ARCH: "32" |
| 51 | + PYTHON_EXE: python |
| 52 | + |
| 53 | +install: |
| 54 | + # If there is a newer build queued for the same PR, cancel this one. |
| 55 | + # The AppVeyor 'rollout builds' option is supposed to serve the same |
| 56 | + # purpose but it is problematic because it tends to cancel builds pushed |
| 57 | + # directly to master instead of just PR builds (or the converse). |
| 58 | + # credits: JuliaLang developers. |
| 59 | + - ps: if ($env:APPVEYOR_PULL_REQUEST_NUMBER -and $env:APPVEYOR_BUILD_NUMBER -ne ((Invoke-RestMethod ` |
| 60 | + https://ci.appveyor.com/api/projects/$env:APPVEYOR_ACCOUNT_NAME/$env:APPVEYOR_PROJECT_SLUG/history?recordsNumber=50).builds | ` |
| 61 | + Where-Object pullRequestId -eq $env:APPVEYOR_PULL_REQUEST_NUMBER)[0].buildNumber) { ` |
| 62 | + throw "There are newer queued builds for this pull request, failing early." } |
| 63 | + - ECHO "Filesystem root:" |
| 64 | + - ps: "ls \"C:/\"" |
| 65 | + |
| 66 | + - ECHO "Installed SDKs:" |
| 67 | + - ps: "ls \"C:/Program Files/Microsoft SDKs/Windows\"" |
| 68 | + |
| 69 | + # Install Python (from the official .msi of http://python.org) and pip when |
| 70 | + # not already installed. |
| 71 | + # PyPy portion based on https://github.com/wbond/asn1crypto/blob/master/appveyor.yml |
| 72 | + - ps: |
| 73 | + $env:PYTMP = "${env:TMP}\py"; |
| 74 | + if (!(Test-Path "$env:PYTMP")) { |
| 75 | + New-Item -ItemType directory -Path "$env:PYTMP" | Out-Null; |
| 76 | + } |
| 77 | + if ("${env:PYTHON_ID}" -eq "pypy") { |
| 78 | + if (!(Test-Path "${env:PYTMP}\pypy-4.0.1-win32.zip")) { |
| 79 | + (New-Object Net.WebClient).DownloadFile('https://bitbucket.org/pypy/pypy/downloads/pypy-4.0.1-win32.zip', "${env:PYTMP}\pypy-4.0.1-win32.zip"); |
| 80 | + } |
| 81 | + 7z x -y "${env:PYTMP}\pypy-4.0.1-win32.zip" -oC:\ | Out-Null; |
| 82 | + if (!(Test-Path "${env:PYTMP}\get-pip.py")) { |
| 83 | + (New-Object Net.WebClient).DownloadFile('https://bootstrap.pypa.io/get-pip.py', "${env:PYTMP}\get-pip.py"); |
| 84 | + } |
| 85 | + & "${env:PYTHON}\pypy.exe" "${env:PYTMP}\get-pip.py"; |
| 86 | + |
| 87 | + } |
| 88 | + elseif (-not(Test-Path($env:PYTHON))) { |
| 89 | + & appveyor\install.ps1; |
| 90 | + } |
| 91 | + |
| 92 | + # Prepend newly installed Python to the PATH of this build (this cannot be |
| 93 | + # done from inside the powershell script as it would require to restart |
| 94 | + # the parent CMD process). |
| 95 | + - "SET PATH=%PYTHON%;%PYTHON%\\Scripts;%PYTHON%\\bin;%PATH%" |
| 96 | + - "SET PYEXE=%PYTHON%\\%PYTHON_EXE%.exe" |
| 97 | + |
| 98 | + # Check that we have the expected version and architecture for Python |
| 99 | + - "%PYEXE% --version" |
| 100 | + - "%PYEXE% -c \"import struct; print(struct.calcsize('P') * 8)\"" |
| 101 | + |
| 102 | + # Upgrade to the latest version of pip to avoid it displaying warnings |
| 103 | + # about it being out of date. |
| 104 | + - "%CMD_IN_ENV% pip install --disable-pip-version-check --user --upgrade pip" |
| 105 | + |
| 106 | + # Install the build dependencies of the project. If some dependencies contain |
| 107 | + # compiled extensions and are not provided as pre-built wheel packages, |
| 108 | + # pip will build them from source using the MSVC compiler matching the |
| 109 | + # target Python version and architecture |
| 110 | + # NOTE: psutil won't install under PyPy. |
| 111 | + - "%CMD_IN_ENV% pip install -r requirements.txt" |
| 112 | + |
| 113 | + - ps: "if(Test-Path(\"${env:PYTHON}\\bin\")) {ls ${env:PYTHON}\\bin;}" |
| 114 | + - ps: "if(Test-Path(\"${env:PYTHON}\\Scripts\")) {ls ${env:PYTHON}\\Scripts;}" |
| 115 | + |
| 116 | +cache: |
| 117 | + - "%TMP%\\py\\" |
| 118 | + |
| 119 | +build_script: |
| 120 | + # Build the compiled extension |
| 121 | + - "%CMD_IN_ENV% %PYEXE% setup.py bdist_wheel bdist_wininst" |
| 122 | + - ps: "ls dist" |
| 123 | + # Now install the wheel. |
| 124 | + # I couldn't get wildcards to work for pip install, so stuff it |
| 125 | + # into a variable, using python to glob. |
| 126 | + - "%PYEXE% -c \"import glob; print(glob.glob('dist/*whl')[0])\" > whl.txt" |
| 127 | + - set /p PYWHL=<whl.txt |
| 128 | + - pip install %PYWHL% |
| 129 | + |
| 130 | +test_script: |
| 131 | + # Run the project tests |
| 132 | + - %PYEXE% setup.py nosetests --with-coverage --cover-package=pssh |
| 133 | + - %PYEXE% -c 'import sys; sys.version_info >= (3,) and sys.exit(1)' || eval "2to3 -nw embedded_server/*.py && 2to3 tests/*.py -o tests3 -nw && cp tests/test_client_private_key* tests3/ && python setup.py nosetests -w tests3 --with-coverage --cover-package=pssh" |
| 134 | + |
| 135 | +after_test: |
| 136 | + # We already built the wheel during build_script, because it's |
| 137 | + # much faster to do that and install from the wheel than to |
| 138 | + # rebuild it here (because we wind up re-building all the cython |
| 139 | + # code, even though it's already built on disk; our make.cmd is not smart) |
| 140 | + #- "%CMD_IN_ENV% %PYEXE% setup.py bdist_wheel bdist_wininst" |
| 141 | + - ps: "ls dist" |
| 142 | + |
| 143 | +artifacts: |
| 144 | + # Archive the generated wheel package in the ci.appveyor.com build report. |
| 145 | + - path: dist\* |
| 146 | + |
| 147 | +#on_success: |
| 148 | +# - TODO: upload the content of dist/*.whl to a public wheelhouse |
| 149 | +# |
0 commit comments