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