Skip to content

Commit a4cee9d

Browse files
authored
Merge pull request #8239 from NelleV/travis_refactor
CI: changes in travis and appveyor build environments
2 parents a82c6a8 + 43c081d commit a4cee9d

File tree

3 files changed

+51
-57
lines changed

3 files changed

+51
-57
lines changed

.travis.yml

+6-46
Original file line numberDiff line numberDiff line change
@@ -48,26 +48,26 @@ env:
4848
- PYTEST_ARGS="-ra --maxfail=1 --timeout=300 --durations=25 --cov-report= --cov=lib -n $NPROC"
4949
- PYTHON_ARGS=
5050
- DELETE_FONT_CACHE=
51-
- USE_PYTEST=false
5251

5352
matrix:
5453
include:
5554
- python: 2.7
56-
env: MOCK=mock NUMPY=numpy==1.7.1
55+
env: MOCK=mock NUMPY=numpy==1.7.1 PANDAS=pandas
56+
- python: 2.7
57+
env: BUILD_DOCS=true
5758
- python: 3.4
5859
env: PYTHON_ARGS=-OO
5960
- python: 3.5
6061
env: BUILD_DOCS=true
61-
- python: 3.5
62-
env: USE_PYTEST=true PANDAS=pandas DELETE_FONT_CACHE=1
6362
- python: 3.6
64-
env: USE_PYTEST=true DELETE_FONT_CACHE=1 INSTALL_PEP8=pytest-pep8 RUN_PEP8=--pep8
63+
env: DELETE_FONT_CACHE=1 INSTALL_PEP8=pytest-pep8 RUN_PEP8=--pep8
6564
- python: "nightly"
6665
env: PRE=--pre
6766
- os: osx
6867
osx_image: xcode7.3
6968
language: generic # https://github.com/travis-ci/travis-ci/issues/2312
7069
env: MOCK=mock
70+
only: master
7171
cache:
7272
# As for now travis caches only "$HOME/.cache/pip"
7373
# https://docs.travis-ci.com/user/caching/#pip-cache
@@ -138,47 +138,7 @@ install:
138138
# Install matplotlib
139139
pip install -ve .
140140
141-
script:
142-
# The number of processes is hardcoded, because using too many causes the
143-
# Travis VM to run out of memory (since so many copies of inkscape and
144-
# ghostscript are running at the same time).
145-
- |
146-
echo Testing import of tkagg backend
147-
MPLBACKEND="tkagg" python -c 'import matplotlib.pyplot as plt; print(plt.get_backend())'
148-
if [[ $BUILD_DOCS == false ]]; then
149-
if [[ $DELETE_FONT_CACHE == 1 ]]; then
150-
rm -rf ~/.cache/matplotlib
151-
fi
152-
# Workaround for pytest-xdist flaky collection order
153-
# https://github.com/pytest-dev/pytest/issues/920
154-
# https://github.com/pytest-dev/pytest/issues/1075
155-
export PYTHONHASHSEED=$(python -c 'import random; print(random.randint(1, 4294967295))')
156-
echo PYTHONHASHSEED=$PYTHONHASHSEED
157-
158-
echo The following args are passed to pytest $PYTEST_ARGS $RUN_PEP8
159-
if [[ $USE_PYTEST == false ]]; then
160-
if [[ $TRAVIS_OS_NAME == 'osx' ]]; then
161-
python tests.py $PYTEST_ARGS $RUN_PEP8
162-
else
163-
gdb -return-child-result -batch -ex r -ex bt --args python $PYTHON_ARGS tests.py $PYTEST_ARGS $RUN_PEP8
164-
fi
165-
else
166-
py.test $PYTEST_ARGS $RUN_PEP8
167-
fi
168-
else
169-
cd doc
170-
python make.py html -n 2
171-
# We don't build the LaTeX docs here, so linkchecker will complain
172-
touch build/html/Matplotlib.pdf
173-
# Linkchecker only works with python 2.7 for the time being
174-
deactivate
175-
source ~/virtualenv/python2.7/bin/activate
176-
pip install pip --upgrade
177-
# linkchecker is currently broken with requests 2.10.0 so force an earlier version
178-
pip install $PRE requests==2.9.2 linkchecker
179-
linkchecker build/html/index.html
180-
fi
181-
141+
script: source ci/travis/test_script.sh
182142
before_cache:
183143
- rm -rf $HOME/.cache/matplotlib/tex.cache
184144
- rm -rf $HOME/.cache/matplotlib/test_cache

appveyor.yml

