diff --git a/.appveyor.yml b/.appveyor.yml index 981b6ed2c866..b6d1dea4fe45 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -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 diff --git a/.travis.yml b/.travis.yml index 0be20c9132d7..d3e226261358 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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: @@ -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 @@ -104,25 +113,22 @@ 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 + 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: - | @@ -141,8 +147,6 @@ install: $NOSE \ $NUMPY \ $PANDAS \ - codecov \ - coverage \ pillow \ $PYPARSING \ $SPHINX \ @@ -175,34 +179,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 diff --git a/ci/travis/silence b/ci/silence similarity index 100% rename from ci/travis/silence rename to ci/silence diff --git a/ci/travis/matplotlibDeployKey.enc b/ci/travis/matplotlibDeployKey.enc deleted file mode 100644 index f73fb807cdf5..000000000000 Binary files a/ci/travis/matplotlibDeployKey.enc and /dev/null differ diff --git a/ci/travis/setup.cfg b/ci/travis/setup.cfg deleted file mode 100644 index 61cdc102a0f8..000000000000 --- a/ci/travis/setup.cfg +++ /dev/null @@ -1,2 +0,0 @@ -[test] -local_freetype=True \ No newline at end of file diff --git a/ci/travis/test_script.sh b/ci/travis/test_script.sh deleted file mode 100755 index f6446d21f16d..000000000000 --- a/ci/travis/test_script.sh +++ /dev/null @@ -1,20 +0,0 @@ -#! /bin/bash - -set -ex - -# This script is meant to be called by the "script" step defined in -# .travis.yml. See http://docs.travis-ci.com/ for more details. -# The behavior of the script is controlled by environment variabled defined -# in the .travis.yml in the top level folder of the project. - -# 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). - -if [[ $DELETE_FONT_CACHE == 1 ]]; then - rm -rf ~/.cache/matplotlib -fi - -echo The following args are passed to pytest $PYTEST_ARGS $RUN_PEP8 - -python -mpytest $PYTEST_ARGS $RUN_PEP8