From 0a47d9865facf39eb5f223d0a42f71a9ba9725d2 Mon Sep 17 00:00:00 2001 From: Antony Lee Date: Sun, 15 Apr 2018 21:24:04 -0700 Subject: [PATCH 1/2] 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. --- .appveyor.yml | 2 +- .travis.yml | 102 ++++++++++++++++-------------- ci/{travis => }/silence | 0 ci/travis/matplotlibDeployKey.enc | Bin 1680 -> 0 bytes ci/travis/setup.cfg | 2 - ci/travis/test_script.sh | 20 ------ 6 files changed, 55 insertions(+), 71 deletions(-) rename ci/{travis => }/silence (100%) delete mode 100644 ci/travis/matplotlibDeployKey.enc delete mode 100644 ci/travis/setup.cfg delete mode 100755 ci/travis/test_script.sh 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..ab0e460dafaf 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,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: - | @@ -141,8 +149,6 @@ install: $NOSE \ $NUMPY \ $PANDAS \ - codecov \ - coverage \ pillow \ $PYPARSING \ $SPHINX \ @@ -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 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 f73fb807cdf50882914287a7e62f381685f95c46..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1680 zcmV;B25S^r~XL14P=+)X_#ov%v*MKf}b&heVaJ9y7>IE ztB*@|GBzQ-v}D=sOKz9QgwionqP!qXl|PSmpK4?_$ab+~E5TDE$J7p-q_9uXgJmuo z;EjOdgY9);8Aw(|UK(`F7r0Fc%({&V4I7iKl7;xK@@$g8AgB8C**MQHV+4T_B4bMWogpE$Mk>=)1hxP$iMk5NhU zf#n6cHvzAe*X7a2jB!!9&4X~PKD)L=fPx) zwYQk5V^{Ep=WWHPUe36YgdgC5tVlwFrcL^FY0V-I$*^30TW+tP2(Lf=$e1Fvnq0}A zu;5>~9qG)nacBA|>qwA(OHh5~$X#1*vMr(PQ1${RsTuHm<8g1|<^!WA2k}H^RU$WE zkjE8d?Pe-s`?N-nwsFuzm}qk@*QxOf@Zfwfh5>10XYA3Uv>G5?1d9)*>kRteQq}E6<;uSip|lh~W%Z|iqA-dq zSvz%;z7xOou&kKbl4&~p4MDFQLAsTt}pftTp6 zYx;TYvr6#$iTH@yWiq!mdc;q*xpsm(LmimzT}!39o-@(+nMuy!R4CC`eRT?GuRFs= zsqt4g8%a`ibG48SFyWu^bMxIycQ|)j6v9RwiSciZS8UYcTlwF>+1sALi`Dtolj^js z1hd2`!re>riC*onWyG?i!;tpTA5qNqhEgL`a{j;fHr#5LM5EB$>R3e{^KmCLf}9)%w=R zAyumXq2Fs+()aawnq*45LPpUs1!RYzRFfGI=9Yzus7unph0cu=q-BRdRK%+HMAsZ* zD~lxer@`rWX8~8QgU*Z=q_FM>!uqIQ+|Xs}bAGfApcM ze3%G@p~el~4<|o+*5{re)ktQ9AOb(IBdQa4uJ|L{i#mX;jV^xz`o}L*lmn_k0c0(8 z`?tFobUtUBv)!(GY4aj09Omy9Nw~b0hLWZdvT+ekReeN& zMG|w-Q!e~!W+>oTb5A*s^5a8CsYhb07)_6r4X6n?*I*6^3fxazGw66^mQgkM)$O@5 an0HjmwjRaoJe=GUVinIQM3;E;-ttBmvraq! 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 From 4b19b8982c4db3aed4f4726ff6e93c4d21726d3c Mon Sep 17 00:00:00 2001 From: Antony Lee Date: Wed, 9 May 2018 23:59:17 -0700 Subject: [PATCH 2/2] Remove unicode-path test only relevant on Py2. --- .travis.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index ab0e460dafaf..d3e226261358 100644 --- a/.travis.yml +++ b/.travis.yml @@ -115,8 +115,6 @@ matrix: 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