appveyor.yml 10.2 KB
Newer Older
1
clone_depth: 50
2 3
max_jobs: 8
shallow_clone: true
Jason Madden's avatar
Jason Madden committed
4 5 6
build:
  parallel: true
  verbosity: minimal
Jason Madden's avatar
Jason Madden committed
7 8 9
# The VS 2019 image doesn't have
# the MSVC needed for Python 2.7.
image: Visual Studio 2015
10

11 12
environment:
  global:
Jason Madden's avatar
Jason Madden committed
13
    APPVEYOR_SAVE_CACHE_ON_ERROR: "true"
14
    # SDK v7.0 MSVC Express 2008's SetEnv.cmd script will fail if the
15
    # /E:ON and /V:ON options are not enabled in the batch script interpreter
16 17
    # See: http://stackoverflow.com/a/13751649/163740
    CMD_IN_ENV: "cmd /E:ON /V:ON /C .\\appveyor\\run_with_env.cmd"
18 19
    # Use a fixed hash seed for reproducability
    PYTHONHASHSEED: 8675309
20 21 22 23
    # Disable tests that use external network resources;
    # too often we get failures to resolve DNS names or failures
    # to connect on AppVeyor.
    GEVENTTEST_USE_RESOURCES: "-network"
24 25 26
    # Don't get warnings about Python 2 support being deprecated. We
    # know.
    PIP_NO_PYTHON_VERSION_WARNING: 1
Jason Madden's avatar
Jason Madden committed
27
    PIP_UPGRADE_STRATEGY: eager
28 29 30 31 32
    # Stay on the legacy implementation of editable installs.
    # Recent versions of setuptools has changed how editable installs work,
    # which broke Appveyor builds.
    # For a relevant upstream issue, see https://github.com/pypa/setuptools/issues/3557
    SETUPTOOLS_ENABLE_FEATURES: "legacy-editable"
33 34 35
    # Enable this if debugging a resource leak. Otherwise
    # it slows things down.
    # PYTHONTRACEMALLOC: 10
36 37 38 39
    ##
    # Upload settings for twine.
    TWINE_USERNAME: "__token__"
    TWINE_PASSWORD:
40
      secure: uXZ6Juhz2hElaTsaJ2Hnemm+YoYbjpkoT5NFFlj4xxSlZvUrjoiOdvPqxxCaNYozWIRM5QmXlj1nOF8nZDpzx7oAyVIMT2x3z9iI0C/G5r4G8uvbJJq6wpJRI5HQ3sE39qLK2MCPZJ3BTu/uvVgWWqQ6wInKXxNqDGyf9IgZOv3/sCd4CwD7bEqlwHzyeh9a2o17a5J1YMhL03LVRcrlmjN8/Ds642FtnF/e+VAhUdtZvU1ze8rfeR7KCe4ehOmy18dh5joPX8TJKbg/AJlIYQ==
41

42

43
  matrix:
44 45 46

    # Pre-installed Python versions, which Appveyor may upgrade to
    # a later point release.
47 48

    # 64-bit
49 50 51 52 53 54
    - PYTHON: "C:\\Python311-x64"
      PYTHON_VERSION: "3.11.0"
      PYTHON_ARCH: "64"
      PYTHON_EXE: python
      APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019

Jason Madden's avatar
Jason Madden committed
55 56 57 58 59 60 61
    - PYTHON: "C:\\pypy3.7-v7.3.7-win64"
      PYTHON_ID: "pypy3"
      PYTHON_EXE: pypy3w
      PYTHON_VERSION: "3.7.x"
      PYTHON_ARCH: "64"
      APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019

62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77
    - PYTHON: "C:\\pypy2.7-v7.3.6-win64"
      PYTHON_ID: "pypy"
      PYTHON_EXE: pypy
      PYTHON_VERSION: "2.7.x"
      PYTHON_ARCH: "64"
      # If we leave this at 2015, we hit a bug in distutils+PyPy:
      # https://ci.appveyor.com/project/jamadden/gevent/builds/41819005/job/nvv7udya8ylwoqhh
      #      File "C:\pypy2.7-v7.3.6-win64\lib-python\2.7\distutils\_msvccompiler.py", line 122, in _get_vc_env
      #     vcvarsall, _ = _find_vcvarsall(plat_spec)
      #   File "C:\pypy2.7-v7.3.6-win64\lib-python\2.7\distutils\_msvccompiler.py", line 102, in _find_vcvarsall
      #     best_version, best_dir = _find_vc2015()
      #   File "C:\pypy2.7-v7.3.6-win64\lib-python\2.7\distutils\_msvccompiler.py", line 35, in _find_vc2015
      #     access=winreg.KEY_READ | winreg.KEY_WOW64_32KEY
      # TypeError: OpenKey() got an unexpected keyword argument 'access'
      APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017

