From 97a64d5a92cde6a3aaf880762a47eb11ee1d26d0 Mon Sep 17 00:00:00 2001 From: Nelle Varoquaux Date: Wed, 8 Mar 2017 10:57:42 -0800 Subject: [PATCH 1/5] DOC changes in travis's build environment --- .travis.yml | 48 ++++------------------------------------ ci/travis/test_script.sh | 47 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 51 insertions(+), 44 deletions(-) create mode 100644 ci/travis/test_script.sh diff --git a/.travis.yml b/.travis.yml index 625d2f4c077d..67d7e400f3d8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -53,13 +53,13 @@ env: 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 - python: "nightly" @@ -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/ci/travis/test_script.sh b/ci/travis/test_script.sh new file mode 100644 index 000000000000..db4642fd7ee0 --- /dev/null +++ b/ci/travis/test_script.sh @@ -0,0 +1,47 @@ +#! /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 [[ $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 From ba0bd47acbb72954bd4ff16ab0169a6ef29536b7 Mon Sep 17 00:00:00 2001 From: Nelle Varoquaux Date: Wed, 8 Mar 2017 11:12:37 -0800 Subject: [PATCH 2/5] DOC removed duplicate appveyor py3.5 environment --- appveyor.yml | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 653e7d5ebd00..8de6761ca716 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -31,19 +31,13 @@ environment: PYTHON_VERSION: "2.7" TEST_ALL: "no" CONDA_INSTALL_LOCN: "C:\\Miniconda-x64" + USE_PYTEST: "yes" - TARGET_ARCH: "x64" CONDA_PY: "35" CONDA_NPY: "110" 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" From ec86c019606f732eda2c79694b9c8721c1f07017 Mon Sep 17 00:00:00 2001 From: Nelle Varoquaux Date: Sat, 11 Mar 2017 11:37:51 -0800 Subject: [PATCH 3/5] CI: travis runs documentation build and mac osx only on merge with master --- .travis.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.travis.yml b/.travis.yml index 67d7e400f3d8..39b34ed5cf85 100644 --- a/.travis.yml +++ b/.travis.yml @@ -68,6 +68,7 @@ matrix: 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 @@ -79,6 +80,7 @@ matrix: - $HOME/.cache/matplotlib allow_failures: - python: "nightly" + - python: 2.7 before_install: - | From ea46243b9ce963cf0b23c13766ca88ae136c0fc9 Mon Sep 17 00:00:00 2001 From: Nelle Varoquaux Date: Sat, 11 Mar 2017 11:50:23 -0800 Subject: [PATCH 4/5] MAINT remove py.test from our travis build --- .travis.yml | 4 +--- ci/travis/test_script.sh | 10 +++------- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/.travis.yml b/.travis.yml index 39b34ed5cf85..67333fe3b2a4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -48,7 +48,6 @@ 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: @@ -61,7 +60,7 @@ matrix: - python: 3.5 env: BUILD_DOCS=true - 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 @@ -80,7 +79,6 @@ matrix: - $HOME/.cache/matplotlib allow_failures: - python: "nightly" - - python: 2.7 before_install: - | diff --git a/ci/travis/test_script.sh b/ci/travis/test_script.sh index db4642fd7ee0..21ee11fee066 100644 --- a/ci/travis/test_script.sh +++ b/ci/travis/test_script.sh @@ -23,14 +23,10 @@ if [[ $BUILD_DOCS == false ]]; then 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 + if [[ $TRAVIS_OS_NAME == 'osx' ]]; then + python tests.py $PYTEST_ARGS $RUN_PEP8 else - py.test $PYTEST_ARGS $RUN_PEP8 + gdb -return-child-result -batch -ex r -ex bt --args python $PYTHON_ARGS tests.py $PYTEST_ARGS $RUN_PEP8 fi else cd doc From 43c081d04cdc3048acdfd8e4b46c17a712771899 Mon Sep 17 00:00:00 2001 From: Nelle Varoquaux Date: Sat, 11 Mar 2017 12:06:35 -0800 Subject: [PATCH 5/5] FIX appveyor doesn't need option USE_PYTEST anymore --- appveyor.yml | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 8de6761ca716..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 @@ -31,7 +30,6 @@ environment: PYTHON_VERSION: "2.7" TEST_ALL: "no" CONDA_INSTALL_LOCN: "C:\\Miniconda-x64" - USE_PYTEST: "yes" - TARGET_ARCH: "x64" CONDA_PY: "35" CONDA_NPY: "110" @@ -62,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%; @@ -134,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