forked from obspy/obspy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
141 lines (134 loc) · 4.65 KB
/
.travis.yml
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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
language: c
matrix:
include:
# do one build run with our minimum dependencies
# (or, well, at least the lowest version number that is available through
# anaconda..)
- os: linux
env: PYTHON_VERSION=2.7 MINIMUM_DEPENDENCIES="True"
- os: linux
env: PYTHON_VERSION=2.7
- os: linux
env: PYTHON_VERSION=3.3
- os: linux
env: PYTHON_VERSION=3.4
- os: linux
env: PYTHON_VERSION=3.5
- os: osx
env: PYTHON_VERSION=2.7
- os: osx
env: PYTHON_VERSION=3.5
sudo: false
install:
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
export OS="MacOSX";
else
export OS="Linux";
fi
- if [[ "${PYTHON_VERSION:0:1}" == '2' ]]; then
wget https://repo.continuum.io/miniconda/Miniconda-latest-${OS}-x86_64.sh -O miniconda.sh;
else
wget https://repo.continuum.io/miniconda/Miniconda3-latest-${OS}-x86_64.sh -O miniconda.sh;
fi
- bash miniconda.sh -b -p $HOME/miniconda
- export PATH="$HOME/miniconda/bin:$PATH"
- hash -r
- conda config --set always_yes yes --set changeps1 no
- conda update -q conda
# Useful for debugging any issues with conda
- conda info -a
- |
if [[ "$MINIMUM_DEPENDENCIES" == 'True' ]]; then
NUMPY_VERSION=1.6.2
SCIPY_VERSION=0.11.0
MPL_VERSION=1.1.1
# no basemap version works with this old numpy, so leave out
BASEMAP=""
# ancient matplotlib needs to be turned to AGG before anything else,
# otherwise it tries to import incompatible version of Qt as a backend
# and hick-ups..
mkdir -p $HOME/.matplotlib
echo 'backend:AGG' > $HOME/.matplotlib/matplotlibrc
elif [[ "${PYTHON_VERSION:0:1}" == '3' ]]; then
NUMPY_VERSION=1.9.2
SCIPY_VERSION=0.16.0
MPL_VERSION=1.4.3
BASEMAP="basemap=1.0.7"
else
NUMPY_VERSION=1.8.2
SCIPY_VERSION=0.14.0
MPL_VERSION=1.3.1
BASEMAP="basemap=1.0.7"
fi
- conda create -q -n test-environment
python=$PYTHON_VERSION
numpy=$NUMPY_VERSION
scipy=$SCIPY_VERSION
matplotlib=$MPL_VERSION
$BASEMAP
flake8
future
lxml
decorator
sqlalchemy
mock
nose
gdal
pyproj
docopt
coverage
requests
- source activate test-environment
# install packages not available via conda
- pip install coveralls
- pip install geographiclib
# current pyimgur stable release has a py3 incompatibility
- pip install https://github.com/megies/PyImgur/archive/py3.zip
- pip freeze
- conda list
# done installing dependencies
- git version
- git fetch origin --tags --unshallow
- git remote add obspy git://github.com/obspy/obspy.git
- git fetch obspy --tags
- git status
- git branch -vv
- git remote -vv
# try to set correct remote tracking branch (to get branch info in version number of reports at tests.obspy.org)
- |
if [ "$TRAVIS_PULL_REQUEST" != "false" ]
# we're building a pull request, so we need to find out the fork it's coming from through github API
then GITHUB_LABEL=`python -c "from urllib import urlopen; import json; print(json.loads(urlopen(\"https://api.github.com/repos/$TRAVIS_REPO_SLUG/pulls/$TRAVIS_PULL_REQUEST\").read()).get('head').get('label'))"`
export GITHUB_FORK=${GITHUB_LABEL%:*}
export GITHUB_REMOTE=${GITHUB_FORK}/obspy
export GITHUB_BRANCH=${GITHUB_LABEL#*:}
# we're building a branch on the main repo
else export GITHUB_REMOTE=$TRAVIS_REPO_SLUG
export GITHUB_BRANCH=$TRAVIS_BRANCH
export GITHUB_FORK=${TRAVIS_REPO_SLUG%/*}; fi \
&& echo "$GITHUB_REMOTE $GITHUB_FORK $GITHUB_BRANCH" \
&& if [ "$GITHUB_FORK" != "obspy" ]
then git remote add $GITHUB_FORK git://github.com/$GITHUB_REMOTE; fi \
&& git fetch $GITHUB_FORK +refs/heads/$GITHUB_BRANCH \
&& git checkout -b tested_branch \
&& git branch --set-upstream-to=$GITHUB_FORK/$GITHUB_BRANCH \
|| echo
- git branch -vv
- git remote -vv
- pip install --no-deps .
- git status
script:
# We change directories to make sure that python won't find the copy
# of obspy in the source directory, see
# https://github.com/numpy/numpy/blob/master/.travis.yml#L44
- mkdir empty
- cd empty
- MODULELIST=`python -c "from obspy.core.util import DEFAULT_MODULES as MODULES; print('obspy.' + ',obspy.'.join(MODULES))"`
- coverage run --rcfile=.coveragerc --source=$MODULELIST -m obspy.scripts.runtests -n travis-ci -r
after_success:
- mv .coverage ../.coverage.empty
- cd ..
- coverage combine
- coveralls
notifications:
email: false