78
    - PYTHON: "C:\\Python310-x64"
Jason Madden's avatar
Jason Madden committed
79
      PYTHON_VERSION: "3.10.0"
80 81 82 83
      PYTHON_ARCH: "64"
      PYTHON_EXE: python
      APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019

84 85 86 87 88 89
    - PYTHON: "C:\\Python39-x64"
      PYTHON_VERSION: "3.9.x"
      PYTHON_ARCH: "64"
      PYTHON_EXE: python
      APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019

90

Jason Madden's avatar
Jason Madden committed
91 92 93 94
    - PYTHON: "C:\\Python38-x64"
      PYTHON_VERSION: "3.8.x"
      PYTHON_ARCH: "64"
      PYTHON_EXE: python
Jason Madden's avatar
Jason Madden committed
95
      APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
96

Jason Madden's avatar
Jason Madden committed
97 98 99 100
    - PYTHON: "C:\\Python37-x64"
      PYTHON_VERSION: "3.7.x"
      PYTHON_ARCH: "64"
      PYTHON_EXE: python
Jason Madden's avatar
Jason Madden committed
101
      APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
102

Jason Madden's avatar
Jason Madden committed
103
    - PYTHON: "C:\\Python36-x64"
Jason Madden's avatar
Jason Madden committed
104
      PYTHON_VERSION: "3.6.x" # currently 3.6.8
105 106 107
      PYTHON_ARCH: "64"
      PYTHON_EXE: python

108 109

    # 32-bit, wheel only (no testing)
110 111 112 113 114 115 116
    - PYTHON: "C:\\Python39"
      PYTHON_VERSION: "3.9.x"
      PYTHON_ARCH: "32"
      PYTHON_EXE: python
      APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
      GWHEEL_ONLY: true

Jason Madden's avatar
Jason Madden committed
117 118 119 120
    - PYTHON: "C:\\Python38"
      PYTHON_VERSION: "3.8.x"
      PYTHON_ARCH: "32"
      PYTHON_EXE: python
Jason Madden's avatar
Jason Madden committed
121
      APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
Jason Madden's avatar
Jason Madden committed
122
      GWHEEL_ONLY: true
123 124 125

    - PYTHON: "C:\\Python37"
      PYTHON_VERSION: "3.7.x"
126 127
      PYTHON_ARCH: "32"
      PYTHON_EXE: python
Jason Madden's avatar
Jason Madden committed
128
      APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
129
      GWHEEL_ONLY: true
130

131 132
    - PYTHON: "C:\\Python36"
      PYTHON_VERSION: "3.6.x" # currently 3.6.3
133 134
      PYTHON_ARCH: "32"
      PYTHON_EXE: python
135
      GWHEEL_ONLY: true
136

137 138
    - PYTHON: "C:\\Python27"
      PYTHON_VERSION: "2.7.x" # currently 2.7.13
139 140 141
      PYTHON_ARCH: "32"
      PYTHON_EXE: python
      GWHEEL_ONLY: true
142

Jason Madden's avatar
Jason Madden committed
143 144 145 146 147 148 149 150 151 152 153 154 155 156
    - PYTHON: "C:\\Python27-x64"
      PYTHON_VERSION: "2.7.x" # currently 2.7.13
      PYTHON_ARCH: "64"
      PYTHON_EXE: python
      # greenlet 2.0 is evincing a warning (probably?)
      # on shutdown, leading to the dreaded error:
      #   Fatal Python error: PyImport_GetModuleDict: no module
      #   dictionary!
      # in some tests. This is hard to debug remotely, and as support
      # for 2.7 is winding down quickly (hey, we're only two years
      # late to the party) I'm not specifically going to try to debug
      # it. We'll just provide a binary wheel still.
      GWHEEL_ONLY: true

157 158 159 160 161 162 163 164
    # Also test a Python version not pre-installed
    # See: https://github.com/ogrisel/python-appveyor-demo/issues/10

    # - PYTHON: "C:\\Python266"
    #   PYTHON_VERSION: "2.6.6"
    #   PYTHON_ARCH: "32"
    #   PYTHON_EXE: python

165
# matrix:
Jason Madden's avatar
Jason Madden committed
166 167
#   allow_failures:
#     - PYTHON_ID: "pypy"
168

169
install:
170 171 172 173 174 175 176 177 178
  # 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." }
179 180 181 182
  - ECHO "Filesystem root:"
  - ps: "ls \"C:/\""

  - ECHO "Installed SDKs:"
183
  - ps: "if(Test-Path(\"C:/Program Files/Microsoft SDKs/Windows\")) {ls \"C:/Program Files/Microsoft SDKs/Windows\";}"
