Switch to a single script to get the folds to work

Switch to a single script to get the folds to work

Replace the old install_min with this before_install script

Reinstate optional installs and add headers

move the display setup to the travis_script

Use force remove on temp directory

Always retry on pip

Fix the travis_retry pip alias

Source the before_install script and move the alias

Create bash functions for folding and export DISPLAY

Export fold functions

Make repip a function
This commit is contained in:
Steven Silvester
2014-12-14 12:26:13 -06:00
parent b9a02e0957
commit 0b4884a361
6 changed files with 142 additions and 140 deletions
+2 -13
View File
@@ -23,18 +23,10 @@ python:
- 3.4
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$"
- source tools/travis_before_install.sh
- travis_retry tools/travis_install_min.sh
- source ~/venv/bin/activate
- which python; python --version
- python check_bento_build.py
- tools/build_versions.py
@@ -42,10 +34,7 @@ install:
- python setup.py build_ext --inplace
- python setup.py install
script:
- travis_retry tools/travis_test_min.sh
- travis_retry tools/travis_install_all.sh
- travis_retry tools/travis_test_all.sh
script: tools/travis_script.sh
after_success:
- coveralls
@@ -1,7 +1,12 @@
#!/usr/bin/env bash
set -ex
echo -en "travis_fold:start:install.all\r"
export WHEELHOUSE="--no-index --find-links=http://travis-wheels.scikit-image.org/"
repip () {
travis_retry pip $@
}
# on Python 2.7, use the system versions of numpy, scipy, and matplotlib
# and the minimum version of cython and networkx
@@ -15,7 +20,7 @@ else
fi
source ~/venv/bin/activate
pip install wheel flake8 coveralls nose
repip install wheel flake8 coveralls nose
# install system tk for matplotlib
sudo apt-get install python-tk
@@ -26,10 +31,21 @@ if [[ $TRAVIS_PYTHON_VERSION == 2.7* ]]; then
sed -i 's/matplotlib>=*.*.*/matplotlib==1.3.1/g' requirements.txt
fi
pip install $WHEELHOUSE -r requirements.txt
repip install $WHEELHOUSE -r requirements.txt
# clean up disk space
sudo apt-get clean
sudo rm -r /tmp/*
sudo rm -rf /tmp/*
echo -en "travis_fold:end:install.all\r"
fold_start () {
echo -en "travis_fold:start:$1\r"
}
fold_end () {
echo -en "travis_fold:end:$1\r"
}
export -f fold_start
export -f fold_end
export -f repip
-72
View File
@@ -1,72 +0,0 @@
#!/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
if [[ $TRAVIS_PYTHON_VERSION == 2.7* ]]; then
sudo apt-get install -q python-qt4
# http://stackoverflow.com/a/9716100
LIBS=( PyQt4 sip.so )
VAR=( $(which -a python$TRAVIS_PYTHON_VERSION) )
GET_PYTHON_LIB_CMD="from distutils.sysconfig import get_python_lib; print (get_python_lib())"
LIB_VIRTUALENV_PATH=$(python -c "$GET_PYTHON_LIB_CMD")
LIB_SYSTEM_PATH=$(${VAR[-1]} -c "$GET_PYTHON_LIB_CMD")
for LIB in ${LIBS[@]}
do
sudo ln -sf $LIB_SYSTEM_PATH/$LIB $LIB_VIRTUALENV_PATH/$LIB
done
else
sudo apt-get install -q libqt4-dev
pip install -q PySide $WHEELHOUSE
python ~/venv/bin/pyside_postinstall.py -install
fi
# 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 -q imread
fi
# Install SimpleITK from wheelhouse if available (not 3.2 or 3.4)
if [[ $TRAVIS_PYTHON_VERSION =~ 3\.[24] ]]; then
echo "SimpleITK unavailable on $TRAVIS_PYTHON_VERSION"
else
pip install -q SimpleITK $WHEELHOUSE
fi
sudo apt-get install -q libfreeimage3
pip install -q astropy $WHEELHOUSE
if [[ $TRAVIS_PYTHON_VERSION == 2.* ]]; then
pip install -q pyamg
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"
+118
View File
@@ -0,0 +1,118 @@
#!/usr/bin/env bash
set -ex
fold_start "script.setup"
sh -e /etc/init.d/xvfb start
export DISPLAY=:99.0
PYTHONWARNINGS="all"
TEST_ARGS="--exe --ignore-files=^_test -v --with-doctest --ignore-files=^setup.py$"
fold_end "script.setup"
fold_start "test.min"
tools/header.py "Test with min requirements"
nosetests $TEST_ARGS skimage
fold_end "test.min"
fold_start "test.flake8"
tools/header.py "Flake8 test"
flake8 --exit-zero --exclude=test_*,six.py skimage doc/examples viewer_examples
fold_end "test.flake8"
fold_start "install.all"
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
# http://stackoverflow.com/a/9716100
LIBS=( PyQt4 sip.so )
VAR=( $(which -a python$TRAVIS_PYTHON_VERSION) )
GET_PYTHON_LIB_CMD="from distutils.sysconfig import get_python_lib; print (get_python_lib())"
LIB_VIRTUALENV_PATH=$(python -c "$GET_PYTHON_LIB_CMD")
LIB_SYSTEM_PATH=$(${VAR[-1]} -c "$GET_PYTHON_LIB_CMD")
for LIB in ${LIBS[@]}
do
sudo ln -sf $LIB_SYSTEM_PATH/$LIB $LIB_VIRTUALENV_PATH/$LIB
done
else
sudo apt-get install -q libqt4-dev
repip install -q PySide $WHEELHOUSE
python ~/venv/bin/pyside_postinstall.py -install
fi
# 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
repip install -q imread
fi
# Install SimpleITK from wheelhouse if available (not 3.2 or 3.4)
if [[ $TRAVIS_PYTHON_VERSION =~ 3\.[24] ]]; then
echo "SimpleITK unavailable on $TRAVIS_PYTHON_VERSION"
else
repip install -q SimpleITK $WHEELHOUSE
fi
sudo apt-get install -q libfreeimage3
repip install -q astropy $WHEELHOUSE
if [[ $TRAVIS_PYTHON_VERSION == 2.* ]]; then
repip install -q pyamg
fi
repip install -q tifffile
fold_end "install.all"
fold_start "doc.examples"
tools/header.py "Run doc examples"
for f in doc/examples/*.py; do
python "$f"
if [ $? -ne 0 ]; then
exit 1
fi
done
fold_end "doc.examples"
fold_start "doc.applications"
tools/header.py "Run doc applications"
for f in doc/examples/applications/*.py; do
python "$f"
if [ $? -ne 0 ]; then
exit 1
fi
done
# Now configure Matplotlib to use Qt4
echo 'backend: Agg' > $MPL_DIR/matplotlibrc
echo 'backend.qt4 : '$MPL_QT_API >> $MPL_DIR/matplotlibrc
fold_end "doc.applications"
fold_start "test.all"
tools/header.py "Test with optional 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
fold_end "test.all"
-39
View File
@@ -1,39 +0,0 @@
#!/usr/bin/env bash
set -ex
echo -en "travis_fold:start:doc.examples\r"
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
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
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"
-10
View File
@@ -1,10 +0,0 @@
#!/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"