Skip to content

Commit

Permalink
BF: add more robust travis installs
Browse files Browse the repository at this point in the history
Try a few times to install travis wheels before giving up.
  • Loading branch information
matthew-brett committed Dec 29, 2014
1 parent 2ed2c7d commit 172e55d
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 2 deletions.
5 changes: 3 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,13 @@ matrix:
env:
- DEPENDS="cython numpy scipy matplotlib h5py nibabel cvxopt scikit_learn"
before_install:
- source tools/travis_tools.sh
- virtualenv --python=python venv
- source venv/bin/activate
- python --version # just to check
- pip install nose # always
- retry pip install nose # always
- sudo apt-get install libblas-dev liblapack-dev libatlas3gf-base
- pip install --timeout=60 --no-index -f http://travis-wheels.scikit-image.org $DEPENDS
- wheelhouse_pip_install $DEPENDS
- if [ "${COVERAGE}" == "1" ]; then
pip install coverage;
pip install coveralls;
Expand Down
25 changes: 25 additions & 0 deletions tools/travis_tools.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Tools for working with travis-ci
export WHEELHOUSE="http://travis-wheels.scikit-image.org/"

retry () {
# https://gist.github.com/fungusakafungus/1026804
local retry_max=5
local count=$retry_max
while [ $count -gt 0 ]; do
"$@" && break
count=$(($count - 1))
sleep 1
done

[ $count -eq 0 ] && {
echo "Retry failed [$retry_max]: $@" >&2
return 1
}
return 0
}


wheelhouse_pip_install() {
# Install pip requirements via travis wheelhouse
retry pip install --no-index --find-links $WHEELHOUSE $@
}

0 comments on commit 172e55d

Please sign in to comment.