diff --git a/.travis.yml b/.travis.yml index 625d2f4c077d..67333fe3b2a4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -48,26 +48,26 @@ env: - PYTEST_ARGS="-ra --maxfail=1 --timeout=300 --durations=25 --cov-report= --cov=lib -n $NPROC" - PYTHON_ARGS= - DELETE_FONT_CACHE= - - USE_PYTEST=false matrix: include: - python: 2.7 - env: MOCK=mock NUMPY=numpy==1.7.1 + env: MOCK=mock NUMPY=numpy==1.7.1 PANDAS=pandas + - python: 2.7 + env: BUILD_DOCS=true - python: 3.4 env: PYTHON_ARGS=-OO - python: 3.5 env: BUILD_DOCS=true - - python: 3.5 - env: USE_PYTEST=true PANDAS=pandas DELETE_FONT_CACHE=1 - python: 3.6 - env: USE_PYTEST=true DELETE_FONT_CACHE=1 INSTALL_PEP8=pytest-pep8 RUN_PEP8=--pep8 + env: DELETE_FONT_CACHE=1 INSTALL_PEP8=pytest-pep8 RUN_PEP8=--pep8 - python: "nightly" env: PRE=--pre - os: osx osx_image: xcode7.3 language: generic # https://github.com/travis-ci/travis-ci/issues/2312 env: MOCK=mock + only: master cache: # As for now travis caches only "$HOME/.cache/pip" # https://docs.travis-ci.com/user/caching/#pip-cache @@ -138,47 +138,7 @@ install: # Install matplotlib pip install -ve . -script: - # 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). - - | - echo Testing import of tkagg backend - MPLBACKEND="tkagg" python -c 'import matplotlib.pyplot as plt; print(plt.get_backend())' - if [[ $BUILD_DOCS == false ]]; then - if [[ $DELETE_FONT_CACHE == 1 ]]; then - rm -rf ~/.cache/matplotlib - fi - # Workaround for pytest-xdist flaky collection order - # https://github.com/pytest-dev/pytest/issues/920 - # https://github.com/pytest-dev/pytest/issues/1075 - export PYTHONHASHSEED=$(python -c 'import random; print(random.randint(1, 4294967295))') - echo PYTHONHASHSEED=$PYTHONHASHSEED - - echo The following args are passed to pytest $PYTEST_ARGS $RUN_PEP8 - if [[ $USE_PYTEST == false ]]; then - if [[ $TRAVIS_OS_NAME == 'osx' ]]; then - python tests.py $PYTEST_ARGS $RUN_PEP8 - else - gdb -return-child-result -batch -ex r -ex bt --args python $PYTHON_ARGS tests.py $PYTEST_ARGS $RUN_PEP8 - fi - else - py.test $PYTEST_ARGS $RUN_PEP8 - fi - else - cd doc - python make.py html -n 2 - # We don't build the LaTeX docs here, so linkchecker will complain - touch build/html/Matplotlib.pdf - # Linkchecker only works with python 2.7 for the time being - deactivate - source ~/virtualenv/python2.7/bin/activate - pip install pip --upgrade - # linkchecker is currently broken with requests 2.10.0 so force an earlier version - pip install $PRE requests==2.9.2 linkchecker - linkchecker build/html/index.html - fi - +script: source ci/travis/test_script.sh before_cache: - rm -rf $HOME/.cache/matplotlib/tex.cache - rm -rf $HOME/.cache/matplotlib/test_cache diff --git a/appveyor.yml b/appveyor.yml index 653e7d5ebd00..84595bd4c56d 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -15,7 +15,6 @@ environment: # Workaround for https://github.com/conda/conda-build/issues/636 PYTHONIOENCODING: "UTF-8" PYTEST_ARGS: -ra --timeout=300 --durations=25 -n %NUMBER_OF_PROCESSORS% --cov-report= --cov=lib -m "not network" - USE_PYTEST: no PYTHONHASHSEED: 0 # Workaround for pytest-xdist flaky collection order # https://github.com/pytest-dev/pytest/issues/920 # https://github.com/pytest-dev/pytest/issues/1075 @@ -37,13 +36,6 @@ environment: PYTHON_VERSION: "3.5" TEST_ALL: "no" CONDA_INSTALL_LOCN: "C:\\Miniconda35-x64" - - TARGET_ARCH: "x64" - CONDA_PY: "35" - CONDA_NPY: "110" - PYTHON_VERSION: "3.5" - TEST_ALL: "no" - CONDA_INSTALL_LOCN: "C:\\Miniconda35-x64" - USE_PYTEST: yes - TARGET_ARCH: "x86" CONDA_PY: "27" CONDA_NPY: "18" @@ -68,7 +60,7 @@ cache: - '%USERPROFILE%\.cache\matplotlib' init: - - cmd: "ECHO %PYTHON_VERSION% PYTEST=%USE_PYTEST% %CONDA_INSTALL_LOCN%" + - cmd: "ECHO %PYTHON_VERSION% %CONDA_INSTALL_LOCN%" install: - cmd: set PATH=%CONDA_INSTALL_LOCN%;%CONDA_INSTALL_LOCN%\scripts;%PATH%; @@ -140,8 +132,7 @@ test_script: - python -c "import matplotlib as m; m.use('tkagg'); import matplotlib.pyplot as plt; print(plt.get_backend())" # tests - echo The following args are passed to pytest %PYTEST_ARGS% - - if x%USE_PYTEST% == xyes py.test %PYTEST_ARGS% - - if x%USE_PYTEST% == xno python tests.py %PYTEST_ARGS% + - python tests.py %PYTEST_ARGS% # Generate a html for visual tests - python visual_tests.py - pip install codecov diff --git a/ci/travis/test_script.sh b/ci/travis/test_script.sh new file mode 100644 index 000000000000..21ee11fee066 --- /dev/null +++ b/ci/travis/test_script.sh @@ -0,0 +1,43 @@ +#! /bin/bash + +# 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). + +echo Testing import of tkagg backend +MPLBACKEND="tkagg" python -c 'import matplotlib.pyplot as plt; print(plt.get_backend())' + +if [[ $BUILD_DOCS == false ]]; then + if [[ $DELETE_FONT_CACHE == 1 ]]; then + rm -rf ~/.cache/matplotlib + fi + # Workaround for pytest-xdist flaky collection order + # https://github.com/pytest-dev/pytest/issues/920 + # https://github.com/pytest-dev/pytest/issues/1075 + export PYTHONHASHSEED=$(python -c 'import random; print(random.randint(1, 4294967295))') + echo PYTHONHASHSEED=$PYTHONHASHSEED + + echo The following args are passed to pytest $PYTEST_ARGS $RUN_PEP8 + if [[ $TRAVIS_OS_NAME == 'osx' ]]; then + python tests.py $PYTEST_ARGS $RUN_PEP8 + else + gdb -return-child-result -batch -ex r -ex bt --args python $PYTHON_ARGS tests.py $PYTEST_ARGS $RUN_PEP8 + fi +else + cd doc + python make.py html -n 2 + # We don't build the LaTeX docs here, so linkchecker will complain + touch build/html/Matplotlib.pdf + # Linkchecker only works with python 2.7 for the time being + deactivate + source ~/virtualenv/python2.7/bin/activate + pip install pip --upgrade + # linkchecker is currently broken with requests 2.10.0 so force an earlier version + pip install $PRE requests==2.9.2 linkchecker + linkchecker build/html/index.html +fi