Skip to content

Commit e539496

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 e539496

File tree

5 files changed

+54
-68
lines changed

5 files changed

+54
-68
lines changed

.travis.yml

+54-46
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
- |
@@ -175,34 +183,34 @@ install:
175183
pytest-rerunfailures \
176184
pytest-timeout \
177185
pytest-xdist
178-
179-
# Use the special local version of freetype for testing
180-
cp ci/travis/setup.cfg .
181186
- |
182187
# Install matplotlib
183188
python -mpip install -ve .
184189
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
190+
before_script: |
191+
if [[ $TRAVIS_OS_NAME != 'osx' ]]; then
192+
export DISPLAY=:99.0
193+
sh -e /etc/init.d/xvfb start
194+
fi
195+
if [[ $DELETE_FONT_CACHE == 1 ]]; then
196+
rm -rf ~/.cache/matplotlib
197+
fi
191198
192-
script: ci/travis/test_script.sh
199+
script: |
200+
echo "Calling pytest with the following arguments: $PYTEST_ADDOPTS"
201+
python -mpytest
193202
194-
before_cache:
195-
- rm -rf $HOME/.cache/matplotlib/tex.cache
196-
- rm -rf $HOME/.cache/matplotlib/test_cache
203+
before_cache: |
204+
rm -rf $HOME/.cache/matplotlib/tex.cache
205+
rm -rf $HOME/.cache/matplotlib/test_cache
197206
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
207+
after_failure: |
208+
if [[ $TRAVIS_PULL_REQUEST == false && $TRAVIS_REPO_SLUG == 'matplotlib/matplotlib' ]]; then
209+
tar cjf result_images.tar.bz2 result_images
210+
echo 'See "Uploading Artifacts" near the end of the log for the download URL'
211+
else
212+
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."
213+
fi
206214
207-
after_success:
208-
- codecov -e TRAVIS_PYTHON_VERSION
215+
after_success: |
216+
codecov -e TRAVIS_PYTHON_VERSION
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)