+2-11
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ environment:
1515
# Workaround for https://github.com/conda/conda-build/issues/636
1616
PYTHONIOENCODING: "UTF-8"
1717
PYTEST_ARGS: -ra --timeout=300 --durations=25 -n %NUMBER_OF_PROCESSORS% --cov-report= --cov=lib -m "not network"
18-
USE_PYTEST: no
1918
PYTHONHASHSEED: 0 # Workaround for pytest-xdist flaky collection order
2019
# https://github.com/pytest-dev/pytest/issues/920
2120
# https://github.com/pytest-dev/pytest/issues/1075
@@ -37,13 +36,6 @@ environment:
3736
PYTHON_VERSION: "3.5"
3837
TEST_ALL: "no"
3938
CONDA_INSTALL_LOCN: "C:\\Miniconda35-x64"
40-
- TARGET_ARCH: "x64"
41-
CONDA_PY: "35"
42-
CONDA_NPY: "110"
43-
PYTHON_VERSION: "3.5"
44-
TEST_ALL: "no"
45-
CONDA_INSTALL_LOCN: "C:\\Miniconda35-x64"
46-
USE_PYTEST: yes
4739
- TARGET_ARCH: "x86"
4840
CONDA_PY: "27"
4941
CONDA_NPY: "18"
@@ -68,7 +60,7 @@ cache:
6860
- '%USERPROFILE%\.cache\matplotlib'
6961

7062
init:
71-
- cmd: "ECHO %PYTHON_VERSION% PYTEST=%USE_PYTEST% %CONDA_INSTALL_LOCN%"
63+
- cmd: "ECHO %PYTHON_VERSION% %CONDA_INSTALL_LOCN%"
7264

7365
install:
7466
- cmd: set PATH=%CONDA_INSTALL_LOCN%;%CONDA_INSTALL_LOCN%\scripts;%PATH%;
@@ -140,8 +132,7 @@ test_script:
140132
- python -c "import matplotlib as m; m.use('tkagg'); import matplotlib.pyplot as plt; print(plt.get_backend())"
141133
# tests
142134
- echo The following args are passed to pytest %PYTEST_ARGS%
143-
- if x%USE_PYTEST% == xyes py.test %PYTEST_ARGS%
144-
- if x%USE_PYTEST% == xno python tests.py %PYTEST_ARGS%
135+
- python tests.py %PYTEST_ARGS%
145136
# Generate a html for visual tests
146137
- python visual_tests.py
147138
- pip install codecov

ci/travis/test_script.sh

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
#! /bin/bash
2+
3+
# This script is meant to be called by the "script" step defined in
4+
# .travis.yml. See http://docs.travis-ci.com/ for more details.
5+
# The behavior of the script is controlled by environment variabled defined
6+
# in the .travis.yml in the top level folder of the project.
7+
8+
# The number of processes is hardcoded, because using too many causes the
9+
# Travis VM to run out of memory (since so many copies of inkscape and
10+
# ghostscript are running at the same time).
11+
12+
echo Testing import of tkagg backend
13+
MPLBACKEND="tkagg" python -c 'import matplotlib.pyplot as plt; print(plt.get_backend())'
14+
15+
if [[ $BUILD_DOCS == false ]]; then
16+
if [[ $DELETE_FONT_CACHE == 1 ]]; then
17+
rm -rf ~/.cache/matplotlib
18+
fi
19+
# Workaround for pytest-xdist flaky collection order
20+
# https://github.com/pytest-dev/pytest/issues/920
21+
# https://github.com/pytest-dev/pytest/issues/1075
22+
export PYTHONHASHSEED=$(python -c 'import random; print(random.randint(1, 4294967295))')
23+
echo PYTHONHASHSEED=$PYTHONHASHSEED
24+
25+
echo The following args are passed to pytest $PYTEST_ARGS $RUN_PEP8
26+
if [[ $TRAVIS_OS_NAME == 'osx' ]]; then
27+
python tests.py $PYTEST_ARGS $RUN_PEP8
28+
else
29+
gdb -return-child-result -batch -ex r -ex bt --args python $PYTHON_ARGS tests.py $PYTEST_ARGS $RUN_PEP8
30+
fi
31+
else
32+
cd doc
33+
python make.py html -n 2
34+
# We don't build the LaTeX docs here, so linkchecker will complain
35+
touch build/html/Matplotlib.pdf
36+
# Linkchecker only works with python 2.7 for the time being
37+
deactivate
38+
source ~/virtualenv/python2.7/bin/activate
39+
pip install pip --upgrade
40+
# linkchecker is currently broken with requests 2.10.0 so force an earlier version
41+
pip install $PRE requests==2.9.2 linkchecker
42+
linkchecker build/html/index.html
43+
fi

0 commit comments

Comments
 (0)