Skip to content

Commit 7454d6b

Browse files
committed
DOC changes in travis's build environment
1 parent a004409 commit 7454d6b

File tree

2 files changed

+51
-44
lines changed

2 files changed

+51
-44
lines changed

.travis.yml

Lines changed: 4 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -53,13 +53,13 @@ env:
5353
matrix:
5454
include:
5555
- python: 2.7
56-
env: MOCK=mock NUMPY=numpy==1.7.1
56+
env: MOCK=mock NUMPY=numpy==1.7.1 PANDAS=pandas
57+
- python: 2.7
58+
env: BUILD_DOCS=true
5759
- python: 3.4
5860
env: PYTHON_ARGS=-OO
5961
- python: 3.5
6062
env: BUILD_DOCS=true
61-
- python: 3.5
62-
env: USE_PYTEST=true PANDAS=pandas DELETE_FONT_CACHE=1
6363
- python: 3.6
6464
env: USE_PYTEST=true DELETE_FONT_CACHE=1 INSTALL_PEP8=pytest-pep8 RUN_PEP8=--pep8
6565
- python: "nightly"
@@ -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

ci/travis/test_script.sh

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
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 [[ $USE_PYTEST == false ]]; then
27+
if [[ $TRAVIS_OS_NAME == 'osx' ]]; then
28+
python tests.py $PYTEST_ARGS $RUN_PEP8
29+
else
30+
gdb -return-child-result -batch -ex r -ex bt --args python $PYTHON_ARGS tests.py $PYTEST_ARGS $RUN_PEP8
31+
fi
32+
else
33+
py.test $PYTEST_ARGS $RUN_PEP8
34+
fi
35+
else
36+
cd doc
37+
python make.py html -n 2
38+
# We don't build the LaTeX docs here, so linkchecker will complain
39+
touch build/html/Matplotlib.pdf
40+
# Linkchecker only works with python 2.7 for the time being
41+
deactivate
42+
source ~/virtualenv/python2.7/bin/activate
43+
pip install pip --upgrade
44+
# linkchecker is currently broken with requests 2.10.0 so force an earlier version
45+
pip install $PRE requests==2.9.2 linkchecker
46+
linkchecker build/html/index.html
47+
fi

0 commit comments

Comments
 (0)