forked from scikit-image/scikit-image
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtravis_before_install.sh
executable file
·78 lines (61 loc) · 1.79 KB
/
travis_before_install.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
#!/usr/bin/env bash
set -ex
export COVERALLS_REPO_TOKEN=7LdFN9232ZbSY3oaXHbQIzLazrSf6w2pQ
export PIP_DEFAULT_TIMEOUT=60
if [[ "$TRAVIS_OS_NAME" != "osx" ]]; then
sh -e /etc/init.d/xvfb start
export WHEELHOUSE="--no-index --trusted-host travis-wheels.scikit-image.org \
--find-links=http://travis-wheels.scikit-image.org/"
fi
export DISPLAY=:99.0
export PYTHONWARNINGS="d,all:::skimage"
export TEST_ARGS="--exe --ignore-files=^_test -v --with-doctest \
--ignore-files=^setup.py$"
WHEELBINARIES="matplotlib scipy pillow cython"
retry () {
# https://gist.github.com/fungusakafungus/1026804
local retry_max=3
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
}
# add build dependencies
echo "cython>=0.23.4" >> requirements.txt
echo "numpydoc>=0.6" >> requirements.txt
if [[ $MINIMUM_REQUIREMENTS == 1 ]]; then
sed -i 's/>=/==/g' requirements.txt
fi
# create new empty venv
virtualenv -p python ~/venv
source ~/venv/bin/activate
pip install --upgrade pip
pip install --retries 3 -q wheel flake8 codecov nose
# install numpy from PyPI instead of our wheelhouse
pip install --retries 3 -q wheel numpy
# install wheels
for requirement in $WHEELBINARIES; do
WHEELS="$WHEELS $(grep $requirement requirements.txt)"
done
pip install --retries 3 -q $PIP_FLAGS $WHEELHOUSE $WHEELS
pip install --retries 3 -q $PIP_FLAGS -r requirements.txt
# Show what's installed
pip list
section () {
echo -en "travis_fold:start:$1\r"
tools/header.py $1
}
section_end () {
echo -en "travis_fold:end:$1\r"
}
export -f section
export -f section_end
export -f retry
set +ex