|
| 1 | +# With infos from |
| 2 | +# http://tjelvarolsson.com/blog/how-to-continuously-test-your-python-code-on-windows-using-appveyor/ |
| 3 | +# https://packaging.python.org/en/latest/appveyor/ |
| 4 | +# https://github.com/rmcgibbo/python-appveyor-conda-example |
| 5 | + |
| 6 | +# Backslashes in quotes need to be escaped: \ -> "\\" |
| 7 | + |
| 8 | +environment: |
| 9 | + |
| 10 | + global: |
| 11 | + # SDK v7.0 MSVC Express 2008's SetEnv.cmd script will fail if the |
| 12 | + # /E:ON and /V:ON options are not enabled in the batch script intepreter |
| 13 | + # See: http://stackoverflow.com/a/13751649/163740 |
| 14 | + CMD_IN_ENV: "cmd /E:ON /V:ON /C .\\ci\\appveyor\\run_with_env.cmd" |
| 15 | + |
| 16 | + matrix: |
| 17 | + - PYTHON: "C:\\Python34_64" |
| 18 | + PYTHON_VERSION: "3.4" |
| 19 | + PYTHON_ARCH: "64" |
| 20 | + CONDA_PY: "34" |
| 21 | + CONDA_NPY: "18" |
| 22 | + |
| 23 | + - PYTHON: "C:\\Python27_64" |
| 24 | + PYTHON_VERSION: "2.7" |
| 25 | + PYTHON_ARCH: "64" |
| 26 | + CONDA_PY: "27" |
| 27 | + CONDA_NPY: "18" |
| 28 | + |
| 29 | + - PYTHON: "C:\\Python27_32" |
| 30 | + PYTHON_VERSION: "2.7" |
| 31 | + PYTHON_ARCH: "32" |
| 32 | + CONDA_PY: "27" |
| 33 | + CONDA_NPY: "18" |
| 34 | + |
| 35 | +# We always use a 64-bit machine, but can build x86 distributions |
| 36 | +# with the PYTHON_ARCH variable (which is used by CMD_IN_ENV). |
| 37 | +platform: |
| 38 | + - x64 |
| 39 | + |
| 40 | +# all our python builds have to happen in tests_script... |
| 41 | +build: false |
| 42 | + |
| 43 | +init: |
| 44 | + - "ECHO %PYTHON_VERSION% %PYTHON%" |
| 45 | + |
| 46 | +install: |
| 47 | + - powershell .\ci\appveyor\install.ps1 |
| 48 | + - SET PATH=%PYTHON%;%PYTHON%\Scripts;%PATH% |
| 49 | + - cmd: conda config --set show_channel_urls yes |
| 50 | + # for msinttypes |
| 51 | + - cmd: conda config --add channels conda-forge |
| 52 | + # this is now the downloaded conda... |
| 53 | + - conda info -a |
| 54 | + # same things as in tools/conda_recipe |
| 55 | + - cmd: conda create -y -q -n test-environment python=%PYTHON_VERSION% pip setuptools numpy python-dateutil freetype=2.5 msinttypes pyparsing pytz tornado libpng zlib pyqt cycler nose mock |
| 56 | + - activate test-environment |
| 57 | + # This is needed for the installer to find the dlls... |
| 58 | + - set LIBRARY_LIB=%CONDA_DEFAULT_ENV%\Library\lib |
| 59 | + - dir %LIBRARY_LIB% |
| 60 | + - cmd: 'mkdir lib || cmd /c "exit /b 0"' |
| 61 | + - copy %LIBRARY_LIB%\zlibstatic.lib lib\z.lib |
| 62 | + - copy %LIBRARY_LIB%\libpng_static.lib lib\png.lib |
| 63 | + - set LIB=%LIBRARY_LIB%;.\lib |
| 64 | + - set LIBPATH=%LIBRARY_LIB%;.\lib |
| 65 | + - set LIB_INC=%CONDA_DEFAULT_ENV%\Library\include |
| 66 | + - set INCLUDE=%LIB_INC%;%LIB_INC%\freetype2;WhateverInclude |
| 67 | + - set CPLUS_INCLUDE_PATH=%LIB_INC%\freetype2;%LIB_INC%;WhateverCPLUS |
| 68 | + - dir %LIB_INC% |
| 69 | + - dir %LIB_INC%\freetype2 |
| 70 | + # Show the installed packages + versions |
| 71 | + - conda list |
| 72 | + |
| 73 | +test_script: |
| 74 | + # Now build the thing.. |
| 75 | + - '%CMD_IN_ENV% python setup.py develop' |
| 76 | + # tests |
| 77 | + # for now, just let them pass to get the after_test parts... |
| 78 | + - python tests.py || cmd /c "exit /b 0" |
| 79 | + |
| 80 | +after_test: |
| 81 | + # After the tests were a success, build packages (wheels and conda) |
| 82 | + |
| 83 | + # There is a bug in wheels which prevents building wheels when the package uses namespaces |
| 84 | + - cmd: '%CMD_IN_ENV% python setup.py bdist_wheel' |
| 85 | + # Note also that our setup.py script, which is called by conda-build, writes |
| 86 | + # a __conda_version__.txt file, so the version number on the binary package |
| 87 | + # is set dynamically. This unfortunately mean that conda build --output |
| 88 | + # doesn't really work. |
| 89 | + - cmd: '%CMD_IN_ENV% conda config --get channels' |
| 90 | + # These vars get included in the conda env, so cleanup out current conda env |
| 91 | + - set LIB= |
| 92 | + - set LIBPATH= |
| 93 | + - set INCLUDE= |
| 94 | + - set LIB_INC= |
| 95 | + - set |
| 96 | + # we can't build conda packages on 27 due to missing functools32, which is a recent |
| 97 | + # additional dependency for matplotlib |
| 98 | + - cmd: if [%CONDA_PY%] NEQ [27] %CMD_IN_ENV% conda build .\ci\conda_recipe |
| 99 | + # Move the conda package into the dist directory, to register it |
| 100 | + # as an "artifact" for Appveyor. |
| 101 | + - cmd: 'copy /Y %PYTHON%\conda-bld\win-32\*.bz2 dist || cmd /c "exit /b 0"' |
| 102 | + - cmd: 'copy /Y %PYTHON%\conda-bld\win-64\*.bz2 dist || cmd /c "exit /b 0"' |
| 103 | + - cmd: dir .\dist\ |
| 104 | + |
| 105 | +artifacts: |
| 106 | + - path: dist\* |
| 107 | + name: packages |
0 commit comments