Skip to content

Commit 0a47d98

Browse files
committed
Simplify travis setup a bit.
- Splitting test_script.sh into its own file is a bit overkill (but then we can't use `set -x` as that applies to the whole script, using a subshell is a bit overkill). - pytest directly reads arguments from $PYTEST_ADDOPTS, use that. - We were setting $PYTHON_ARGS but not actually using it (that failed the legend docstring test), instead put a comment saying to set $PYTHONOPTIMIZE (which exists for that purpose). - ci/travis/setup.cfg can just as well be replaced by setting $MPLLOCALFREETYPE. - Yaml entries that are a single string don't need to get an extra indent. - matplotlibDeployKey.enc is unused since we switched to using circleci for doc builds. - ci/travis/silence was the only one left in its directory, so we may as well move it up once directory.
1 parent c98be63 commit 0a47d98

6 files changed

+55
-71
lines changed

.appveyor.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ install:
8383
- del %LIBRARY_LIB%\z.lib
8484
- set MPLBASEDIRLIST=%CONDA_PREFIX%\Library\;.
8585
# enables the local freetype build
86-
- copy ci\travis\setup.cfg .
86+
- set MPLLOCALFREETYPE=1
8787
# Show the installed packages + versions
8888
- conda list
8989

.travis.yml

+54-48
Original file line numberDiff line numberDiff line change
@@ -59,14 +59,18 @@ env:
5959
- PYTEST_COV=pytest-cov
6060
- PYTEST_PEP8=
6161
- SPHINX=sphinx
62+
# Variables controlling the build.
63+
- MPLLOCALFREETYPE=1
6264
# Variables controlling the test run.
6365
- DELETE_FONT_CACHE=
6466
- NO_AT_BRIDGE=1 # Necessary for GTK3 interactive test.
67+
# The number of processes is hardcoded, because using too many causes the
68+
# Travis VM to run out of memory (since so many copies of inkscape and
69+
# ghostscript are running at the same time).
6570
- NPROC=2
6671
- OPENBLAS_NUM_THREADS=1
6772
- PYTHONFAULTHANDLER=1
68-
- PYTEST_ARGS="-rawR --maxfail=50 --timeout=300 --durations=25 --cov-report= --cov=lib -n $NPROC"
69-
- PYTHON_ARGS=
73+
- PYTEST_ADDOPTS="-rawR --maxfail=50 --timeout=300 --durations=25 --cov-report= --cov=lib -n $NPROC"
7074
- RUN_PEP8=
7175

7276
matrix:
@@ -84,9 +88,14 @@ matrix:
8488
- PYTEST_COV=pytest-cov==2.3.1
8589
- SPHINX=sphinx==1.3
8690
- python: 3.5
87-
env: PYTHON_ARGS=-OO
91+
env:
92+
# - PYTHONOPTIMIZE=2 # This currently doesn't work.
8893
- python: 3.6
89-
env: DELETE_FONT_CACHE=1 PANDAS='pandas<0.21.0' PYTEST_PEP8=pytest-pep8 RUN_PEP8=--pep8
94+
env:
95+
- DELETE_FONT_CACHE=1
96+
- PANDAS='pandas<0.21.0'
97+
- PYTEST_PEP8=pytest-pep8
98+
- PYTEST_ADDOPTS="$PYTEST_ADDOPTS --pep8"
9099
- python: "nightly"
91100
env: PRE=--pre
92101
- os: osx
@@ -104,25 +113,24 @@ matrix:
104113
allow_failures:
105114
- python: "nightly"
106115

107-
before_install:
108-
- |
109-
if [[ $TRAVIS_OS_NAME != 'osx' ]]; then
110-
# test with non-ascii in path
111-
mkdir /tmp/λ
112-
export PATH=$PATH:/tmp/λ
113-
export PATH=/usr/lib/ccache:$PATH
114-
else
115-
ci/travis/silence brew update
116-
brew upgrade python
117-
brew install ffmpeg imagemagick mplayer ccache
118-
hash -r
119-
which python
120-
python --version
121-
# We could install ghostscript and inkscape here to test svg and pdf
122-
# but this makes the test time really long.
123-
# brew install ghostscript inkscape
124-
export PATH=/usr/local/opt/python/libexec/bin:/usr/local/opt/ccache/libexec:$PATH
125-
fi
116+
before_install: |
117+
# test with non-ascii in path
118+
mkdir /tmp/λ
119+
export PATH=$PATH:/tmp/λ
120+
if [[ $TRAVIS_OS_NAME != 'osx' ]]; then
121+
export PATH=/usr/lib/ccache:$PATH
122+
else
123+
ci/silence brew update
124+
brew upgrade python
125+
brew install ffmpeg imagemagick mplayer ccache
126+
hash -r
127+
which python
128+
python --version
129+
# We could install ghostscript and inkscape here to test svg and pdf
130+
# but this makes the test time really long.
131+
# brew install ghostscript inkscape
132+
export PATH=/usr/local/opt/python/libexec/bin:/usr/local/opt/ccache/libexec:$PATH
133+
fi
126134
127135
install:
128136
- |
@@ -141,8 +149,6 @@ install:
141149
$NOSE \
142150
$NUMPY \
143151
$PANDAS \
144-
codecov \
145-
coverage \
146152
pillow \
147153
$PYPARSING \
148154
$SPHINX \
@@ -175,34 +181,34 @@ install:
175181
pytest-rerunfailures \
176182
pytest-timeout \
177183
pytest-xdist
178-
179-
# Use the special local version of freetype for testing
180-
cp ci/travis/setup.cfg .
181184
- |
182185
# Install matplotlib
183186
python -mpip install -ve .
184187
185-
before_script:
186-
- |
187-
if [[ $TRAVIS_OS_NAME != 'osx' ]]; then
188-
export DISPLAY=:99.0
189-
sh -e /etc/init.d/xvfb start
190-
fi
188+
before_script: |
189+
if [[ $TRAVIS_OS_NAME != 'osx' ]]; then
190+
export DISPLAY=:99.0
191+
sh -e /etc/init.d/xvfb start
192+
fi
193+
if [[ $DELETE_FONT_CACHE == 1 ]]; then
194+
rm -rf ~/.cache/matplotlib
195+
fi
191196
192-
script: ci/travis/test_script.sh
197+
script: |
198+
echo "Calling pytest with the following arguments: $PYTEST_ADDOPTS"
199+
python -mpytest
193200
194-
before_cache:
195-
- rm -rf $HOME/.cache/matplotlib/tex.cache
196-
- rm -rf $HOME/.cache/matplotlib/test_cache
201+
before_cache: |
202+
rm -rf $HOME/.cache/matplotlib/tex.cache
203+
rm -rf $HOME/.cache/matplotlib/test_cache
197204
198-
after_failure:
199-
- |
200-
if [[ $TRAVIS_PULL_REQUEST == false && $TRAVIS_REPO_SLUG == 'matplotlib/matplotlib' ]]; then
201-
tar cjf result_images.tar.bz2 result_images
202-
echo 'See "Uploading Artifacts" near the end of the log for the download URL'
203-
else
204-
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."
205-
fi
205+
after_failure: |
206+
if [[ $TRAVIS_PULL_REQUEST == false && $TRAVIS_REPO_SLUG == 'matplotlib/matplotlib' ]]; then
207+
tar cjf result_images.tar.bz2 result_images
208+
echo 'See "Uploading Artifacts" near the end of the log for the download URL'
209+
else
210+
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."
211+
fi
206212
207-
after_success:
208-
- codecov -e TRAVIS_PYTHON_VERSION
213+
after_success: |
214+
codecov -e TRAVIS_PYTHON_VERSION

ci/travis/silence ci/silence

File renamed without changes.

ci/travis/matplotlibDeployKey.enc

-1.64 KB
Binary file not shown.

ci/travis/setup.cfg

-2
This file was deleted.

ci/travis/test_script.sh

-20
This file was deleted.

0 commit comments

Comments
 (0)