mirror of
https://github.com/wassname/scikit-image.git
synced 2026-07-10 23:41:29 +08:00
Use retries where applicable
This commit is contained in:
+1
-1
@@ -15,7 +15,7 @@ python:
|
||||
- 3.4
|
||||
|
||||
before_install:
|
||||
- tools/travis_setup.sh
|
||||
- travis_retry tools/travis_setup.sh
|
||||
|
||||
install:
|
||||
- python setup.py build_ext --inplace
|
||||
|
||||
+32
-10
@@ -1,6 +1,7 @@
|
||||
#!/usr/bin/env bash
|
||||
set -ex
|
||||
|
||||
|
||||
export DISPLAY=:99.0
|
||||
export PYTHONWARNINGS="all"
|
||||
WHEELHOUSE="--no-index --find-links=http://wheels.scikit-image.org/"
|
||||
@@ -13,17 +14,38 @@ 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
|
||||
sudo apt-get install -q python-qt4
|
||||
retry 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
|
||||
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
|
||||
@@ -31,20 +53,20 @@ 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
|
||||
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
|
||||
easy_install SimpleITK
|
||||
retry easy_install SimpleITK
|
||||
fi
|
||||
|
||||
sudo apt-get install libfreeimage3
|
||||
pip install astropy
|
||||
retry sudo apt-get install libfreeimage3
|
||||
retry pip install astropy
|
||||
|
||||
if [[ $TRAVIS_PYTHON_VERSION == 2.* ]]; then
|
||||
pip install pyamg
|
||||
retry pip install pyamg
|
||||
fi
|
||||
|
||||
# Matplotlib settings - do not show figures during doc examples
|
||||
|
||||
Reference in New Issue
Block a user