forked from matplotlib/matplotlib
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
227 lines (215 loc) · 8.67 KB
/
.travis.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
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
language: python
sudo: false
cache:
pip: true
directories:
- $HOME/.ccache # https://github.com/travis-ci/travis-ci/issues/5853
- $HOME/.cache/matplotlib
addons:
apt:
packages:
- inkscape
- libav-tools
- gdb
- mencoder
- dvipng
- pgf
- lmodern
- cm-super
- texlive-latex-base
- texlive-latex-extra
- texlive-fonts-recommended
- texlive-latex-recommended
- texlive-xetex
- graphviz
- libgeos-dev
- otf-freefont
# - fonts-humor-sans
# sources:
# - debian-sid
env:
global:
- ARTIFACTS_AWS_REGION=us-east-1
- ARTIFACTS_S3_BUCKET=matplotlib-test-results
- secure: RgJI7BBL8aX5FTOQe7xiXqWHMxWokd6GNUWp1NUV2mRLXPb9dI0RXqZt3UJwKTAzf1z/OtlHDmEkBoTVK81E9iUxK5npwyyjhJ8yTJmwfQtQF2n51Q1Ww9p+XSLORrOzZc7kAo6Kw6FIXN1pfctgYq2bQkrwJPRx/oPR8f6hcbY=
- secure: E7OCdqhZ+PlwJcn+Hd6ns9TDJgEUXiUNEI0wu7xjxB2vBRRIKtZMbuaZjd+iKDqCKuVOJKu0ClBUYxmgmpLicTwi34CfTUYt6D4uhrU+8hBBOn1iiK51cl/aBvlUUrqaRLVhukNEBGZcyqAjXSA/Qsnp2iELEmAfOUa92ZYo1sk=
- secure: "dfjNqGKzQG5bu3FnDNwLG8H/C4QoieFo4PfFmZPdM2RY7WIzukwKFNT6kiDfOrpwt+2bR7FhzjOGlDECGtlGOtYPN8XuXGjhcP4a4IfakdbDfF+D3NPIpf5VlE6776k0VpvcZBTMYJKNFIMc7QPkOwjvNJ2aXyfe3hBuGlKJzQU="
- BUILD_DOCS=false
- NUMPY=numpy
- OPENBLAS_NUM_THREADS=1
- PANDAS=
- NPROC=2
- TEST_ARGS=--no-pep8
- NOSE_ARGS="--processes=$NPROC --process-timeout=300"
- PYTEST_ARGS="-ra --timeout=300 --durations=25 --cov-report= --cov=lib" # -n $NPROC
- PYTHON_ARGS=
- DELETE_FONT_CACHE=
- USE_PYTEST=false
#- PYTHONHASHSEED=0 # Workaround for pytest-xdist flaky colletion order
# # https://github.com/pytest-dev/pytest/issues/920
# # https://github.com/pytest-dev/pytest/issues/1075
matrix:
include:
- python: 2.7
env: MOCK=mock NUMPY=numpy==1.6
- python: 3.4
env: PYTHON_ARGS=-OO
- python: 3.5
env: PANDAS=pandas NOSE_ARGS=--with-coverage DELETE_FONT_CACHE=1
- python: 3.5
env: TEST_ARGS=--pep8
- python: 3.5
env: BUILD_DOCS=true
- python: 3.5
env: USE_PYTEST=true PANDAS=pandas DELETE_FONT_CACHE=1 TEST_ARGS=
- python: "nightly"
env: PRE=--pre
- os: osx
osx_image: xcode7.3
language: generic # https://github.com/travis-ci/travis-ci/issues/2312
env: MOCK=mock NOSE_ARGS=
cache:
# As for now travis caches only "$HOME/.cache/pip"
# https://docs.travis-ci.com/user/caching/#pip-cache
pip: false
directories:
- $HOME/Library/Caches/pip
# `cache` does not support `env`-like `global` so copy-paste from top
- $HOME/.ccache # https://github.com/travis-ci/travis-ci/issues/5853
- $HOME/.cache/matplotlib
allow_failures:
- python: "nightly"
before_install:
- |
# Install into our own pristine virtualenv
if [[ $TRAVIS_OS_NAME != 'osx' ]]; then
virtualenv --python=python venv
source venv/bin/activate
export PATH=/usr/lib/ccache:$PATH
else
brew update
brew tap homebrew/gui
brew install python libpng ffmpeg imagemagick mplayer ccache
# We could install ghostscript and inkscape here to test svg and pdf
# but this makes the test time really long.
# brew install ghostscript inkscape
export PATH=/usr/local/opt/ccache/libexec:$PATH
fi
install:
- |
# Setup environment
ccache -s
# Upgrade pip and setuptools and wheel to get as clean an install as possible
pip install --upgrade pip
pip install --upgrade wheel
pip install --upgrade setuptools
- |
# Install dependencies from pypi
pip install $PRE python-dateutil $NUMPY pyparsing!=2.1.6 $PANDAS pep8 cycler coveralls coverage
pip install $PRE -r doc-requirements.txt
# Install nose from a build which has partial
# support for python36 and suport for coverage output suppressing
pip install git+https://github.com/jenshnielsen/nose.git@matplotlibnose
# pytest-cov>=2.3.1 due to https://github.com/pytest-dev/pytest-cov/issues/124
pip install $PRE pytest 'pytest-cov>=2.3.1' pytest-timeout pytest-xdist pytest-faulthandler
# We manually install humor sans using the package from Ubuntu 14.10. Unfortunatly humor sans is not
# availible in the Ubuntu version used by Travis but we can manually install the deb from a later
# version since is it basically just a .ttf file
# The current Travis Ubuntu image is to old to search .local/share/fonts so we store fonts in .fonts
if [[ $BUILD_DOCS == true ]]; then
wget https://github.com/google/fonts/blob/master/ofl/felipa/Felipa-Regular.ttf?raw=true -O Felipa-Regular.ttf
wget http://mirrors.kernel.org/ubuntu/pool/universe/f/fonts-humor-sans/fonts-humor-sans_1.0-1_all.deb
mkdir -p tmp
mkdir -p ~/.fonts
dpkg -x fonts-humor-sans_1.0-1_all.deb tmp
cp tmp/usr/share/fonts/truetype/humor-sans/Humor-Sans.ttf ~/.fonts
cp Felipa-Regular.ttf ~/.fonts
fc-cache -f -v
else
# Use the special local version of freetype for testing
cp ci/travis/setup.cfg .
fi;
- |
# Install matplotlib
pip install -e .
- |
script:
# The number of processes is hardcoded, because using too many causes the
# Travis VM to run out of memory (since so many copies of inkscape and
# ghostscript are running at the same time).
- |
echo Testing import of tkagg backend
MPLBACKEND="tkagg" python -c 'import matplotlib.pyplot as plt; print(plt.get_backend())'
if [[ $BUILD_DOCS == false ]]; then
if [[ $DELETE_FONT_CACHE == 1 ]]; then
rm -rf ~/.cache/matplotlib
fi
export MPL_REPO_DIR=$PWD # needed for pep8-conformance test of the examples
if [[ $USE_PYTEST == false ]]; then
echo The following args are passed to nose $NOSE_ARGS
if [[ $TRAVIS_OS_NAME == 'osx' ]]; then
python tests.py $NOSE_ARGS $TEST_ARGS
else
gdb -return-child-result -batch -ex r -ex bt --args python $PYTHON_ARGS tests.py $NOSE_ARGS $TEST_ARGS
fi
else
echo The following args are passed to pytest $PYTEST_ARGS
py.test $PYTEST_ARGS $TEST_ARGS
fi
else
cd doc
python make.py html -n 2
# We don't build the LaTeX docs here, so linkchecker will complain
touch build/html/Matplotlib.pdf
# Linkchecker only works with python 2.7 for the time being
deactivate
source ~/virtualenv/python2.7/bin/activate
pip install pip --upgrade
# linkchecker is currently broken with requests 2.10.0 so force an earlier version
pip install $PRE requests==2.9.2 linkchecker
linkchecker build/html/index.html
fi
# Currently disabled because of differece in behaviour
# between `pytest-cov` and `nose-coverage`
#- if [[ $USE_PYTEST == true ]]; then coveralls; fi
- rm -rf $HOME/.cache/matplotlib/tex.cache
- rm -rf $HOME/.cache/matplotlib/test_cache
after_failure:
- |
if [[ $BUILD_DOCS == false && $TRAVIS_PULL_REQUEST == false && $TRAVIS_REPO_SLUG == 'matplotlib/matplotlib' ]]; then
gem install travis-artifacts
cd $TRAVIS_BUILD_DIR/../tmp_test_dir
tar cjf result_images.tar.bz2 result_images
travis-artifacts upload --path result_images.tar.bz2
echo https://s3.amazonaws.com/matplotlib-test-results/artifacts/${TRAVIS_BUILD_NUMBER}/${TRAVIS_JOB_NUMBER}/result_images.tar.bz2
else
echo "The result images will only be uploaded if they are on the matplotlib/matplotlib repo - this is for security reasons to prevent arbitrary PRs echoing security details."
fi
after_success:
- |
if [[ $TRAVIS_PULL_REQUEST == false && $TRAVIS_REPO_SLUG == 'matplotlib/matplotlib' && $BUILD_DOCS == true && $TRAVIS_BRANCH == 'master' ]]; then
cd $TRAVIS_BUILD_DIR
echo "Uploading documentation"
openssl aes-256-cbc -K $encrypted_cc802e084cd0_key -iv $encrypted_cc802e084cd0_iv -in ci/travis/matplotlibDeployKey.enc -out ci/travis/matplotlibDeployKey -d
eval `ssh-agent -s`
chmod 600 ci/travis/matplotlibDeployKey
ssh-add ci/travis/matplotlibDeployKey
cd ..
git clone [email protected]:matplotlib/devdocs.git
cd devdocs
git checkout --orphan gh-pages
git reset --hard first_commit
cp -R ../matplotlib/doc/build/html/. .
touch .nojekyll
git config --global user.email "MatplotlibTravisBot@nomail"
git config --global user.name "MatplotlibTravisBot"
git config --global push.default simple
git add .
git commit -m "Docs build of $TRAVIS_COMMIT"
git push --set-upstream origin gh-pages --force
else
echo "Will only deploy docs build from matplotlib master branch"
fi
if [[ $NOSE_ARGS =~ "--with-coverage" ]]; then
coveralls
fi