mirror of
https://github.com/wassname/scikit-image.git
synced 2026-07-30 12:31:08 +08:00
Break script into parts and travis_retry optional installs
This commit is contained in:
+10
@@ -15,6 +15,9 @@ python:
|
||||
- 3.4
|
||||
|
||||
before_install:
|
||||
- export DISPLAY=:99.0
|
||||
- export PYTHONWARNINGS="all"
|
||||
- export WHEELHOUSE="--no-index --find-links=http://wheels.scikit-image.org/"
|
||||
- travis_retry tools/travis_setup.sh
|
||||
|
||||
install:
|
||||
@@ -22,6 +25,13 @@ install:
|
||||
- python setup.py install
|
||||
|
||||
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 tools/travis_install_optional.sh
|
||||
- tools/travis_test.sh
|
||||
|
||||
after_success:
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
#!/usr/bin/env bash
|
||||
set -ex
|
||||
|
||||
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
|
||||
MPL_QT_API=PyQt4
|
||||
MPL_DIR=$HOME/.matplotlib
|
||||
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
|
||||
MPL_QT_API=PySide
|
||||
MPL_DIR=$HOME/.config/matplotlib
|
||||
export QT_API=pyside
|
||||
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 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
|
||||
@@ -4,8 +4,6 @@ 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
|
||||
|
||||
|
||||
@@ -1,74 +1,6 @@
|
||||
#!/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
|
||||
|
||||
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"
|
||||
|
||||
# http://unix.stackexchange.com/a/82615
|
||||
function retry()
|
||||
{
|
||||
local n=0
|
||||
local try=$3
|
||||
local cmd="${@: 1}"
|
||||
[[ $# -le 1 ]] && {
|
||||
echo "Usage $0 <Command>"; }
|
||||
|
||||
until [[ $n -ge $try ]]
|
||||
do
|
||||
$cmd && break || {
|
||||
echo "Command Fail.."
|
||||
((n++))
|
||||
echo "retry $n ::"
|
||||
sleep 1;
|
||||
}
|
||||
|
||||
done
|
||||
}
|
||||
|
||||
# Install Qt and then update the Matplotlib settings
|
||||
if [[ $TRAVIS_PYTHON_VERSION == 2.7* ]]; then
|
||||
retry sudo apt-get install -q python-qt4
|
||||
MPL_QT_API=PyQt4
|
||||
MPL_DIR=$HOME/.matplotlib
|
||||
export QT_API=pyqt
|
||||
|
||||
else
|
||||
retry sudo apt-get install -q libqt4-dev
|
||||
retry pip install PySide $WHEELHOUSE
|
||||
retry python ~/virtualenv/python${TRAVIS_PYTHON_VERSION}/bin/pyside_postinstall.py -install
|
||||
MPL_QT_API=PySide
|
||||
MPL_DIR=$HOME/.config/matplotlib
|
||||
export QT_API=pyside
|
||||
fi
|
||||
|
||||
# imread does NOT support py3.2
|
||||
if [[ $TRAVIS_PYTHON_VERSION != 3.2 ]]; then
|
||||
retry sudo apt-get install -q libtiff4-dev libwebp-dev libpng12-dev xcftools
|
||||
retry pip install imread
|
||||
fi
|
||||
|
||||
# TODO: update when SimpleITK become available on py34 or hopefully pip
|
||||
if [[ $TRAVIS_PYTHON_VERSION != 3.4 ]]; then
|
||||
retry easy_install SimpleITK
|
||||
fi
|
||||
|
||||
retry sudo apt-get install libfreeimage3
|
||||
retry pip install astropy
|
||||
|
||||
if [[ $TRAVIS_PYTHON_VERSION == 2.* ]]; then
|
||||
retry pip install pyamg
|
||||
fi
|
||||
|
||||
# Matplotlib settings - do not show figures during doc examples
|
||||
mkdir -p $MPL_DIR
|
||||
touch $MPL_DIR/matplotlibrc
|
||||
|
||||
Reference in New Issue
Block a user