forked from matplotlib/matplotlib
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.appveyor.yml
141 lines (120 loc) · 5.1 KB
/
.appveyor.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
# With infos from
# http://tjelvarolsson.com/blog/how-to-continuously-test-your-python-code-on-windows-using-appveyor/
# https://packaging.python.org/en/latest/appveyor/
# https://github.com/rmcgibbo/python-appveyor-conda-example
# Backslashes in quotes need to be escaped: \ -> "\\"
branches:
except:
- /auto-backport-.*/
environment:
global:
PYTHONIOENCODING: UTF-8
PYTEST_ARGS: -rawR --numprocesses=auto --timeout=300 --durations=25
--cov-report= --cov=lib -m "not network"
matrix:
# theoretically the CONDA_INSTALL_LOCN could be only two: one for 32bit,
# one for 64bit because we construct envs anyway. But using one for the
# right python version is hopefully making it fast due to package caching.
- PYTHON_VERSION: "2.7"
CONDA_INSTALL_LOCN: "C:\\Miniconda-x64"
TEST_ALL: "no"
- PYTHON_VERSION: "3.5"
CONDA_INSTALL_LOCN: "C:\\Miniconda35-x64"
TEST_ALL: "no"
- PYTHON_VERSION: "3.6"
CONDA_INSTALL_LOCN: "C:\\Miniconda36-x64"
TEST_ALL: "no"
# We always use a 64-bit machine, but can build x86 distributions
# with the PYTHON_ARCH variable
platform:
- x64
# all our python builds have to happen in tests_script...
build: false
cache:
- '%LOCALAPPDATA%\pip\Cache'
- '%USERPROFILE%\.cache\matplotlib'
init:
- echo %PYTHON_VERSION% %CONDA_INSTALL_LOCN%
install:
- set PATH=%CONDA_INSTALL_LOCN%;%CONDA_INSTALL_LOCN%\scripts;%PATH%;
- set PYTHONUNBUFFERED=1
# for msinttypes and newer stuff
- conda config --set always_yes true
- conda update --all
- conda config --set show_channel_urls yes
- conda config --prepend channels conda-forge
# this is now the downloaded conda...
- conda info -a
# For building, use a new environment which only includes the requirements for mpl
# same things as the requirements in ci/conda_recipe/meta.yaml
# if conda-forge gets a new pyqt, it might be nice to install it as well to have more backends
# https://github.com/conda-forge/conda-forge.github.io/issues/157#issuecomment-223536381
#
- conda create -q -n test-environment python=%PYTHON_VERSION%
msinttypes freetype=2.6 "libpng>=1.6.21,<1.7" zlib=1.2 tk=8.5
pip setuptools numpy mock pandas sphinx tornado
- activate test-environment
- echo %PYTHON_VERSION% %TARGET_ARCH%
# pytest-cov>=2.3.1 due to https://github.com/pytest-dev/pytest-cov/issues/124
- pip install -q "pytest!=3.3.0" "pytest-cov>=2.3.1" pytest-rerunfailures pytest-timeout pytest-xdist
# Apply patch to `subprocess` on Python versions > 2 and < 3.6.3
# https://github.com/matplotlib/matplotlib/issues/9176
- python -c "import sys; sys.exit(not (3,) < sys.version_info < (3,6,3))" && (
curl -sL https://github.com/python/cpython/pull/1224.patch |
patch -fsup 1 -d %CONDA_PREFIX% ) || cmd /c "exit /b 0"
# Let the install prefer the static builds of the libs
- set LIBRARY_LIB=%CONDA_PREFIX%\Library\lib
- mkdir lib || cmd /c "exit /b 0"
- copy /y %LIBRARY_LIB%\zlibstatic.lib lib\z.lib
- copy /y %LIBRARY_LIB%\libpng_static.lib lib\png.lib
# These z.lib / png.lib are not static versions but files which end up as
# dependencies to the dll file. This is fine for the conda build, but not here
# and for the wheels
- del %LIBRARY_LIB%\png.lib
- del %LIBRARY_LIB%\z.lib
- set MPLBASEDIRLIST=%CONDA_PREFIX%\Library\;.
# enables the local freetype build
- copy ci\travis\setup.cfg .
# Show the installed packages + versions
- conda list
test_script:
# Now build the thing..
- pip install -ve .
# these should show no z, png, or freetype dll...
- set "DUMPBIN=%VS140COMNTOOLS%\..\..\VC\bin\dumpbin.exe"
- '"%DUMPBIN%" /DEPENDENTS lib\matplotlib\ft2font*.pyd | findstr freetype.*.dll && exit /b 1 || exit /b 0'
- '"%DUMPBIN%" /DEPENDENTS lib\matplotlib\_png*.pyd | findstr z.*.dll && exit /b 1 || exit /b 0'
- '"%DUMPBIN%" /DEPENDENTS lib\matplotlib\_png*.pyd | findstr png.*.dll && exit /b 1 || exit /b 0'
# this are optional dependencies so that we don't skip so many tests...
- if x%TEST_ALL% == xyes conda install -q ffmpeg inkscape miktex pillow
# missing packages on conda-forge for avconv mencoder imagemagick
# This install sometimes failed randomly :-(
#- choco install imagemagick
# Test import of tkagg backend
- python -c "import matplotlib as m; m.use('tkagg'); import matplotlib.pyplot as plt; print(plt.get_backend())"
# tests
- echo The following args are passed to pytest %PYTEST_ARGS%
- python tests.py %PYTEST_ARGS%
after_test:
# After the tests were a success, build wheels with the static libs
# Hide the output, the copied files really clutter the build log...
- 'python setup.py bdist_wheel > NUL:'
- dir dist\
- echo finished...
artifacts:
- path: dist\*
name: packages
- path: result_images\*
name: result_images
type: zip
on_finish:
- pip install codecov
- codecov -e PYTHON_VERSION PLATFORM
on_failure:
# Generate a html for visual tests
- python tools/visualize_tests.py --no-browser
- echo zipping images after a failure...
- 7z a result_images.zip result_images\ | grep -v "Compressing"
- appveyor PushArtifact result_images.zip
matrix:
fast_finish: true