From b9a02e0957600a196dc8245ae1446b1998b9b4d7 Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Sat, 13 Dec 2014 16:33:27 -0600 Subject: [PATCH] Add a script to create env variables and travis folding helpers Implement travis folding helpers Add a script to create env variables and travis folding helpers Implement travis folding helpers Source all of the shell scripts Remove since we are sourcing Fix syntax of travis fold commands Put the travis folds in the individual files Put the min test and flake in their own files Reinstate top level venv activation Remove unused script commands Fix travis_fold syntax --- .travis.yml | 23 +++++---------- ...tall_optional.sh => travis_install_all.sh} | 22 +++++++++++++++ ...{travis_setup.sh => travis_install_min.sh} | 4 +++ tools/{travis_test.sh => travis_test_all.sh} | 28 +++++++------------ tools/travis_test_min.sh | 10 +++++++ 5 files changed, 53 insertions(+), 34 deletions(-) rename tools/{travis_install_optional.sh => travis_install_all.sh} (74%) rename tools/{travis_setup.sh => travis_install_min.sh} (91%) rename tools/{travis_test.sh => travis_test_all.sh} (56%) create mode 100755 tools/travis_test_min.sh diff --git a/.travis.yml b/.travis.yml index 353f01bd..956f592b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -25,36 +25,27 @@ python: before_install: - export DISPLAY=:99.0 - sh -e /etc/init.d/xvfb start + - sudo apt-get update - export PYTHONWARNINGS="all" - export WHEELHOUSE="--no-index --find-links=http://travis-wheels.scikit-image.org/" - export TEST_ARGS="--exe --ignore-files=^_test -v --with-doctest --ignore-files=^setup.py$" - - export PIP_DEFAULT_TIMEOUT=60 - - sudo apt-get update - - travis_retry tools/travis_setup.sh + - travis_retry tools/travis_install_min.sh - source ~/venv/bin/activate - - which python - - python --version + - which python; python --version + - python check_bento_build.py - - - tools/header.py "Dependency versions" - tools/build_versions.py - install: - python setup.py build_ext --inplace - python setup.py install script: - - tools/header.py "Run all tests with minimum dependencies" - - nosetests $TEST_ARGS skimage - - - tools/header.py "Pep8 and Flake tests" - - flake8 --exit-zero --exclude=test_*,six.py skimage doc/examples viewer_examples - - - travis_retry tools/travis_install_optional.sh - - tools/travis_test.sh + - travis_retry tools/travis_test_min.sh + - travis_retry tools/travis_install_all.sh + - travis_retry tools/travis_test_all.sh after_success: - coveralls diff --git a/tools/travis_install_optional.sh b/tools/travis_install_all.sh similarity index 74% rename from tools/travis_install_optional.sh rename to tools/travis_install_all.sh index db8d3f32..1ef82e7a 100755 --- a/tools/travis_install_optional.sh +++ b/tools/travis_install_all.sh @@ -1,6 +1,8 @@ #!/usr/bin/env bash set -ex +echo -en "travis_fold:start:install.all\r" + tools/header.py "Install optional dependencies" # Install Qt and then update the Matplotlib settings @@ -48,3 +50,23 @@ if [[ $TRAVIS_PYTHON_VERSION == 2.* ]]; then fi pip install -q tifffile + + +if [[ $TRAVIS_PYTHON_VERSION == 2.7* ]]; then + MPL_QT_API=PyQt4 + MPL_DIR=$HOME/.matplotlib + export QT_API=pyqt + +else + MPL_QT_API=PySide + MPL_DIR=$HOME/.config/matplotlib + export QT_API=pyside +fi + +# Matplotlib settings - do not show figures during doc examples +mkdir -p $MPL_DIR +touch $MPL_DIR/matplotlibrc +echo 'backend : Template' > $MPL_DIR/matplotlibrc + + +echo -n "travis_fold:end:install.all\r" diff --git a/tools/travis_setup.sh b/tools/travis_install_min.sh similarity index 91% rename from tools/travis_setup.sh rename to tools/travis_install_min.sh index 7eee56cf..ed6e046b 100755 --- a/tools/travis_setup.sh +++ b/tools/travis_install_min.sh @@ -1,6 +1,8 @@ #!/usr/bin/env bash set -ex +echo -en "travis_fold:start:install.all\r" + # on Python 2.7, use the system versions of numpy, scipy, and matplotlib # and the minimum version of cython and networkx if [[ $TRAVIS_PYTHON_VERSION == 2.7* ]]; then @@ -29,3 +31,5 @@ pip install $WHEELHOUSE -r requirements.txt # clean up disk space sudo apt-get clean sudo rm -r /tmp/* + +echo -en "travis_fold:end:install.all\r" diff --git a/tools/travis_test.sh b/tools/travis_test_all.sh similarity index 56% rename from tools/travis_test.sh rename to tools/travis_test_all.sh index ea9f08c2..d4eef099 100755 --- a/tools/travis_test.sh +++ b/tools/travis_test_all.sh @@ -1,24 +1,8 @@ #!/usr/bin/env bash set -ex -if [[ $TRAVIS_PYTHON_VERSION == 2.7* ]]; then - MPL_QT_API=PyQt4 - MPL_DIR=$HOME/.matplotlib - export QT_API=pyqt +echo -en "travis_fold:start:doc.examples\r" -else - MPL_QT_API=PySide - MPL_DIR=$HOME/.config/matplotlib - export QT_API=pyside -fi - -# Matplotlib settings - do not show figures during doc examples -mkdir -p $MPL_DIR -touch $MPL_DIR/matplotlibrc -echo 'backend : Template' > $MPL_DIR/matplotlibrc - - -tools/header.py "Run doc examples" for f in doc/examples/*.py; do python "$f" if [ $? -ne 0 ]; then @@ -26,6 +10,7 @@ for f in doc/examples/*.py; do fi done + for f in doc/examples/applications/*.py; do python "$f" if [ $? -ne 0 ]; then @@ -33,15 +18,22 @@ for f in doc/examples/applications/*.py; do fi done +echo -en "travis_fold:end:doc.examples\r" + + +echo -en "travis_fold:start:test.all\r" + # Now configure Matplotlib to use Qt4 echo 'backend: Agg' > $MPL_DIR/matplotlibrc echo 'backend.qt4 : '$MPL_QT_API >> $MPL_DIR/matplotlibrc -tools/header.py "Run tests with all dependencies" +fold_start "Test_all_dependencies" # run tests again with optional dependencies to get more coverage if [[ $TRAVIS_PYTHON_VERSION == 3.3 ]]; then TEST_ARGS="$TEST_ARGS --with-cov --cover-package skimage" fi nosetests $TEST_ARGS +echo -en "travis_fold:end:test.all\r" + diff --git a/tools/travis_test_min.sh b/tools/travis_test_min.sh new file mode 100755 index 00000000..b249f5f5 --- /dev/null +++ b/tools/travis_test_min.sh @@ -0,0 +1,10 @@ +#!/usr/bin/env bash +set -ex + +echo -en "travis_fold:start:test.min\r" +nosetests $TEST_ARGS skimage +echo -en "travis_fold:end:test.min\r" + +echo -en "travis_fold:start:test.flake8\r" +flake8 --exit-zero --exclude=test_*,six.py skimage doc/examples viewer_examples +echo -en "travis_fold:end:test.flake8\r"