|
1 | 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_BUILD_FOLDER%\\ci\\appveyor\\run_with_env.cmd" |
| 7 | + PYTHONUNBUFFERED: 1 |
| 8 | + EMBEDDED_LIB: 1 |
| 9 | + PYPI_USER: |
| 10 | + secure: 2m0jy6JD/R9RExIosOT6YA== |
| 11 | + PYPI_PASS: |
| 12 | + secure: x+dF0A8BZUf2IrPNRN1O0w== |
2 | 13 | matrix: |
3 | | - - TARGET_ARCH: "x64" |
4 | | - CONDA_PY: "27" |
5 | | - PY_CONDITION: "python >=2.7,<3" |
6 | | - CONDA_INSTALL_LOCN: "C:\\Miniconda-x64" |
7 | | - - TARGET_ARCH: "x64" |
8 | | - CONDA_PY: "35" |
9 | | - PY_CONDITION: "python >=3.5,<3.6" |
10 | | - CONDA_INSTALL_LOCN: "C:\\Miniconda35-x64" |
11 | | - - TARGET_ARCH: "x64" |
12 | | - CONDA_PY: "36" |
13 | | - PY_CONDITION: "python >=3.6" |
14 | | - CONDA_INSTALL_LOCN: "C:\\Miniconda36-x64" |
15 | | - |
16 | | -matrix: |
17 | | - fast_finish: true |
18 | | - |
19 | | -cache: |
20 | | - - "%TMP%\\py\\" |
21 | | - |
22 | | -build: false |
| 14 | + - PYTHON: "C:\\Python27" |
| 15 | + PYTHON_VERSION: "2.7" |
| 16 | + PYTHON_ARCH: "32" |
| 17 | + MSVC: "Visual Studio 9" |
| 18 | + |
| 19 | + - PYTHON: "C:\\Python27-x64" |
| 20 | + PYTHON_VERSION: "2.7" |
| 21 | + PYTHON_ARCH: "64" |
| 22 | + MSVC: "Visual Studio 9" |
| 23 | + |
| 24 | + - PYTHON: "C:\\Python34" |
| 25 | + PYTHON_VERSION: "3.4" |
| 26 | + PYTHON_ARCH: "32" |
| 27 | + MSVC: "Visual Studio 10" |
| 28 | + |
| 29 | + - PYTHON: "C:\\Python34-x64" |
| 30 | + PYTHON_VERSION: "3.4" |
| 31 | + PYTHON_ARCH: "64" |
| 32 | + MSVC: "Visual Studio 10 Win64" |
| 33 | + |
| 34 | + - PYTHON: "C:\\Python35" |
| 35 | + PYTHON_VERSION: "3.5" |
| 36 | + PYTHON_ARCH: "32" |
| 37 | + MSVC: "Visual Studio 14" |
| 38 | + |
| 39 | + - PYTHON: "C:\\Python35-x64" |
| 40 | + PYTHON_VERSION: "3.5" |
| 41 | + PYTHON_ARCH: "64" |
| 42 | + MSVC: "Visual Studio 14 Win64" |
| 43 | + |
| 44 | + - PYTHON: "C:\\Python36" |
| 45 | + PYTHON_VERSION: "3.6" |
| 46 | + PYTHON_ARCH: "32" |
| 47 | + MSVC: "Visual Studio 14" |
| 48 | + |
| 49 | + - PYTHON: "C:\\Python36-x64" |
| 50 | + PYTHON_VERSION: "3.6" |
| 51 | + PYTHON_ARCH: "64" |
| 52 | + MSVC: "Visual Studio 14 Win64" |
| 53 | + |
23 | 54 | install: |
24 | | - - set CONDA_NPY=19 |
25 | | - # Remove cygwin (and therefore the git that comes with it). |
26 | | - - rmdir C:\cygwin /s /q |
27 | | - # Use the pre-installed Miniconda for the desired arch |
28 | | - - set PATH=%CONDA_INSTALL_LOCN%/Library/bin;%CONDA_INSTALL_LOCN%/Scripts;%PATH% |
29 | | - - conda update --yes --quiet conda |
30 | | - - call %CONDA_INSTALL_LOCN%\Scripts\activate.bat |
31 | | - - conda config --add channels conda-forge |
32 | | - - conda config --set show_channel_urls true |
33 | | - - conda install --yes --quiet conda-build-all |
34 | | - - conda update --yes conda-build |
35 | | - - conda install --yes --quiet conda-forge-build-setup |
36 | | - - run_conda_forge_build_setup |
37 | | - - conda build conda-recipe |
| 55 | + # If there is a newer build queued for the same PR, cancel this one. |
| 56 | + # The AppVeyor 'rollout builds' option is supposed to serve the same |
| 57 | + # purpose but it is problematic because it tends to cancel builds pushed |
| 58 | + # directly to master instead of just PR builds (or the converse). |
| 59 | + # credits: JuliaLang developers. |
| 60 | + - ps: if ($env:APPVEYOR_PULL_REQUEST_NUMBER -and $env:APPVEYOR_BUILD_NUMBER -ne ((Invoke-RestMethod ` |
| 61 | + https://ci.appveyor.com/api/projects/$env:APPVEYOR_ACCOUNT_NAME/$env:APPVEYOR_PROJECT_SLUG/history?recordsNumber=50).builds | ` |
| 62 | + Where-Object pullRequestId -eq $env:APPVEYOR_PULL_REQUEST_NUMBER)[0].buildNumber) { ` |
| 63 | + throw "There are newer queued builds for this pull request, failing early." } |
| 64 | + - ECHO "Installed SDKs:" |
| 65 | + - ps: "ls \"C:/Program Files/Microsoft SDKs/Windows\"" |
| 66 | + |
| 67 | + # Prepend newly installed Python to the PATH of this build (this cannot be |
| 68 | + # done from inside the powershell script as it would require to restart |
| 69 | + # the parent CMD process). |
| 70 | + - "SET PATH=%PYTHON%;%PYTHON%\\Scripts;%PATH%" |
| 71 | + |
| 72 | + # Check that we have the expected version and architecture for Python |
| 73 | + - "python --version" |
| 74 | + - "python -c \"import struct; print(struct.calcsize('P') * 8)\"" |
| 75 | + |
| 76 | + # Upgrade to the latest version of pip to avoid it displaying warnings |
| 77 | + # about it being out of date. |
| 78 | + - "pip install --disable-pip-version-check --user --upgrade pip" |
| 79 | + |
| 80 | + # Install the build dependencies of the project. If some dependencies contain |
| 81 | + # compiled extensions and are not provided as pre-built wheel packages, |
| 82 | + # pip will build them from source using the MSVC compiler matching the |
| 83 | + # target Python version and architecture |
| 84 | + - "%CMD_IN_ENV% pip install -r requirements_dev.txt" |
| 85 | + - "%CMD_IN_ENV% pip install -U wheel setuptools twine" |
| 86 | + - git submodule update --init --recursive |
| 87 | + |
| 88 | + # .c files need to be generated on Windows to handle platform |
| 89 | + # specific code. |
| 90 | + # Fix version used by versioneer to current git tag so the generated .c files |
| 91 | + # do not cause a version change. |
| 92 | + - python ci/appveyor/fix_version.py . |
| 93 | + - mv -f .git .git.bak |
| 94 | + |
| 95 | +build_script: |
| 96 | + # Build the compiled extension |
| 97 | + - "%CMD_IN_ENV% ci\\appveyor\\build_ssh2.bat" |
| 98 | + - rm -f ssh2/*.c |
| 99 | + - "%CMD_IN_ENV% python setup.py build" |
| 100 | + - "%CMD_IN_ENV% python setup.py build_ext -i" |
38 | 101 |
|
39 | 102 | test_script: |
40 | | - - python ci\move-conda-package.py |
| 103 | + - python -c "from ssh2.session import Session; Session()" |
41 | 104 |
|
42 | | -platform: |
43 | | - - x64 |
| 105 | +after_test: |
| 106 | + # If tests are successful, create binary packages for the project. |
| 107 | + - "%CMD_IN_ENV% python setup.py bdist_wheel" |
| 108 | + - "%CMD_IN_ENV% python setup.py bdist_wininst" |
| 109 | + - mv dist/* . |
| 110 | + # Create 'none' ABI dist packages for use by older pip/wheel versions |
| 111 | + - python ci/copy_abi_dist.py *.whl |
44 | 112 |
|
45 | 113 | artifacts: |
46 | | - - path: '*.tar.bz2' |
| 114 | + # Archive the generated packages in the ci.appveyor.com build report. |
| 115 | + - path: "*.whl" |
| 116 | + - path: "*.exe" |
| 117 | + |
| 118 | +deploy_script: |
| 119 | + - python ci/appveyor/pypi_upload.py *.whl |
| 120 | + - python ci/appveyor/pypi_upload.py *.exe |
0 commit comments