184 185 186 187 188 189 190 191 192 193

  # 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") {
194 195
        if (!(Test-Path "${env:PYTMP}\pypy2-v7.3.6-win64.zip")) {
          (New-Object Net.WebClient).DownloadFile('https://downloads.python.org/pypy/pypy2.7-v7.3.6-win64.zip', "${env:PYTMP}\pypy2-v7.3.6-win64.zip");
196
        }
197
        7z x -y "${env:PYTMP}\pypy2-v7.3.6-win64.zip" -oC:\ | Out-Null;
198
      }
Jason Madden's avatar
Jason Madden committed
199 200 201 202 203 204
      elseif ("${env:PYTHON_ID}" -eq "pypy3") {
        if (!(Test-Path "${env:PYTMP}\pypy3.7-v7.3.7-win64.zip")) {
          (New-Object Net.WebClient).DownloadFile("https://downloads.python.org/pypy/pypy3.7-v7.3.7-win64.zip", "${env:PYTMP}\pypy3.7-v7.3.7-win64.zip");
        }
        7z x -y "${env:PYTMP}\pypy3.7-v7.3.7-win64.zip" -oC:\ | Out-Null;
      }
205 206 207 208 209 210 211 212 213 214 215 216 217 218
      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"

  # Check that we have the expected version and architecture for Python
  - "%PYEXE% --version"
  - "%PYEXE% -c \"import struct; print(struct.calcsize('P') * 8)\""

219
  # Upgrade to the latest version of pip to avoid it displaying warnings
220 221 222 223
  # about it being out of date. Do this here instead of above in
  # powershell because the annoying 'DEPRECATION:blahblahblah 2.7 blahblahblah'
  # breaks powershell.
  - "%CMD_IN_ENV% %PYEXE% -mensurepip -U --user"
224
  - "%CMD_IN_ENV% %PYEXE% -mpip install -U --user pip"
225

226 227 228 229 230
  - ps: "if(Test-Path(\"${env:PYTHON}\\bin\")) {ls ${env:PYTHON}\\bin;}"
  - ps: "if(Test-Path(\"${env:PYTHON}\\Scripts\")) {ls ${env:PYTHON}\\Scripts;}"

cache:
  - "%TMP%\\py\\"
Jason Madden's avatar
Jason Madden committed
231
  - '%LOCALAPPDATA%\pip\Cache -> appveyor.yml,setup.py'
232

233
build_script:
234
  # Build the compiled extension
Jason Madden's avatar
Jason Madden committed
235 236
  - "%CMD_IN_ENV% %PYEXE% -m pip install -U wheel"
  - "%CMD_IN_ENV% %PYEXE% -m pip install -U setuptools"
237
  - if not "%GWHEEL_ONLY%"=="true" %PYEXE% -m pip install -U -e .[test]
238 239

test_script:
240
  # Run the project tests
241
  - if not "%GWHEEL_ONLY%"=="true" %PYEXE% -c "import greenlet; print(greenlet, greenlet.__version__)"
Jason Madden's avatar
Jason Madden committed
242 243
  - if not "%GWHEEL_ONLY%"=="true" %PYEXE% -c "import gevent.core; print(gevent.core.loop)"
  - if not "%GWHEEL_ONLY%"=="true" %PYEXE% -c "import gevent; print(gevent.config.settings['resolver'].get_options())"
244
  - if not "%GWHEEL_ONLY%"=="true" %PYEXE% -c "from gevent._compat import get_clock_info; print(get_clock_info('perf_counter'))"
Jason Madden's avatar
Jason Madden committed
245
  - if not "%GWHEEL_ONLY%"=="true" %PYEXE% -mgevent.tests.known_failures
246
  - if not "%GWHEEL_ONLY%"=="true" %PYEXE% -mgevent.tests --second-chance --config known_failures.py
247 248

after_test:
249 250 251 252 253
  # pycparser can't be built correctly in an isolated environment.
  # See
  # https://ci.appveyor.com/project/denik/gevent/builds/23810605/job/83aw4u67artt002b#L602
  # So we violate DRY and repeate some requirements in order to use
  # --no-build-isolation
254
  - "%CMD_IN_ENV% %PYEXE% -m pip install wheel cython setuptools cffi twine"
255
  - "%CMD_IN_ENV% %PYEXE% -m pip wheel --no-build-isolation . -w dist"
256 257 258 259
  - ps: "ls dist"

artifacts:
  # Archive the generated wheel package in the ci.appveyor.com build report.
260
  - path: dist\gevent*whl
261

262 263

deploy_script:
264
  - ps: if ($env:APPVEYOR_REPO_TAG -eq $TRUE) { twine upload --skip-existing dist/gevent* }
265 266

deploy: on