forked from astropy/astropy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
277 lines (237 loc) · 9.67 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
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
# We set the language to c because python isn't supported on the MacOS X nodes
# on Travis. However, the language ends up being irrelevant anyway, since we
# install Python ourselves using conda.
language: c
compiler: gcc
# Cache can be cleared from the travis settings menu, see docs currently at
# https://docs.travis-ci.com/user/caching#Clearing-Caches
cache:
- ccache
- .hypothesis
notifications:
slack:
on_success: always
on_failure: always
secure: gLrQgrHNqHs0lOPsfvjlh0v8k56mJifPNpht0BX55YV0n1u5alKCrKOVcKTFNFY0gOldhwFNFq4oy3o5EaZkDx+CO71qiwwJr7ex7zT70EjHzWxEG8l2Bww9J3xVzhGgQw6tMq57HHiuOoJ07TJPvVxL+E/WZmkxRAdlzUhcab4=
if: type = cron
os:
- linux
# We need a full clone to make sure setuptools_scm works properly
git:
depth: false
addons:
apt:
packages:
# We include the german language pack because we use the
# de_DE locale in some of the io.ascii tests.
- language-pack-de
# tzdata is included to ensure system leap seconds are up to date.
- tzdata
env:
global:
# Set defaults to avoid repeating in most cases
# By default, we run our jobs with tox.
- SETUP_METHOD='tox'
# The following three variables are for tox. TOXENV is a standard
# variable that tox uses to determine the environment to run,
# TOXARGS are arguments passed to tox, and TOXPOSARGS are arguments
# that tox passes through to the {posargs} indicator in tox.ini.
# The latter can be used for example to pass arguments to pytest.
- TOXENV='test'
- TOXARGS='-v'
- TOXPOSARGS=''
# For installing without tox, we can rely mostly on what Debian already
# includes. This is only used if SETUP_METHOD='apt'.
# Note that this also means it can be used to test whether astropy can
# properly use the system libraries, since the python3-astropy package
# pulls those in (i.e., one can and should use ASTROPY_USE_SYSTEM_ALL=1).
- APT_DEPENDENCIES="python3-pip python3-dev libpython3.8-dev python3.8-dev libexpat1-dev zlib1g-dev libc6-dev python3-venv python3-setuptools cython3 python3-astropy python3-numpy wcslib-dev libcfitsio-dev python3-pytest-astropy ipython3 python3-pytest-cov python3-pytest-xdist python3-objgraph python3-coverage python3-attr python3-colorama tzdata"
# The following is needed to avoid issues if e.g. Matplotlib tries
# to open a GUI window.
- SETUP_XVFB=True
stages:
# Do the style check and a single test job, don't proceed if it fails
- name: Initial tests
# Do the rest of the tests
- name: Comprehensive tests
- name: Final tests
- name: Cron tests
if: type = cron
matrix:
# Don't wait for allowed failures
fast_finish: true
include:
# Linux job with minimal dependencies
- language: python
python: 3.7
name: Python 3.7 with minimal dependencies
stage: Initial tests
env: TOXENV="py37-test"
# Try MacOS X.
- os: osx
name: Python 3.7 with all optional dependencies for OSX
stage: Cron tests
env: PYTHON_VERSION=3.7
TOXENV="py37-test-alldeps"
TOXPOSARGS="--remote-data=astropy"
CONDA_DEPENDENCIES="clang"
CCOMPILER=clang
# Try all python versions and Numpy versions. Since we can assume that
# the Numpy developers have taken care of testing Numpy with different
# versions of Python, we can vary Python and Numpy versions at the same
# time.
# For the Numpy 1.17 build we use oldestdeps not numpy117 since we can check
# the oldest version of all dependencies where this is known. We also check
# that tests do not open and leave open any files. This has a performance
# impact on running the tests, hence why it is not enabled by default.
- language: python
python: 3.6
stage: Comprehensive tests
name: Python 3.6 with oldest supported version of all dependencies
env: TOXENV="py36-test-oldestdeps"
TOXPOSARGS="--open-files"
# Now try with all optional dependencies.
- language: python
python: 3.8
dist: bionic
name: Python 3.8 with all optional dependencies
stage: Initial tests
env: TOXENV="py38-test-alldeps"
TOXARGS="-v --develop"
TOXPOSARGS="--durations=50"
compiler: clang
# Full tests with coverage checks.
- language: python
python: 3.7
stage: Comprehensive tests
name: Python 3.7 with numpy 1.17 and full coverage
env: TOXENV="py37-test-alldeps-numpy117-cov"
TOXPOSARGS="--remote-data=astropy"
LC_CTYPE=C.ascii LC_ALL=C
# Try on Windows
- os: windows
stage: Final tests
name: Python 3.7 with all optional dependencies
env: PYTHON_VERSION=3.7
TOXENV='py37-test-alldeps'
# Do a PEP8/pyflakes test with flake8
- language: python
python: 3.7
name: Code style checks
stage: Initial tests
env: TOXENV='codestyle'
# Try developer version of Numpy with optional dependencies and also
# run all remote tests. Since both cases will be potentially
# unstable, we combine them into a single unstable build that we can
# mark as an allowed failure below.
- language: python
python: 3.7
name: Python 3.7 with remote data and dev version of key dependencies
stage: Final tests
env: TOXENV="py37-test-devdeps"
TOXPOSARGS="--remote-data=any"
# We check numpy-dev also in a job that only runs from cron, so that
# we can spot issues sooner. We do not use remote data here, since
# that gives too many false positives due to URL timeouts.
# We also install all dependencies via pip here so we pick up the latest
# releases.
- language: python
python: 3.7
name: Python 3.7 with dev version of key dependencies
stage: Cron tests
env: TOXENV="py37-test-devdeps"
# Run documentation link check in a cron job.
# Was originally in CircleCI doc build but links are too flaky, so
# we moved it here instead.
- language: python
python: 3.7
name: Documentation link check
stage: Cron tests
env: TOXENV='linkcheck'
addons:
apt:
packages:
- graphviz
# Test against Python dev in cron job.
- language: python
python: 3.9-dev
dist: bionic
name: Python dev with basic dependencies
stage: Cron tests
env: TOXENV="pydev-test"
TOXPOSARGS="--durations=50"
compiler: clang
# Also regularly try the big-endian s390 architecture, in the
# process checking that installing dependencies with apt works.
- name: big-endian s390x architecture with apt
arch: s390x
language: c
dist: bionic
stage: Cron tests
env: SETUP_METHOD='apt'
ASTROPY_USE_SYSTEM_ALL=1
# And with an arm64 processor, again with apt for convenience.
- name: arm64 architecture with apt
arch: arm64
language: c
dist: bionic
stage: Cron tests
env: SETUP_METHOD='apt'
ASTROPY_USE_SYSTEM_ALL=1
# Regularly make sure that astropy can be used in application bundles
- language: python
python: 3.8
dist: bionic
name: bundling with pyinstaller
stage: Cron tests
env: TOXENV="pyinstaller"
allow_failures:
- language: python
python: 3.7
name: Python 3.7 with remote data and dev version of key dependencies
stage: Final tests
env: TOXENV="py37-test-devdeps"
TOXPOSARGS="--remote-data=any"
before_install:
# We need to use CCOMPILER otherwise Travis overwrites CC if we define it
# in env: above.
- if [ ! -z $CCOMPILER ]; then
export CC=$CCOMPILER;
fi
# Check CC variable
- echo "CC="$CC
- if [[ $TOXENV == *-cov ]]; then
export TOXPOSARGS=$TOXPOSARGS" --cov-report=xml:"$TRAVIS_BUILD_DIR"/coverage.xml";
fi
- echo "TOXENV="$TOXENV
- echo "TOXARGS="$TOXARGS
- echo "TOXPOSARGS="$TOXPOSARGS
install:
# language: python is only available for Linux, so for other platforms
# we need to use ci-helpers to set up Python.
- if [[ $TRAVIS_OS_NAME == osx || $TRAVIS_OS_NAME == windows ]]; then
git clone git://github.com/astropy/ci-helpers.git;
source ci-helpers/travis/setup_conda.sh;
fi
# For APT key updates, see https://ftp-master.debian.org/keys.html
- if [ $SETUP_METHOD == 'apt' ]; then
curl https://ftp-master.debian.org/keys/archive-key-10.asc | sudo apt-key add -;
echo "deb http://ftp.us.debian.org/debian testing main" | sudo tee -a /etc/apt/sources.list;
sudo apt-get -qq update;
sudo apt-get install -t testing -y --no-install-recommends ${APT_DEPENDENCIES};
fi
script:
- if [ $SETUP_METHOD == 'tox' ]; then
pip install tox;
tox $TOXARGS -- $TOXPOSARGS;
else
python3 -m venv --system-site-packages tests;
source tests/bin/activate;
pip3 install -e .[test];
python3 -m pytest;
fi
after_success:
- if [[ $TOXENV == *-cov ]]; then
pip install codecov;
codecov --gcov-glob "*cextern*";
fi