Skip to content

Commit

Permalink
Simplify travis setup a bit.
Browse files Browse the repository at this point in the history
- 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.
  • Loading branch information
anntzer committed May 7, 2018
1 parent c98be63 commit 0a47d98
Show file tree
Hide file tree
Showing 6 changed files with 55 additions and 71 deletions.
2 changes: 1 addition & 1 deletion .appveyor.yml
Expand Up @@ -83,7 +83,7 @@ install:
- del %LIBRARY_LIB%\z.lib
- set MPLBASEDIRLIST=%CONDA_PREFIX%\Library\;.
# enables the local freetype build
- copy ci\travis\setup.cfg .
- set MPLLOCALFREETYPE=1
# Show the installed packages + versions
- conda list

Expand Down
102 changes: 54 additions & 48 deletions .travis.yml
Expand Up @@ -59,14 +59,18 @@ env:
- PYTEST_COV=pytest-cov
- PYTEST_PEP8=
- SPHINX=sphinx
# Variables controlling the build.
- MPLLOCALFREETYPE=1
# Variables controlling the test run.
- DELETE_FONT_CACHE=
- NO_AT_BRIDGE=1 # Necessary for GTK3 interactive test.
# 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).
- NPROC=2
- OPENBLAS_NUM_THREADS=1
- PYTHONFAULTHANDLER=1
- PYTEST_ARGS="-rawR --maxfail=50 --timeout=300 --durations=25 --cov-report= --cov=lib -n $NPROC"
- PYTHON_ARGS=
- PYTEST_ADDOPTS="-rawR --maxfail=50 --timeout=300 --durations=25 --cov-report= --cov=lib -n $NPROC"
- RUN_PEP8=

matrix:
Expand All @@ -84,9 +88,14 @@ matrix:
- PYTEST_COV=pytest-cov==2.3.1
- SPHINX=sphinx==1.3
- python: 3.5
env: PYTHON_ARGS=-OO
env:
# - PYTHONOPTIMIZE=2 # This currently doesn't work.
- python: 3.6
env: DELETE_FONT_CACHE=1 PANDAS='pandas<0.21.0' PYTEST_PEP8=pytest-pep8 RUN_PEP8=--pep8
env:
- DELETE_FONT_CACHE=1
- PANDAS='pandas<0.21.0'
- PYTEST_PEP8=pytest-pep8
- PYTEST_ADDOPTS="$PYTEST_ADDOPTS --pep8"
- python: "nightly"
env: PRE=--pre
- os: osx
Expand All @@ -104,25 +113,24 @@ matrix:
allow_failures:
- python: "nightly"

before_install:
- |
if [[ $TRAVIS_OS_NAME != 'osx' ]]; then
# test with non-ascii in path
mkdir /tmp/λ
export PATH=$PATH:/tmp/λ
export PATH=/usr/lib/ccache:$PATH
else
ci/travis/silence brew update
brew upgrade python
brew install ffmpeg imagemagick mplayer ccache
hash -r
which python
python --version
# 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/python/libexec/bin:/usr/local/opt/ccache/libexec:$PATH
fi
before_install: |
# test with non-ascii in path
mkdir /tmp/λ
export PATH=$PATH:/tmp/λ
if [[ $TRAVIS_OS_NAME != 'osx' ]]; then
export PATH=/usr/lib/ccache:$PATH
else
ci/silence brew update
brew upgrade python
brew install ffmpeg imagemagick mplayer ccache
hash -r
which python
python --version
# 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/python/libexec/bin:/usr/local/opt/ccache/libexec:$PATH
fi
install:
- |
Expand All @@ -141,8 +149,6 @@ install:
$NOSE \
$NUMPY \
$PANDAS \
codecov \
coverage \
pillow \
$PYPARSING \
$SPHINX \
Expand Down Expand Up @@ -175,34 +181,34 @@ install:
pytest-rerunfailures \
pytest-timeout \
pytest-xdist
# Use the special local version of freetype for testing
cp ci/travis/setup.cfg .
- |
# Install matplotlib
python -mpip install -ve .
before_script:
- |
if [[ $TRAVIS_OS_NAME != 'osx' ]]; then
export DISPLAY=:99.0
sh -e /etc/init.d/xvfb start
fi
before_script: |
if [[ $TRAVIS_OS_NAME != 'osx' ]]; then
export DISPLAY=:99.0
sh -e /etc/init.d/xvfb start
fi
if [[ $DELETE_FONT_CACHE == 1 ]]; then
rm -rf ~/.cache/matplotlib
fi
script: ci/travis/test_script.sh
script: |
echo "Calling pytest with the following arguments: $PYTEST_ADDOPTS"
python -mpytest
before_cache:
- rm -rf $HOME/.cache/matplotlib/tex.cache
- rm -rf $HOME/.cache/matplotlib/test_cache
before_cache: |
rm -rf $HOME/.cache/matplotlib/tex.cache
rm -rf $HOME/.cache/matplotlib/test_cache
after_failure:
- |
if [[ $TRAVIS_PULL_REQUEST == false && $TRAVIS_REPO_SLUG == 'matplotlib/matplotlib' ]]; then
tar cjf result_images.tar.bz2 result_images
echo 'See "Uploading Artifacts" near the end of the log for the download URL'
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_failure: |
if [[ $TRAVIS_PULL_REQUEST == false && $TRAVIS_REPO_SLUG == 'matplotlib/matplotlib' ]]; then
tar cjf result_images.tar.bz2 result_images
echo 'See "Uploading Artifacts" near the end of the log for the download URL'
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:
- codecov -e TRAVIS_PYTHON_VERSION
after_success: |
codecov -e TRAVIS_PYTHON_VERSION
File renamed without changes.
Binary file removed ci/travis/matplotlibDeployKey.enc
Binary file not shown.
2 changes: 0 additions & 2 deletions ci/travis/setup.cfg

This file was deleted.

20 changes: 0 additions & 20 deletions ci/travis/test_script.sh

This file was deleted.

0 comments on commit 0a47d98

Please sign in to comment.