From cf7c8750b56173caeb7f8497ad53298704fd7e99 Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Thu, 9 Oct 2014 19:42:47 -0500 Subject: [PATCH 01/42] Push parts of travis into separate shell scripts --- .travis.yml | 75 ++----------------------------------------- doc/travis_notes.txt | 22 ++----------- tools/travis_build.sh | 59 ++++++++++++++++++++++++++++++++++ tools/travis_setup.sh | 12 +++++++ 4 files changed, 76 insertions(+), 92 deletions(-) create mode 100644 tools/travis_build.sh create mode 100644 tools/travis_setup.sh diff --git a/.travis.yml b/.travis.yml index a59390c2..122189e6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -22,19 +22,7 @@ before_install: - sh -e /etc/init.d/xvfb start - sudo apt-get update - - travis_retry pip install wheel flake8 coveralls nose - - travis_retry pip uninstall -y numpy - - # 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 - travis_retry sudo apt-get install python-scipy python-matplotlib; - pip install https://github.com/cython/cython/archive/0.19.2.tar.gz; - pip install https://github.com/networkx/networkx/archive/networkx-1.8.tar.gz; - fi - - - travis_retry pip install -r requirements.txt $WHEELHOUSE; - - python check_bento_build.py + - tools/travis_setup.sh install: - tools/header.py "Dependency versions" @@ -43,64 +31,7 @@ install: - python setup.py build_ext --inplace script: - - tools/header.py "Run all tests with minimum dependencies" - - nosetests --exe -v skimage - - - tools/header.py "Pep8 and Flake tests" - - flake8 --exit-zero --exclude=test_*,six.py skimage doc/examples viewer_examples - - - tools/header.py "Install optional dependencies" - - # Install Qt and then update the Matplotlib settings - - if [[ $TRAVIS_PYTHON_VERSION == 2.7* ]]; then - sudo apt-get install -q python-qt4; - export SCI_QT_API=PyQt4; - - else - sudo apt-get install -q libqt4-dev; - travis_retry pip install PySide $WHEELHOUSE; - python ~/virtualenv/python${TRAVIS_PYTHON_VERSION}/bin/pyside_postinstall.py -install; - export SCI_QT_API=Pyside; - fi - - # Matplotlib settings - must be after we install Pyside - - export MPL_DIR=$HOME/.config/matplotlib - - mkdir -p $MPL_DIR - - touch $MPL_DIR/matplotlibrc - - "echo 'backend : Agg' > $MPL_DIR/matplotlibrc" - - "echo 'backend.qt4 : '$SCI_QT_API >> $MPL_DIR/matplotlibrc" - - # - imread does NOT support py3.2 - - if [[ $TRAVIS_PYTHON_VERSION != 3.2 ]]; then - sudo apt-get install -q libtiff4-dev libwebp-dev libpng12-dev xcftools; - travis_retry pip install imread; - fi - - # TODO: update when SimpleITK become available on py34 or hopefully pip - - if [[ $TRAVIS_PYTHON_VERSION != 3.4 ]]; then - travis_retry easy_install SimpleITK; - fi - - - travis_retry sudo apt-get install libfreeimage3 - - travis_retry pip install astropy - - - if [[ $TRAVIS_PYTHON_VERSION == 2.* ]]; then - travis_retry pip install pyamg; - fi - - - tools/header.py "Run doc examples" - - export PYTHONPATH=$(pwd):$PYTHONPATH - - for f in doc/examples/*.py; do python "$f"; if [ $? -ne 0 ]; then exit 1; fi done - - for f in doc/examples/applications/*.py; do python "$f"; if [ $? -ne 0 ]; then exit 1; fi done - - - tools/header.py "Run tests with all dependencies" - # run tests again with optional dependencies to get more coverage - # measure coverage on py3.3 - - if [[ $TRAVIS_PYTHON_VERSION == 3.3 ]]; then - nosetests --exe -v --with-doctest --with-cov --cover-package skimage; - else - nosetests --exe -v --with-doctest skimage; - fi + - tools/travis_build.sh after_success: - - coveralls; + - coveralls diff --git a/doc/travis_notes.txt b/doc/travis_notes.txt index 09d04889..c5d5c99c 100644 --- a/doc/travis_notes.txt +++ b/doc/travis_notes.txt @@ -3,26 +3,8 @@ http://lint.travis-ci.org/ is recommended elsewhere but does not give helpful error reports. - Make sure all of your "-" lines start on the same column -- Make sure all of your "if" lines are aligned with the "else" and "fi" lines -- Recommend using tab stops (but not tab chars) everywhere for alignment -- "If" blocks must be on one travis statement and have semicolons at the - end of each line: - -``` - - if [[ $TRAVIS_PYTHON_VERSION == 2.7 ]]; then - echo "2.7"; - else - echo "Not 2.7"; - end -``` - -- "If" blocks cannot contain comments -- All travis commands are run with `eval` and quotes are taken as literal - characters unless you wrap the whole line in quotes: -`echo "hello : world"` is interpreted as `echo \"hello : world\"` -`"echo 'hello : world'"` is interpreted as `echo 'hello : world'` -`"echo 'hello : '$(MYVAR)'world'"` is interpreted as - `echo 'hello : $(MYVAR)world'` +- Use shell scripts for `before_install` and `script` or any part that + has conditional statements - Use `travis_retry` before a command to have it try several times before failing (useful for installing from third party sources) - Feel free to cancel a build rather than waiting for it to go to completion diff --git a/tools/travis_build.sh b/tools/travis_build.sh new file mode 100644 index 00000000..79b8f9b5 --- /dev/null +++ b/tools/travis_build.sh @@ -0,0 +1,59 @@ +./header.py "Run all tests with minimum dependencies" +nosetests --exe -v skimage + +./header.py "Pep8 and Flake tests" +flake8 --exit-zero --exclude=test_*,six.py skimage doc/examples viewer_examples + +./header.py "Install optional dependencies" + +# Install Qt and then update the Matplotlib settings +if [[ $TRAVIS_PYTHON_VERSION == 2.7* ]]; then + sudo apt-get install -q python-qt4 + export SCI_QT_API=PyQt4 + +else + sudo apt-get install -q libqt4-dev + travis_retry pip install PySide $WHEELHOUSE + python ~/virtualenv/python${TRAVIS_PYTHON_VERSION}/bin/pyside_postinstall.py -install + export SCI_QT_API=PySide +fi + +# Matplotlib settings - must be after we install Pyside +export MPL_DIR=$HOME/.config/matplotlib +mkdir -p $MPL_DIR +touch $MPL_DIR/matplotlibrc +echo 'backend : Agg' > $MPL_DIR/matplotlibrc +echo 'backend.qt4 : '$SCI_QT_API >> $MPL_DIR/matplotlibrc + +# imread does NOT support py3.2 +if [[ $TRAVIS_PYTHON_VERSION != 3.2 ]]; then + sudo apt-get install -q libtiff4-dev libwebp-dev libpng12-dev xcftools + travis_retry pip install imread +fi + +# TODO: update when SimpleITK become available on py34 or hopefully pip +if [[ $TRAVIS_PYTHON_VERSION != 3.4 ]]; then + travis_retry easy_install SimpleITK +fi + +travis_retry sudo apt-get install libfreeimage3 +travis_retry pip install astropy + +if [[ $TRAVIS_PYTHON_VERSION == 2.* ]]; then + travis_retry pip install pyamg +fi + +./header.py "Run doc examples" +export PYTHONPATH=$(pwd):$PYTHONPATH +for f in doc/examples/*.py; do python "$f"; if [ $? -ne 0 ]; then exit 1; fi done +for f in doc/examples/applications/*.py; do python "$f"; if [ $? -ne 0 ]; then exit 1; fi done + +./header.py "Run tests with all dependencies" +# run tests again with optional dependencies to get more coverage +# measure coverage on py3.3 +if [[ $TRAVIS_PYTHON_VERSION == 3.3 ]]; then + nosetests --exe -v --with-doctest --with-cov --cover-package skimage +else + nosetests --exe -v --with-doctest skimage +fi + diff --git a/tools/travis_setup.sh b/tools/travis_setup.sh new file mode 100644 index 00000000..c6d8c566 --- /dev/null +++ b/tools/travis_setup.sh @@ -0,0 +1,12 @@ +travis_retry pip install wheel flake8 coveralls nose + +# 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 + travis_retry sudo apt-get install python-scipy python-matplotlib + pip install https://github.com/cython/cython/archive/0.19.2.tar.gz + pip install https://github.com/networkx/networkx/archive/networkx-1.8.tar.gz +fi + +travis_retry pip install -r requirements.txt $WHEELHOUSE +python check_bento_build.py From 4233e9fb3afde7acf9a7b28c98c30f69e923774f Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Thu, 9 Oct 2014 19:45:30 -0500 Subject: [PATCH 02/42] Remove variable exports --- tools/travis_build.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/travis_build.sh b/tools/travis_build.sh index 79b8f9b5..f45875ae 100644 --- a/tools/travis_build.sh +++ b/tools/travis_build.sh @@ -9,17 +9,17 @@ flake8 --exit-zero --exclude=test_*,six.py skimage doc/examples viewer_examples # Install Qt and then update the Matplotlib settings if [[ $TRAVIS_PYTHON_VERSION == 2.7* ]]; then sudo apt-get install -q python-qt4 - export SCI_QT_API=PyQt4 + SCI_QT_API=PyQt4 else sudo apt-get install -q libqt4-dev travis_retry pip install PySide $WHEELHOUSE python ~/virtualenv/python${TRAVIS_PYTHON_VERSION}/bin/pyside_postinstall.py -install - export SCI_QT_API=PySide + SCI_QT_API=PySide fi # Matplotlib settings - must be after we install Pyside -export MPL_DIR=$HOME/.config/matplotlib +MPL_DIR=$HOME/.config/matplotlib mkdir -p $MPL_DIR touch $MPL_DIR/matplotlibrc echo 'backend : Agg' > $MPL_DIR/matplotlibrc @@ -44,7 +44,7 @@ if [[ $TRAVIS_PYTHON_VERSION == 2.* ]]; then fi ./header.py "Run doc examples" -export PYTHONPATH=$(pwd):$PYTHONPATH +PYTHONPATH=$(pwd):$PYTHONPATH for f in doc/examples/*.py; do python "$f"; if [ $? -ne 0 ]; then exit 1; fi done for f in doc/examples/applications/*.py; do python "$f"; if [ $? -ne 0 ]; then exit 1; fi done From b1f7bd813312df45f1c8ef2280aaa3d58e3042e0 Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Thu, 9 Oct 2014 19:48:50 -0500 Subject: [PATCH 03/42] Add shebang lines --- tools/travis_build.sh | 1 + tools/travis_setup.sh | 1 + 2 files changed, 2 insertions(+) diff --git a/tools/travis_build.sh b/tools/travis_build.sh index f45875ae..7ed37c56 100644 --- a/tools/travis_build.sh +++ b/tools/travis_build.sh @@ -1,3 +1,4 @@ +#!/usr/bin/sh ./header.py "Run all tests with minimum dependencies" nosetests --exe -v skimage diff --git a/tools/travis_setup.sh b/tools/travis_setup.sh index c6d8c566..ad740a69 100644 --- a/tools/travis_setup.sh +++ b/tools/travis_setup.sh @@ -1,3 +1,4 @@ +#!/usr/bin/sh travis_retry pip install wheel flake8 coveralls nose # on Python 2.7, use the system versions of numpy, scipy, and matplotlib From 0bad613568bab7f39cc60fc3593dca976c6c1b76 Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Thu, 9 Oct 2014 19:51:00 -0500 Subject: [PATCH 04/42] Add explicit sh executable --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 122189e6..fbefad0b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -22,7 +22,7 @@ before_install: - sh -e /etc/init.d/xvfb start - sudo apt-get update - - tools/travis_setup.sh + - sh tools/travis_setup.sh install: - tools/header.py "Dependency versions" @@ -31,7 +31,7 @@ install: - python setup.py build_ext --inplace script: - - tools/travis_build.sh + - sh tools/travis_build.sh after_success: - coveralls From 87d3a07b71003f37ab31a22b9cc51e991e3999a9 Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Thu, 9 Oct 2014 20:01:43 -0500 Subject: [PATCH 05/42] Reorganize files --- .travis.yml | 25 +++++++++++++-- tools/travis_build.sh | 60 ------------------------------------ tools/travis_get_optional.sh | 39 +++++++++++++++++++++++ tools/travis_setup.sh | 6 ++-- 4 files changed, 65 insertions(+), 65 deletions(-) delete mode 100644 tools/travis_build.sh create mode 100644 tools/travis_get_optional.sh diff --git a/.travis.yml b/.travis.yml index fbefad0b..4a4288fd 100644 --- a/.travis.yml +++ b/.travis.yml @@ -22,7 +22,7 @@ before_install: - sh -e /etc/init.d/xvfb start - sudo apt-get update - - sh tools/travis_setup.sh + - travis_retry sh tools/travis_setup.sh install: - tools/header.py "Dependency versions" @@ -31,7 +31,28 @@ install: - python setup.py build_ext --inplace script: - - sh tools/travis_build.sh + - tools/header.py "Run all tests with minimum dependencies" + - nosetests --exe -v skimage + + - tools/header.py "Pep8 and Flake tests" + - flake8 --exit-zero --exclude=test_*,six.py skimage doc/examples viewer_examples + + - travis_retry sh tools/travis_get_optional.sh + + - tools/header.py "Run doc examples" + - export PYTHONPATH=$(pwd):$PYTHONPATH + - for f in doc/examples/*.py; do python "$f"; if [ $? -ne 0 ]; then exit 1; fi done + - for f in doc/examples/applications/*.py; do python "$f"; if [ $? -ne 0 ]; then exit 1; fi done + + - tools/header.py "Run tests with all dependencies" + # run tests again with optional dependencies to get more coverage + # measure coverage on py3.3 + - if [[ $TRAVIS_PYTHON_VERSION == 3.3 ]]; then + nosetests --exe -v --with-doctest --with-cov --cover-package skimage; + else + nosetests --exe -v --with-doctest skimage; + fi + after_success: - coveralls diff --git a/tools/travis_build.sh b/tools/travis_build.sh deleted file mode 100644 index 7ed37c56..00000000 --- a/tools/travis_build.sh +++ /dev/null @@ -1,60 +0,0 @@ -#!/usr/bin/sh -./header.py "Run all tests with minimum dependencies" -nosetests --exe -v skimage - -./header.py "Pep8 and Flake tests" -flake8 --exit-zero --exclude=test_*,six.py skimage doc/examples viewer_examples - -./header.py "Install optional dependencies" - -# Install Qt and then update the Matplotlib settings -if [[ $TRAVIS_PYTHON_VERSION == 2.7* ]]; then - sudo apt-get install -q python-qt4 - SCI_QT_API=PyQt4 - -else - sudo apt-get install -q libqt4-dev - travis_retry pip install PySide $WHEELHOUSE - python ~/virtualenv/python${TRAVIS_PYTHON_VERSION}/bin/pyside_postinstall.py -install - SCI_QT_API=PySide -fi - -# Matplotlib settings - must be after we install Pyside -MPL_DIR=$HOME/.config/matplotlib -mkdir -p $MPL_DIR -touch $MPL_DIR/matplotlibrc -echo 'backend : Agg' > $MPL_DIR/matplotlibrc -echo 'backend.qt4 : '$SCI_QT_API >> $MPL_DIR/matplotlibrc - -# imread does NOT support py3.2 -if [[ $TRAVIS_PYTHON_VERSION != 3.2 ]]; then - sudo apt-get install -q libtiff4-dev libwebp-dev libpng12-dev xcftools - travis_retry pip install imread -fi - -# TODO: update when SimpleITK become available on py34 or hopefully pip -if [[ $TRAVIS_PYTHON_VERSION != 3.4 ]]; then - travis_retry easy_install SimpleITK -fi - -travis_retry sudo apt-get install libfreeimage3 -travis_retry pip install astropy - -if [[ $TRAVIS_PYTHON_VERSION == 2.* ]]; then - travis_retry pip install pyamg -fi - -./header.py "Run doc examples" -PYTHONPATH=$(pwd):$PYTHONPATH -for f in doc/examples/*.py; do python "$f"; if [ $? -ne 0 ]; then exit 1; fi done -for f in doc/examples/applications/*.py; do python "$f"; if [ $? -ne 0 ]; then exit 1; fi done - -./header.py "Run tests with all dependencies" -# run tests again with optional dependencies to get more coverage -# measure coverage on py3.3 -if [[ $TRAVIS_PYTHON_VERSION == 3.3 ]]; then - nosetests --exe -v --with-doctest --with-cov --cover-package skimage -else - nosetests --exe -v --with-doctest skimage -fi - diff --git a/tools/travis_get_optional.sh b/tools/travis_get_optional.sh new file mode 100644 index 00000000..b43a44dc --- /dev/null +++ b/tools/travis_get_optional.sh @@ -0,0 +1,39 @@ +#!/usr/bin/sh +./header.py "Install optional dependencies" + +# Install Qt and then update the Matplotlib settings +if [[ $TRAVIS_PYTHON_VERSION == 2.7* ]]; then + sudo apt-get install -q python-qt4 + SCI_QT_API=PyQt4 + +else + sudo apt-get install -q libqt4-dev + pip install PySide $WHEELHOUSE + python ~/virtualenv/python${TRAVIS_PYTHON_VERSION}/bin/pyside_postinstall.py -install + SCI_QT_API=PySide +fi + +# Matplotlib settings - must be after we install Pyside +MPL_DIR=$HOME/.config/matplotlib +mkdir -p $MPL_DIR +touch $MPL_DIR/matplotlibrc +echo 'backend : Agg' > $MPL_DIR/matplotlibrc +echo 'backend.qt4 : '$SCI_QT_API >> $MPL_DIR/matplotlibrc + +# imread does NOT support py3.2 +if [[ $TRAVIS_PYTHON_VERSION != 3.2 ]]; then + sudo apt-get install -q libtiff4-dev libwebp-dev libpng12-dev xcftools + pip install imread +fi + +# TODO: update when SimpleITK become available on py34 or hopefully pip +if [[ $TRAVIS_PYTHON_VERSION != 3.4 ]]; then + easy_install SimpleITK +fi + +sudo apt-get install libfreeimage3 +pip install astropy + +if [[ $TRAVIS_PYTHON_VERSION == 2.* ]]; then + pip install pyamg +fi diff --git a/tools/travis_setup.sh b/tools/travis_setup.sh index ad740a69..af14be4d 100644 --- a/tools/travis_setup.sh +++ b/tools/travis_setup.sh @@ -1,13 +1,13 @@ #!/usr/bin/sh -travis_retry pip install wheel flake8 coveralls nose +pip install wheel flake8 coveralls nose # 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 - travis_retry sudo apt-get install python-scipy python-matplotlib + sudo apt-get install python-scipy python-matplotlib pip install https://github.com/cython/cython/archive/0.19.2.tar.gz pip install https://github.com/networkx/networkx/archive/networkx-1.8.tar.gz fi -travis_retry pip install -r requirements.txt $WHEELHOUSE +pip install -r requirements.txt $WHEELHOUSE python check_bento_build.py From 7cb084b9c4916ff7428efec79bad9acc8625df50 Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Thu, 9 Oct 2014 20:12:22 -0500 Subject: [PATCH 06/42] Use an explicit matrix --- .travis.yml | 27 ++++++++++++--------------- 1 file changed, 12 insertions(+), 15 deletions(-) diff --git a/.travis.yml b/.travis.yml index 4a4288fd..c6bf6f56 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,21 +7,24 @@ language: python -python: - - 2.6 - - "2.7_with_system_site_packages" - - 3.2 - - 3.3 - - 3.4 +env: TEST_ARGS="" -env: - WHEELHOUSE="--no-index --find-links=http://wheels.scikit-image.org/" +matrix: + include: + - python: "2.6" + - python: "2.7_with_system_site_packages" + - python: "3.2" + - python: "3.3" + env: TEST_ARGS="--with-cov --cover-package" + - python: "3.4" before_install: - export DISPLAY=:99.0 - sh -e /etc/init.d/xvfb start - sudo apt-get update + - export WHEELHOUSE="--no-index --find-links=http://wheels.scikit-image.org/" + - travis_retry sh tools/travis_setup.sh install: @@ -46,13 +49,7 @@ script: - tools/header.py "Run tests with all dependencies" # run tests again with optional dependencies to get more coverage - # measure coverage on py3.3 - - if [[ $TRAVIS_PYTHON_VERSION == 3.3 ]]; then - nosetests --exe -v --with-doctest --with-cov --cover-package skimage; - else - nosetests --exe -v --with-doctest skimage; - fi - + - nosetests --exe -v --with-doctest $TEST_ARGS after_success: - coveralls From d415486a211eb470366a41edc57bf0442ef6b9ac Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Thu, 9 Oct 2014 20:26:21 -0500 Subject: [PATCH 07/42] Try removing the explicit env --- .travis.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index c6bf6f56..58206877 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,8 +7,6 @@ language: python -env: TEST_ARGS="" - matrix: include: - python: "2.6" From 81d54983382bed9107d805f200186c45aaa09b6e Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Thu, 9 Oct 2014 20:34:25 -0500 Subject: [PATCH 08/42] Put the TEST_ARGS in travis_setup.sh --- .travis.yml | 15 +++++++-------- tools/travis_setup.sh | 6 ++++++ 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/.travis.yml b/.travis.yml index 58206877..47983033 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,14 +7,12 @@ language: python -matrix: - include: - - python: "2.6" - - python: "2.7_with_system_site_packages" - - python: "3.2" - - python: "3.3" - env: TEST_ARGS="--with-cov --cover-package" - - python: "3.4" +python: +- 2.6 +- "2.7_with_system_site_packages" +- 3.2 +- 3.3 +- 3.4 before_install: - export DISPLAY=:99.0 @@ -47,6 +45,7 @@ script: - tools/header.py "Run tests with all dependencies" # run tests again with optional dependencies to get more coverage + # we get TEST_ARGS from travis_setup.sh - nosetests --exe -v --with-doctest $TEST_ARGS after_success: diff --git a/tools/travis_setup.sh b/tools/travis_setup.sh index af14be4d..5595f769 100644 --- a/tools/travis_setup.sh +++ b/tools/travis_setup.sh @@ -11,3 +11,9 @@ fi pip install -r requirements.txt $WHEELHOUSE python check_bento_build.py + +if [[ $TRAVIS_PYTHON_VERSION == 3.3 ]]; then + export TEST_ARGS="--with-cov --cover-package skimage" +else + export TEST_ARGS="" +fi From 184b9fece3aad4726faef7d7b406d5b611311d7b Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Thu, 9 Oct 2014 21:06:01 -0500 Subject: [PATCH 09/42] Specify Qt API --- tools/travis_get_optional.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/travis_get_optional.sh b/tools/travis_get_optional.sh index b43a44dc..45007915 100644 --- a/tools/travis_get_optional.sh +++ b/tools/travis_get_optional.sh @@ -5,12 +5,14 @@ if [[ $TRAVIS_PYTHON_VERSION == 2.7* ]]; then sudo apt-get install -q python-qt4 SCI_QT_API=PyQt4 + export QT_API=pyqt else sudo apt-get install -q libqt4-dev pip install PySide $WHEELHOUSE python ~/virtualenv/python${TRAVIS_PYTHON_VERSION}/bin/pyside_postinstall.py -install SCI_QT_API=PySide + export QT_API=PySide fi # Matplotlib settings - must be after we install Pyside From adfe6b3c3e9d223c8d2ac5a046e68388ef5f077d Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Thu, 9 Oct 2014 21:17:04 -0500 Subject: [PATCH 10/42] Rename variable to MPL_QT_API --- tools/travis_get_optional.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/travis_get_optional.sh b/tools/travis_get_optional.sh index 45007915..ccc297c9 100644 --- a/tools/travis_get_optional.sh +++ b/tools/travis_get_optional.sh @@ -4,14 +4,14 @@ # Install Qt and then update the Matplotlib settings if [[ $TRAVIS_PYTHON_VERSION == 2.7* ]]; then sudo apt-get install -q python-qt4 - SCI_QT_API=PyQt4 + MPL_QT_API=PyQt4 export QT_API=pyqt else sudo apt-get install -q libqt4-dev pip install PySide $WHEELHOUSE python ~/virtualenv/python${TRAVIS_PYTHON_VERSION}/bin/pyside_postinstall.py -install - SCI_QT_API=PySide + MPL_QT_API=PySide export QT_API=PySide fi @@ -20,7 +20,7 @@ MPL_DIR=$HOME/.config/matplotlib mkdir -p $MPL_DIR touch $MPL_DIR/matplotlibrc echo 'backend : Agg' > $MPL_DIR/matplotlibrc -echo 'backend.qt4 : '$SCI_QT_API >> $MPL_DIR/matplotlibrc +echo 'backend.qt4 : '$MPL_QT_API >> $MPL_DIR/matplotlibrc # imread does NOT support py3.2 if [[ $TRAVIS_PYTHON_VERSION != 3.2 ]]; then From 5f719d19ebe22be504d858faf4ac83c13a9a4043 Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Thu, 9 Oct 2014 22:04:42 -0500 Subject: [PATCH 11/42] Put the whole script in an sh file --- .travis.yml | 20 ++----------------- tools/travis_get_optional.sh | 38 ++++++++++++++++++++++++++++++++++-- tools/travis_setup.sh | 10 +++------- 3 files changed, 41 insertions(+), 27 deletions(-) diff --git a/.travis.yml b/.travis.yml index 47983033..a2fe2e84 100644 --- a/.travis.yml +++ b/.travis.yml @@ -21,7 +21,7 @@ before_install: - export WHEELHOUSE="--no-index --find-links=http://wheels.scikit-image.org/" - - travis_retry sh tools/travis_setup.sh + - ./tools/travis_setup.sh install: - tools/header.py "Dependency versions" @@ -30,23 +30,7 @@ install: - python setup.py build_ext --inplace script: - - tools/header.py "Run all tests with minimum dependencies" - - nosetests --exe -v skimage - - - tools/header.py "Pep8 and Flake tests" - - flake8 --exit-zero --exclude=test_*,six.py skimage doc/examples viewer_examples - - - travis_retry sh tools/travis_get_optional.sh - - - tools/header.py "Run doc examples" - - export PYTHONPATH=$(pwd):$PYTHONPATH - - for f in doc/examples/*.py; do python "$f"; if [ $? -ne 0 ]; then exit 1; fi done - - for f in doc/examples/applications/*.py; do python "$f"; if [ $? -ne 0 ]; then exit 1; fi done - - - tools/header.py "Run tests with all dependencies" - # run tests again with optional dependencies to get more coverage - # we get TEST_ARGS from travis_setup.sh - - nosetests --exe -v --with-doctest $TEST_ARGS + - ./tools/travis_test.sh after_success: - coveralls diff --git a/tools/travis_get_optional.sh b/tools/travis_get_optional.sh index ccc297c9..1a3a9a59 100644 --- a/tools/travis_get_optional.sh +++ b/tools/travis_get_optional.sh @@ -1,5 +1,13 @@ -#!/usr/bin/sh -./header.py "Install optional dependencies" +#!/bin/sh +set -ex + +tools/header.py "Run all tests with minimum dependencies" +nosetests --exe -v skimage + +tools/header.py "Pep8 and Flake tests" +flake8 --exit-zero --exclude=test_*,six.py skimage doc/examples viewer_examples + +tools/header.py "Install optional dependencies" # Install Qt and then update the Matplotlib settings if [[ $TRAVIS_PYTHON_VERSION == 2.7* ]]; then @@ -39,3 +47,29 @@ pip install astropy if [[ $TRAVIS_PYTHON_VERSION == 2.* ]]; then pip install pyamg fi + +tools/header.py "Run doc examples" +PYTHONPATH=$(pwd):$PYTHONPATH +for f in doc/examples/*.py; +do python "$f"; + if [ $? -ne 0 ]; then + exit 1; + fi +done + +for f in doc/examples/applications/*.py; +do python "$f"; + if [ $? -ne 0 ]; then + exit 1; + fi +done + +tools/header.py "Run tests with all dependencies" +# run tests again with optional dependencies to get more coverage +if [[ $TRAVIS_PYTHON_VERSION == 3.3 ]]; then + export TEST_ARGS="--with-cov --cover-package skimage" +else + export TEST_ARGS="" +fi +nosetests --exe -v --with-doctest $TEST_ARGS + diff --git a/tools/travis_setup.sh b/tools/travis_setup.sh index 5595f769..9ef667e7 100644 --- a/tools/travis_setup.sh +++ b/tools/travis_setup.sh @@ -1,4 +1,6 @@ -#!/usr/bin/sh +#!/bin/sh +set -ex + pip install wheel flake8 coveralls nose # on Python 2.7, use the system versions of numpy, scipy, and matplotlib @@ -11,9 +13,3 @@ fi pip install -r requirements.txt $WHEELHOUSE python check_bento_build.py - -if [[ $TRAVIS_PYTHON_VERSION == 3.3 ]]; then - export TEST_ARGS="--with-cov --cover-package skimage" -else - export TEST_ARGS="" -fi From b68643afc262b4ed463805029ea6b570237f88bb Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Thu, 9 Oct 2014 23:00:26 -0500 Subject: [PATCH 12/42] Make shell scripts executable --- tools/travis_get_optional.sh | 0 tools/travis_setup.sh | 0 2 files changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 tools/travis_get_optional.sh mode change 100644 => 100755 tools/travis_setup.sh diff --git a/tools/travis_get_optional.sh b/tools/travis_get_optional.sh old mode 100644 new mode 100755 diff --git a/tools/travis_setup.sh b/tools/travis_setup.sh old mode 100644 new mode 100755 From f39775add6794f04628887ff4ee5a1c967ef3104 Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Thu, 9 Oct 2014 23:01:04 -0500 Subject: [PATCH 13/42] Remove the travis numpy --- tools/travis_setup.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/travis_setup.sh b/tools/travis_setup.sh index 9ef667e7..6ab65da3 100755 --- a/tools/travis_setup.sh +++ b/tools/travis_setup.sh @@ -2,6 +2,7 @@ set -ex pip install wheel flake8 coveralls nose +pip uninstall -y numpy # on Python 2.7, use the system versions of numpy, scipy, and matplotlib # and the minimum version of cython and networkx From b594f0afa07f924ea7ebfb37d28849faf94e3154 Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Fri, 10 Oct 2014 05:00:17 -0500 Subject: [PATCH 14/42] Rename the script --- tools/{travis_get_optional.sh => travis_test.sh} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename tools/{travis_get_optional.sh => travis_test.sh} (100%) diff --git a/tools/travis_get_optional.sh b/tools/travis_test.sh similarity index 100% rename from tools/travis_get_optional.sh rename to tools/travis_test.sh From ba1193b15ba218c5c01e7738b6b4a8218e810b0c Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Fri, 10 Oct 2014 05:17:39 -0500 Subject: [PATCH 15/42] Switch shell to bash --- tools/travis_setup.sh | 2 +- tools/travis_test.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/travis_setup.sh b/tools/travis_setup.sh index 6ab65da3..4678dafa 100755 --- a/tools/travis_setup.sh +++ b/tools/travis_setup.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/usr/bin/bash set -ex pip install wheel flake8 coveralls nose diff --git a/tools/travis_test.sh b/tools/travis_test.sh index 1a3a9a59..a309a32d 100755 --- a/tools/travis_test.sh +++ b/tools/travis_test.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/usr/bin/bash set -ex tools/header.py "Run all tests with minimum dependencies" From 5511639938578b5ffb8e4517755b8d9a6ea040a5 Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Fri, 10 Oct 2014 05:25:48 -0500 Subject: [PATCH 16/42] Use more generic shebang --- tools/travis_setup.sh | 2 +- tools/travis_test.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/travis_setup.sh b/tools/travis_setup.sh index 4678dafa..c71e3d7a 100755 --- a/tools/travis_setup.sh +++ b/tools/travis_setup.sh @@ -1,4 +1,4 @@ -#!/usr/bin/bash +#!/usr/bin/env bash set -ex pip install wheel flake8 coveralls nose diff --git a/tools/travis_test.sh b/tools/travis_test.sh index a309a32d..c0cab37a 100755 --- a/tools/travis_test.sh +++ b/tools/travis_test.sh @@ -1,4 +1,4 @@ -#!/usr/bin/bash +#!#!/usr/bin/env bash set -ex tools/header.py "Run all tests with minimum dependencies" From 10cc476f7f4516ba67d385d1796e65db56e3307d Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Fri, 10 Oct 2014 05:33:35 -0500 Subject: [PATCH 17/42] Try to get system matplotlib to pass requirments.txt --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 435803b9..98f3b77f 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,5 @@ cython>=0.19.2 -matplotlib>=1.1.1 +matplotlib>=1.1.0 numpy>=1.6.1 scipy>=0.9 six>=1.3 From 29e51a0604e3da65afdadbed161a720ae7aafd68 Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Fri, 10 Oct 2014 05:36:54 -0500 Subject: [PATCH 18/42] Fix shebang line --- tools/travis_test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/travis_test.sh b/tools/travis_test.sh index c0cab37a..acbc1241 100755 --- a/tools/travis_test.sh +++ b/tools/travis_test.sh @@ -1,4 +1,4 @@ -#!#!/usr/bin/env bash +#!/usr/bin/env bash set -ex tools/header.py "Run all tests with minimum dependencies" From fdfb24269422948c2b2fdc80379e6375a293b45f Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Fri, 10 Oct 2014 05:50:02 -0500 Subject: [PATCH 19/42] Update the notes --- doc/travis_notes.txt | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/doc/travis_notes.txt b/doc/travis_notes.txt index c5d5c99c..37f5d4a1 100644 --- a/doc/travis_notes.txt +++ b/doc/travis_notes.txt @@ -3,10 +3,19 @@ http://lint.travis-ci.org/ is recommended elsewhere but does not give helpful error reports. - Make sure all of your "-" lines start on the same column -- Use shell scripts for `before_install` and `script` or any part that +- Use bash scripts for `before_install` and `script` or any part that has conditional statements + - Make sure they are "executable" (chmod +x) + - Use the following header: + + ``` + #!/usr/bin/env bash + set -ex + ``` + - Use `travis_retry` before a command to have it try several times before -failing (useful for installing from third party sources) +failing (useful for installing from third party sources). Note that this +command is not available within a bash script. - Feel free to cancel a build rather than waiting for it to go to completion if you have made a change to that branch. - A VM with 64bit Ubuntu 12.04 is a huge help for debugging. From 6e326add184840234f64b7a472449e5da78136d2 Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Fri, 10 Oct 2014 05:51:03 -0500 Subject: [PATCH 20/42] The python path should include the parent directory now --- tools/travis_test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/travis_test.sh b/tools/travis_test.sh index acbc1241..f79cbc2b 100755 --- a/tools/travis_test.sh +++ b/tools/travis_test.sh @@ -49,7 +49,7 @@ if [[ $TRAVIS_PYTHON_VERSION == 2.* ]]; then fi tools/header.py "Run doc examples" -PYTHONPATH=$(pwd):$PYTHONPATH +PYTHONPATH="..":$PYTHONPATH for f in doc/examples/*.py; do python "$f"; if [ $? -ne 0 ]; then From 73e639e3b614ad2b784d507ac708246dde02a974 Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Fri, 10 Oct 2014 05:53:04 -0500 Subject: [PATCH 21/42] Fix formatting of 'for' loops --- tools/travis_test.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/travis_test.sh b/tools/travis_test.sh index f79cbc2b..5f062542 100755 --- a/tools/travis_test.sh +++ b/tools/travis_test.sh @@ -50,15 +50,15 @@ fi tools/header.py "Run doc examples" PYTHONPATH="..":$PYTHONPATH -for f in doc/examples/*.py; -do python "$f"; +for f in doc/examples/*.py; do + python "$f"; if [ $? -ne 0 ]; then exit 1; fi done -for f in doc/examples/applications/*.py; -do python "$f"; +for f in doc/examples/applications/*.py; do + python "$f"; if [ $? -ne 0 ]; then exit 1; fi From e146c3eea5ea9449a1601a7d36eba20e9c60b86e Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Fri, 10 Oct 2014 06:11:26 -0500 Subject: [PATCH 22/42] Clean up formatting and a comment --- tools/travis_setup.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/travis_setup.sh b/tools/travis_setup.sh index c71e3d7a..67b0a046 100755 --- a/tools/travis_setup.sh +++ b/tools/travis_setup.sh @@ -6,11 +6,11 @@ pip uninstall -y numpy # 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 +if [[ $TRAVIS_PYTHON_VERSION == 2.7* ]]; then sudo apt-get install python-scipy python-matplotlib pip install https://github.com/cython/cython/archive/0.19.2.tar.gz pip install https://github.com/networkx/networkx/archive/networkx-1.8.tar.gz fi -pip install -r requirements.txt $WHEELHOUSE +pip install -r requirements.txt $WHEELHOUSE python check_bento_build.py From d3172b33501bb6cbf8b8afad6c831991ac866d72 Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Fri, 10 Oct 2014 06:12:38 -0500 Subject: [PATCH 23/42] Keep consistent with calling convention --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index a2fe2e84..028796fa 100644 --- a/.travis.yml +++ b/.travis.yml @@ -21,7 +21,7 @@ before_install: - export WHEELHOUSE="--no-index --find-links=http://wheels.scikit-image.org/" - - ./tools/travis_setup.sh + - tools/travis_setup.sh install: - tools/header.py "Dependency versions" @@ -30,7 +30,7 @@ install: - python setup.py build_ext --inplace script: - - ./tools/travis_test.sh + - tools/travis_test.sh after_success: - coveralls From 5dbf433eef0aed66f087076637e4f399e686c0f5 Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Fri, 10 Oct 2014 06:13:26 -0500 Subject: [PATCH 24/42] Put the WHEELHOUSE as a global variable --- .travis.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 028796fa..75f259a0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,6 +7,9 @@ language: python +env: + WHEELHOUSE="--no-index --find-links=http://wheels.scikit-image.org/" + python: - 2.6 - "2.7_with_system_site_packages" @@ -19,8 +22,6 @@ before_install: - sh -e /etc/init.d/xvfb start - sudo apt-get update - - export WHEELHOUSE="--no-index --find-links=http://wheels.scikit-image.org/" - - tools/travis_setup.sh install: From 16f2393958a86603e62fa8a91b0748a473a46aed Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Fri, 10 Oct 2014 06:14:27 -0500 Subject: [PATCH 25/42] Put the other env variables up top as well --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 75f259a0..6c67cc17 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,6 +9,8 @@ language: python env: WHEELHOUSE="--no-index --find-links=http://wheels.scikit-image.org/" + PYTHONWARNINGS="all" + DISPLAY=:99.0 python: - 2.6 @@ -18,7 +20,6 @@ python: - 3.4 before_install: - - export DISPLAY=:99.0 - sh -e /etc/init.d/xvfb start - sudo apt-get update @@ -27,7 +28,6 @@ before_install: install: - tools/header.py "Dependency versions" - tools/build_versions.py - - export PYTHONWARNINGS=all - python setup.py build_ext --inplace script: From 2d4604a3cf71edb394293d04ed591bc2db81f0c5 Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Fri, 10 Oct 2014 06:16:49 -0500 Subject: [PATCH 26/42] Move dependency output to setup script --- .travis.yml | 3 --- tools/travis_setup.sh | 3 +++ 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 6c67cc17..f1ad920e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -22,12 +22,9 @@ python: before_install: - sh -e /etc/init.d/xvfb start - sudo apt-get update - - tools/travis_setup.sh install: - - tools/header.py "Dependency versions" - - tools/build_versions.py - python setup.py build_ext --inplace script: diff --git a/tools/travis_setup.sh b/tools/travis_setup.sh index 67b0a046..a542a0ec 100755 --- a/tools/travis_setup.sh +++ b/tools/travis_setup.sh @@ -14,3 +14,6 @@ fi pip install -r requirements.txt $WHEELHOUSE python check_bento_build.py + +tools/header.py "Dependency versions" +tools/build_versions.py From ef215de3a93e1bddf9ff9e56f46d753f51158bbf Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Fri, 10 Oct 2014 06:29:42 -0500 Subject: [PATCH 27/42] Install skimage so we do not have to fool with PYTHONPATH --- .travis.yml | 1 + tools/travis_test.sh | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index f1ad920e..c774db01 100644 --- a/.travis.yml +++ b/.travis.yml @@ -26,6 +26,7 @@ before_install: install: - python setup.py build_ext --inplace + - python setup.py install script: - tools/travis_test.sh diff --git a/tools/travis_test.sh b/tools/travis_test.sh index 5f062542..98275418 100755 --- a/tools/travis_test.sh +++ b/tools/travis_test.sh @@ -49,7 +49,6 @@ if [[ $TRAVIS_PYTHON_VERSION == 2.* ]]; then fi tools/header.py "Run doc examples" -PYTHONPATH="..":$PYTHONPATH for f in doc/examples/*.py; do python "$f"; if [ $? -ne 0 ]; then From 9c7cee33ab94215fa6aee0333909990236b545a6 Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Fri, 10 Oct 2014 06:30:57 -0500 Subject: [PATCH 28/42] Use a straight install --- .travis.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index c774db01..9a63850b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -25,7 +25,6 @@ before_install: - tools/travis_setup.sh install: - - python setup.py build_ext --inplace - python setup.py install script: From c52a42975d6e69006473e67b6739c0b6962c6fd0 Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Fri, 10 Oct 2014 06:33:52 -0500 Subject: [PATCH 29/42] Move env variable to before_install --- .travis.yml | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index 9a63850b..5659d255 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,11 +7,6 @@ language: python -env: - WHEELHOUSE="--no-index --find-links=http://wheels.scikit-image.org/" - PYTHONWARNINGS="all" - DISPLAY=:99.0 - python: - 2.6 - "2.7_with_system_site_packages" @@ -21,7 +16,10 @@ python: before_install: - sh -e /etc/init.d/xvfb start + - export DISPLAY=:99.0 - sudo apt-get update + - export WHEELHOUSE="--no-index --find-links=http://wheels.scikit-image.org/" + - export PYTHONWARNINGS="all" - tools/travis_setup.sh install: From 3a0f0ccb86fd9358303d25c3a9585dd4ddd210ba Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Fri, 10 Oct 2014 06:34:35 -0500 Subject: [PATCH 30/42] Add whitespace --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 5659d255..ae1d9425 100644 --- a/.travis.yml +++ b/.travis.yml @@ -18,6 +18,7 @@ before_install: - sh -e /etc/init.d/xvfb start - export DISPLAY=:99.0 - sudo apt-get update + - export WHEELHOUSE="--no-index --find-links=http://wheels.scikit-image.org/" - export PYTHONWARNINGS="all" - tools/travis_setup.sh From 0e3c8382f34a25eb9b6fb1b44122ade35b502c89 Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Fri, 10 Oct 2014 06:37:35 -0500 Subject: [PATCH 31/42] Remove whitespace --- tools/travis_test.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/travis_test.sh b/tools/travis_test.sh index 98275418..71e3ef03 100755 --- a/tools/travis_test.sh +++ b/tools/travis_test.sh @@ -31,13 +31,13 @@ echo 'backend : Agg' > $MPL_DIR/matplotlibrc echo 'backend.qt4 : '$MPL_QT_API >> $MPL_DIR/matplotlibrc # imread does NOT support py3.2 -if [[ $TRAVIS_PYTHON_VERSION != 3.2 ]]; then +if [[ $TRAVIS_PYTHON_VERSION != 3.2 ]]; then sudo apt-get install -q libtiff4-dev libwebp-dev libpng12-dev xcftools pip install imread fi # TODO: update when SimpleITK become available on py34 or hopefully pip -if [[ $TRAVIS_PYTHON_VERSION != 3.4 ]]; then +if [[ $TRAVIS_PYTHON_VERSION != 3.4 ]]; then easy_install SimpleITK fi From 095160f1c63327d25cd0f5c98c56f79b869f66cf Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Fri, 10 Oct 2014 07:12:38 -0500 Subject: [PATCH 32/42] Reinstate the separate build step --- .travis.yml | 1 + tools/travis_test.sh | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index ae1d9425..ac551dc5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -24,6 +24,7 @@ before_install: - tools/travis_setup.sh install: + - python setup.py build_ext --inplace - python setup.py install script: diff --git a/tools/travis_test.sh b/tools/travis_test.sh index 71e3ef03..8af29582 100755 --- a/tools/travis_test.sh +++ b/tools/travis_test.sh @@ -20,7 +20,7 @@ else pip install PySide $WHEELHOUSE python ~/virtualenv/python${TRAVIS_PYTHON_VERSION}/bin/pyside_postinstall.py -install MPL_QT_API=PySide - export QT_API=PySide + export QT_API=pyside fi # Matplotlib settings - must be after we install Pyside From 53892e215366d39228a793a621289c242e5c167e Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Fri, 10 Oct 2014 09:01:18 -0500 Subject: [PATCH 33/42] Move the rest of the code to the scripts. --- .travis.yml | 6 ------ tools/travis_setup.sh | 5 +++++ tools/travis_test.sh | 4 ++++ 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index ac551dc5..2b6451ca 100644 --- a/.travis.yml +++ b/.travis.yml @@ -15,12 +15,6 @@ python: - 3.4 before_install: - - sh -e /etc/init.d/xvfb start - - export DISPLAY=:99.0 - - sudo apt-get update - - - export WHEELHOUSE="--no-index --find-links=http://wheels.scikit-image.org/" - - export PYTHONWARNINGS="all" - tools/travis_setup.sh install: diff --git a/tools/travis_setup.sh b/tools/travis_setup.sh index a542a0ec..f7602aef 100755 --- a/tools/travis_setup.sh +++ b/tools/travis_setup.sh @@ -1,6 +1,11 @@ #!/usr/bin/env bash set -ex +sh -e /etc/init.d/xvfb start +sudo apt-get update + +WHEELHOUSE="--no-index --find-links=http://wheels.scikit-image.org/" + pip install wheel flake8 coveralls nose pip uninstall -y numpy diff --git a/tools/travis_test.sh b/tools/travis_test.sh index 8af29582..62cfe948 100755 --- a/tools/travis_test.sh +++ b/tools/travis_test.sh @@ -1,6 +1,10 @@ #!/usr/bin/env bash set -ex +export DISPLAY=:99.0 +export PYTHONWARNINGS="all" +WHEELHOUSE="--no-index --find-links=http://wheels.scikit-image.org/" + tools/header.py "Run all tests with minimum dependencies" nosetests --exe -v skimage From b37913d63c7853539c1f19c130df78598203a0df Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Fri, 10 Oct 2014 11:28:33 -0500 Subject: [PATCH 34/42] Use a null backend during the doc examples --- tools/travis_test.sh | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/tools/travis_test.sh b/tools/travis_test.sh index 62cfe948..25245ee2 100755 --- a/tools/travis_test.sh +++ b/tools/travis_test.sh @@ -27,13 +27,6 @@ else export QT_API=pyside fi -# Matplotlib settings - must be after we install Pyside -MPL_DIR=$HOME/.config/matplotlib -mkdir -p $MPL_DIR -touch $MPL_DIR/matplotlibrc -echo 'backend : Agg' > $MPL_DIR/matplotlibrc -echo 'backend.qt4 : '$MPL_QT_API >> $MPL_DIR/matplotlibrc - # imread does NOT support py3.2 if [[ $TRAVIS_PYTHON_VERSION != 3.2 ]]; then sudo apt-get install -q libtiff4-dev libwebp-dev libpng12-dev xcftools @@ -52,6 +45,13 @@ if [[ $TRAVIS_PYTHON_VERSION == 2.* ]]; then pip install pyamg fi +# Matplotlib settings - do not show figures during doc examples +MPL_DIR=$HOME/.config/matplotlib +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"; @@ -67,6 +67,11 @@ for f in doc/examples/applications/*.py; do fi done +# 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" # run tests again with optional dependencies to get more coverage if [[ $TRAVIS_PYTHON_VERSION == 3.3 ]]; then From f5b30bf86750115922eaa9744053ce0b4cff0488 Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Fri, 10 Oct 2014 20:15:33 -0500 Subject: [PATCH 35/42] Formatting --- tools/travis_test.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/travis_test.sh b/tools/travis_test.sh index 25245ee2..6ed95049 100755 --- a/tools/travis_test.sh +++ b/tools/travis_test.sh @@ -54,16 +54,16 @@ echo 'backend : Template' > $MPL_DIR/matplotlibrc tools/header.py "Run doc examples" for f in doc/examples/*.py; do - python "$f"; + python "$f" if [ $? -ne 0 ]; then - exit 1; + exit 1 fi done for f in doc/examples/applications/*.py; do - python "$f"; + python "$f" if [ $? -ne 0 ]; then - exit 1; + exit 1 fi done From 283e759b378ec4cf8eca388e1fbfc93b380b4501 Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Fri, 10 Oct 2014 22:07:04 -0500 Subject: [PATCH 36/42] Matplotlibrc was in a different location in mpl 1.1.1 --- tools/travis_test.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/travis_test.sh b/tools/travis_test.sh index 6ed95049..c3e14423 100755 --- a/tools/travis_test.sh +++ b/tools/travis_test.sh @@ -17,6 +17,7 @@ tools/header.py "Install optional dependencies" if [[ $TRAVIS_PYTHON_VERSION == 2.7* ]]; then sudo apt-get install -q python-qt4 MPL_QT_API=PyQt4 + MPL_DIR=$HOME/.matplotlibrc export QT_API=pyqt else @@ -24,6 +25,7 @@ else pip install PySide $WHEELHOUSE python ~/virtualenv/python${TRAVIS_PYTHON_VERSION}/bin/pyside_postinstall.py -install MPL_QT_API=PySide + MPL_DIR=$HOME/.config/matplotlibrc export QT_API=pyside fi @@ -46,7 +48,6 @@ if [[ $TRAVIS_PYTHON_VERSION == 2.* ]]; then fi # Matplotlib settings - do not show figures during doc examples -MPL_DIR=$HOME/.config/matplotlib mkdir -p $MPL_DIR touch $MPL_DIR/matplotlibrc echo 'backend : Template' > $MPL_DIR/matplotlibrc From 3b63e19412f9aa1e4b20cd0285bb810561cd356e Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Sat, 11 Oct 2014 04:37:00 -0500 Subject: [PATCH 37/42] Fix MPL_DIR location --- tools/travis_test.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/travis_test.sh b/tools/travis_test.sh index c3e14423..df3a484d 100755 --- a/tools/travis_test.sh +++ b/tools/travis_test.sh @@ -17,7 +17,7 @@ tools/header.py "Install optional dependencies" if [[ $TRAVIS_PYTHON_VERSION == 2.7* ]]; then sudo apt-get install -q python-qt4 MPL_QT_API=PyQt4 - MPL_DIR=$HOME/.matplotlibrc + MPL_DIR=$HOME/.matplotlib export QT_API=pyqt else @@ -25,7 +25,7 @@ else pip install PySide $WHEELHOUSE python ~/virtualenv/python${TRAVIS_PYTHON_VERSION}/bin/pyside_postinstall.py -install MPL_QT_API=PySide - MPL_DIR=$HOME/.config/matplotlibrc + MPL_DIR=$HOME/.config/matplotlib export QT_API=pyside fi From 0c35d132032d23cc9b4b2a18119eb9fda1179aa9 Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Sat, 11 Oct 2014 05:12:04 -0500 Subject: [PATCH 38/42] Add a try/catch for RectangleTool.disconnect_events --- skimage/viewer/canvastools/recttool.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/skimage/viewer/canvastools/recttool.py b/skimage/viewer/canvastools/recttool.py index 5d658533..25b6df88 100644 --- a/skimage/viewer/canvastools/recttool.py +++ b/skimage/viewer/canvastools/recttool.py @@ -50,7 +50,10 @@ class RectangleTool(CanvasToolBase, RectangleSelector): props['edgecolor'] = props['facecolor'] RectangleSelector.__init__(self, self.ax, lambda *args: None, rectprops=props) - self.disconnect_events() # events are handled by the viewer + try: + self.disconnect_events() # events are handled by the viewer + except AttributeError: + pass # older versions of MPL do not have this method # Alias rectangle attribute, which is initialized in RectangleSelector. self._rect = self.to_draw self._rect.set_animated(True) From 532e46017240701d481ae85a4285778ec232bb39 Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Sat, 11 Oct 2014 07:21:32 -0500 Subject: [PATCH 39/42] Disconnect the events manually --- skimage/viewer/canvastools/recttool.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/skimage/viewer/canvastools/recttool.py b/skimage/viewer/canvastools/recttool.py index 25b6df88..fcd10aca 100644 --- a/skimage/viewer/canvastools/recttool.py +++ b/skimage/viewer/canvastools/recttool.py @@ -50,10 +50,10 @@ class RectangleTool(CanvasToolBase, RectangleSelector): props['edgecolor'] = props['facecolor'] RectangleSelector.__init__(self, self.ax, lambda *args: None, rectprops=props) - try: - self.disconnect_events() # events are handled by the viewer - except AttributeError: - pass # older versions of MPL do not have this method + # Events are handled by the viewer + for c in self.cids: + self.canvas.mpl_disconnect(c) + # Alias rectangle attribute, which is initialized in RectangleSelector. self._rect = self.to_draw self._rect.set_animated(True) From 72292f73c0a77a4489b9889f86b8e32d4270cb30 Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Sat, 11 Oct 2014 09:15:10 -0500 Subject: [PATCH 40/42] Use a manual hack to remove the canvas events for old MPL --- skimage/viewer/canvastools/recttool.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/skimage/viewer/canvastools/recttool.py b/skimage/viewer/canvastools/recttool.py index fcd10aca..ce81c38d 100644 --- a/skimage/viewer/canvastools/recttool.py +++ b/skimage/viewer/canvastools/recttool.py @@ -51,8 +51,11 @@ class RectangleTool(CanvasToolBase, RectangleSelector): RectangleSelector.__init__(self, self.ax, lambda *args: None, rectprops=props) # Events are handled by the viewer - for c in self.cids: - self.canvas.mpl_disconnect(c) + try: + self.disconnect_events() + except AttributeError: + # disconnect the events manually (hack for older mpl verions) + [self.canvas.mpl_disconnect(i) for i in range(5)] # Alias rectangle attribute, which is initialized in RectangleSelector. self._rect = self.to_draw From 725c376d78d7d8e6a7c49e1352ada7864f1c5c92 Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Sat, 11 Oct 2014 14:34:55 -0500 Subject: [PATCH 41/42] Make sure we disconnect all the signals --- skimage/viewer/canvastools/recttool.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/skimage/viewer/canvastools/recttool.py b/skimage/viewer/canvastools/recttool.py index ce81c38d..41e9ab1e 100644 --- a/skimage/viewer/canvastools/recttool.py +++ b/skimage/viewer/canvastools/recttool.py @@ -55,7 +55,7 @@ class RectangleTool(CanvasToolBase, RectangleSelector): self.disconnect_events() except AttributeError: # disconnect the events manually (hack for older mpl verions) - [self.canvas.mpl_disconnect(i) for i in range(5)] + [self.canvas.mpl_disconnect(i) for i in range(10)] # Alias rectangle attribute, which is initialized in RectangleSelector. self._rect = self.to_draw From 0fabb0c3ab45fd805a6d623979b0cb8b96e75d02 Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Sat, 11 Oct 2014 18:28:36 -0500 Subject: [PATCH 42/42] Fix comment typo --- skimage/viewer/canvastools/recttool.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/skimage/viewer/canvastools/recttool.py b/skimage/viewer/canvastools/recttool.py index 41e9ab1e..8932e180 100644 --- a/skimage/viewer/canvastools/recttool.py +++ b/skimage/viewer/canvastools/recttool.py @@ -54,7 +54,7 @@ class RectangleTool(CanvasToolBase, RectangleSelector): try: self.disconnect_events() except AttributeError: - # disconnect the events manually (hack for older mpl verions) + # disconnect the events manually (hack for older mpl versions) [self.canvas.mpl_disconnect(i) for i in range(10)] # Alias rectangle attribute, which is initialized in RectangleSelector.