forked from pybamm-team/PyBaMM
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
233 lines (224 loc) · 7.02 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
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
sudo: false
dist: xenial
language: python
addons:
apt:
sources:
- deadsnakes
packages:
- gfortran
- gcc
- libopenblas-dev
- liblapack-dev
- graphviz
matrix:
include:
# Unit and example testing on all supported Python versions on Ubuntu
- python: "3.6"
addons:
apt:
sources:
- deadsnakes
packages:
- gfortran
- gcc
- libopenblas-dev
- liblapack-dev
- graphviz
- python3.6-dev
env:
- PYBAMM_UNIT=true
- PYBAMM_EXAMPLES=true
- PYBAMM_SCIKITS_ODES=true
- PYBAMM_KLU=true
- python: "3.7"
addons:
apt:
sources:
- deadsnakes
packages:
- gfortran
- gcc
- libopenblas-dev
- liblapack-dev
- graphviz
- python3.7-dev
env:
- PYBAMM_UNIT=true
- PYBAMM_EXAMPLES=true
- PYBAMM_SCIKITS_ODES=true
- PYBAMM_KLU=true
if: type != cron
# Unit testing on Python3.7 on OS/X and Ubuntu
- os: osx
language: generic
env:
- PYTHON=3.7.4
- PYBAMM_UNIT=true
- PYBAMM_KLU=true
if: type != cron
- python: "3.7"
addons:
apt:
sources:
- deadsnakes
packages:
- gfortran
- gcc
- libopenblas-dev
- liblapack-dev
- graphviz
- python3.7-dev
env:
- PYBAMM_UNIT=true
- PYBAMM_SCIKITS_ODES=true
- PYBAMM_KLU=true
# Unit and example testing on Python3.7 on Ubuntu without optional dependencies
- python: "3.7"
addons:
apt:
sources:
- deadsnakes
packages:
- gfortran
- gcc
- libopenblas-dev
- liblapack-dev
- graphviz
- python3.7-dev
env:
- PYBAMM_UNIT=true
- PYBAMM_EXAMPLES=true
if: type != cron
# Cover, docs and style checking, latest Python version only
- python: "3.7"
addons:
apt:
sources:
- deadsnakes
packages:
- gfortran
- gcc
- libopenblas-dev
- liblapack-dev
- graphviz
- python3.7-dev
env:
- PYBAMM_COVER=true
- PYBAMM_SCIKITS_ODES=true
- PYBAMM_KLU=true
if: type != cron
- python: "3.7"
addons:
apt:
sources:
- deadsnakes
packages:
- gfortran
- gcc
- libopenblas-dev
- liblapack-dev
- graphviz
- python3.7-dev
env:
- PYBAMM_DOCS=true
if: type != cron
- python: "3.7"
addons:
apt:
sources:
- deadsnakes
packages:
- gfortran
- gcc
- libopenblas-dev
- liblapack-dev
- graphviz
- python3.7-dev
env:
- PYBAMM_STYLE=true
if: type != cron
# Cron jobs
- python: "3.7"
addons:
apt:
sources:
- deadsnakes
packages:
- gfortran
- gcc
- libopenblas-dev
- liblapack-dev
- graphviz
- python3.7-dev
env:
- PYBAMM_UNIT=true
- PYBAMM_EXAMPLES=true
- PYBAMM_SCIKITS_ODES=true
- PYBAMM_KLU=true
if: type == cron
# Install graphviz for macs
before_install: |
# below is reproduced from https://pythonhosted.org/CodeChat/.travis.yml.html
if [[ $TRAVIS_OS_NAME == "osx" ]]; then
brew update;
# Per the `pyenv homebrew recommendations <https://github.com/yyuu/pyenv/wiki#suggested-build-environment>`_.
brew install graphviz openssl readline;
# Other brew packages
brew install gcc cmake openblas suitesparse;
# See https://docs.travis-ci.com/user/osx-ci-environment/#A-note-on-upgrading-packages.
brew outdated pyenv || brew upgrade pyenv
# virtualenv doesn't work without pyenv knowledge. venv in Python 3.3
# doesn't provide Pip by default. So, use `pyenv-virtualenv <https://github.com/yyuu/pyenv-virtualenv/blob/master/README.md>`_.
brew install pyenv-virtualenv
pyenv install $PYTHON;
# I would expect something like ``pyenv init; pyenv local $PYTHON`` or
# ``pyenv shell $PYTHON`` would work, but ``pyenv init`` doesn't seem to
# modify the Bash environment. ??? So, I hand-set the variables instead.
export PYENV_VERSION=$PYTHON;
export PATH="/Users/travis/.pyenv/shims:${PATH}";
pyenv virtualenv venv;
source venv/bin/activate;
# A manual check that the correct version of Python is running.
python --version;
pip install wheel;
fi
# Install dependencies
# Note: Use pip (not apt-get) for Python dependencies
# Note: Only install normal dependencies for unit tests; these should be tested
# without the packages from -dev and -doc!
install:
- pip install --upgrade pip
- pip install -e .
- if [[ $PYBAMM_DOCS == true ]]; then pip install -e .[docs]; fi;
- if [[ $PYBAMM_STYLE == true || $PYBAMM_EXAMPLES ]]; then pip install -e .[dev]; fi;
- if [[ $PYBAMM_COVER == true ]]; then pip install coverage codecov; fi;
- |
if [[ $PYBAMM_SCIKITS_ODES == true ]]; then
pip install wget;
pybamm_install_odes --install-sundials;
export LD_LIBRARY_PATH=scikits.odes/sundials5/lib:$LD_LIBRARY_PATH;
fi;
- |
if [[ $PYBAMM_KLU == true ]]; then
pip install wget
python scripts/setup_KLU_module_build.py
export LD_LIBRARY_PATH=$(HOME)/.local/lib:$LD_LIBRARY_PATH
rm -rf pybind11;
git clone https://github.com/pybind/pybind11.git;
pip install -e .
fi;
before_script:
- python --version
# Note that default timeout is 10 minutes
# This can be changed with travis_wait, but that leads to
# issues with debug output:
# https://github.com/travis-ci/travis-ci/issues/5716
script:
- if [[ $PYBAMM_UNIT == true ]]; then python run-tests.py --unit --folder all; fi;
- if [[ $PYBAMM_DOCS == true ]]; then python run-tests.py --doctest; fi;
- if [[ $PYBAMM_STYLE == true ]]; then python -m flake8; fi;
- if [[ $PYBAMM_COVER == true ]]; then coverage run run-tests.py --nosub; fi;
- if [[ $PYBAMM_EXAMPLES == true ]]; then travis_wait 120 python run-tests.py --examples; fi;
after_success:
- if [[ $PYBAMM_COVER == true ]]; then codecov; fi;