Skip to content

Commit 7f9fb69

Browse files
committed
Merge pull request matplotlib#4435 from matthew-brett/travis-wheels
TST: use travis wheels for dependencies
2 parents aac0a33 + 5980255 commit 7f9fb69

File tree

2 files changed

+39
-1
lines changed

2 files changed

+39
-1
lines changed

.travis.yml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,21 @@ matrix:
4747
allow_failures:
4848
- python : "nightly"
4949

50+
before_install:
51+
- source tools/travis_tools.sh
52+
# Install into our own pristine virtualenv
53+
- virtualenv --python=python venv
54+
- source venv/bin/activate
55+
5056
install:
51-
- pip install $PRE nose python-dateutil $NUMPY pep8 pyparsing pillow sphinx!=1.3.0
57+
# Install only from travis wheelhouse
58+
- if [ -z "$PRE" ]; then
59+
wheelhouse_pip_install python-dateutil $NUMPY pyparsing pillow sphinx!=1.3.0;
60+
else
61+
pip install $PRE python-dateutil $NUMPY pyparsing pillow sphinx!=1.3.0;
62+
fi
63+
# Always install from pypi
64+
- pip install $PRE nose pep8
5265

5366
# We manually install humor sans using the package from Ubuntu 14.10. Unfortunatly humor sans is not
5467
# availible in the Ubuntu version used by Travis but we can manually install the deb from a later

tools/travis_tools.sh

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Tools for working with travis-ci
2+
export WHEELHOUSE="http://travis-wheels.scikit-image.org/"
3+
4+
retry () {
5+
# https://gist.github.com/fungusakafungus/1026804
6+
local retry_max=5
7+
local count=$retry_max
8+
while [ $count -gt 0 ]; do
9+
"$@" && break
10+
count=$(($count - 1))
11+
sleep 1
12+
done
13+
14+
[ $count -eq 0 ] && {
15+
echo "Retry failed [$retry_max]: $@" >&2
16+
return 1
17+
}
18+
return 0
19+
}
20+
21+
22+
wheelhouse_pip_install() {
23+
# Install pip requirements via travis wheelhouse
24+
retry pip install --timeout=60 --no-index --find-links $WHEELHOUSE $@
25+
}

0 commit comments

Comments
 (0)