forked from astropy/astropy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
265 lines (231 loc) · 10.6 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
# 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
os:
- linux
# The apt packages below are needed for sphinx builds, which can no longer
# be installed with sudo apt-get.
# tzdata is included to ensure system leap seconds are up to date.
addons:
apt:
packages:
- graphviz
- language-pack-de
- tzdata
env:
global:
# Set defaults to avoid repeating in most cases
- PYTHON_VERSION=3.6
- NUMPY_VERSION=stable
- MAIN_CMD='python setup.py'
- CONDA_DEPENDENCIES='Cython jinja2'
- CONDA_ALL_DEPENDENCIES='Cython jinja2 scipy h5py matplotlib pyyaml pandas pytz html5lib beautifulsoup4 ipython mpmath bleach bottleneck'
- ASDF_PIP_DEP='asdf>=2.5'
- ASDF_DEV='git+https://github.com/spacetelescope/asdf.git#egg=asdf'
- DEV_PIP_DEP='Cython jinja2 scipy h5py matplotlib pyyaml scikit-image pandas pytz html5lib beautifulsoup4 ipython mpmath bleach bottleneck'
- SETUP_XVFB=True
- EVENT_TYPE='push pull_request'
- SETUP_CMD='test'
- INSTALL_WITH_PIP=False
- PIP_FLAGS=""
- EXTRAS_INSTALL=""
- USE_CI_HELPERS=True
# Use this for the dependencies when not using ci-helpers
- OTHER_DEPENDENCY_PREFERENCES=''
# PEP8 errors/warnings:
# E101 - mix of tabs and spaces
# W191 - use of tabs
# W291 - trailing whitespace
# W292 - no newline at end of file
# W293 - trailing whitespace
# W391 - blank line at end of file
# E111 - 4 spaces per indentation level
# E112 - 4 spaces per indentation level
# E113 - 4 spaces per indentation level
# E301 - expected 1 blank line, found 0
# E302 - expected 2 blank lines, found 0
# E303 - too many blank lines (3)
# E304 - blank lines found after function decorator
# E305 - expected 2 blank lines after class or function definition
# E306 - expected 1 blank line before a nested definition
# E502 - the backslash is redundant between brackets
# E722 - do not use bare except
# E901 - SyntaxError or IndentationError
# E902 - IOError
# E999: SyntaxError -- failed to compile a file into an Abstract Syntax Tree
# # F821: undefined name # Note: Removed for now because of heavy use of units.si
# F822: undefined name in __all__
# F823: local variable name referenced before assignment
- FLAKE8_OPT="--select=E101,W191,W291,W292,W293,W391,E111,E112,E113,E30,E502,E722,E901,E902,E999,F822,F823"
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
jobs:
# Don't wait for allowed failures
fast_finish: true
include:
- name: Python 3.7 with all optional dependencies for OSX
os: osx
stage: Cron tests
env: SETUP_CMD='test --remote-data=astropy'
CONDA_DEPENDENCIES="$CONDA_ALL_DEPENDENCIES clang"
PIP_DEPENDENCIES="scikit-image jplephem $ASDF_PIP_DEP"
CCOMPILER=clang
EVENT_TYPE='cron'
# 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.
- name: Python 3.6 with oldest supported version of all dependencies
os: linux
stage: Comprehensive tests
env: PYTHON_VERSION=3.6 NUMPY_VERSION=1.16
INSTALL_CMD='python setup.py build_ext --inplace'
PIP_DEPENDENCIES='pytest-astropy'
TEST_CMD='pytest --open-files --doctest-rst'
script:
- $INSTALL_CMD
- $TEST_CMD
# Now try with all optional dependencies. We also include the --readonly
# flag to make sure no files are being written to the temporary install
# location during testing. We also use this build to make sure that the
# dependencies get correctly installed with pip.
- name: Python 3.8 with required dependencies
os: linux
stage: Comprehensive tests
env: SETUP_CMD='test --remote-data=astropy --readonly'
LC_CTYPE=C.ascii LC_ALL=C
PIP_DEPENDENCIES="" CONDA_DEPENDENCIES=""
INSTALL_WITH_PIP=True
EXTRAS_INSTALL="test,all"
PYTHON_VERSION=3.8
- name: Python 3.7 with dependencies
os: linux
stage: Initial tests
env: PYTHON_VERSION=3.7 CONDA_DEPENDENCIES=$CONDA_ALL_DEPENDENCIES
PIP_DEPENDENCIES="scikit-image $ASDF_PIP_DEP"
SETUP_CMD='test -a "--durations=50"'
compiler: clang
# Full tests with coverage checks.
- name: Python 3.6 with all optional dependencies as coverage
os: linux
stage: Comprehensive tests
env: SETUP_CMD='test --coverage --remote-data=astropy --readonly'
CONDA_DEPENDENCIES=$CONDA_ALL_DEPENDENCIES
PIP_DEPENDENCIES="scikit-image codecov objgraph jplephem bintrees sortedcontainers $ASDF_PIP_DEP"
LC_CTYPE=C.ascii LC_ALL=C
CFLAGS='--coverage -fno-inline-functions -O0'
MATPLOTLIB_VERSION=2.1
EVENT_TYPE='push pull_request cron'
# Try on Windows
- name: Python 3.7 with all optional dependencies on Windows
os: windows
stage: Final tests
env: PYTHON_VERSION=3.7 SETUP_CMD='test --readonly'
CONDA_DEPENDENCIES=""
PIP_DEPENDENCIES="Cython scipy h5py beautifulsoup4 html5lib jinja2 pyyaml matplotlib scikit-image pytz pandas objgraph asdf"
# Do a PEP8/pyflakes test with flake8
- name: Code style checks
os: linux
stage: Initial tests
env: MAIN_CMD="flake8 astropy --count $FLAKE8_OPT" SETUP_CMD=''
# 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.
- name: Python 3.7 with remote data and dev version of key dependencies
os: linux
stage: Final tests
env: PYTHON_VERSION=3.7 NUMPY_VERSION=dev SETUP_CMD='test --remote-data'
CONDA_DEPENDENCIES=''
PIP_DEPENDENCIES="$DEV_PIP_DEP $ASDF_DEV"
MATPLOTLIB_VERSION=dev
# Run documentation link check (this is cron only on master).
# NOTE: matplotlib pinning should be consistent with CircleCI HTML job.
- name: Documentation link check
os: linux
stage: Final tests
env: SETUP_CMD='build_docs -b linkcheck'
MATPLOTLIB_VERSION="<3.1"
PIP_DEPENDENCIES="" CONDA_DEPENDENCIES=""
INSTALL_WITH_PIP=True
EXTRAS_INSTALL="docs"
# Also regularly try the big-endian s390 architecture, in the
# process checking that installing dependencies with apt works.
- name: big-endian s390 architecture with apt
arch: s390x
language: c
dist: bionic
stage: Final tests
env: USE_CI_HELPERS=False APT_DEPENDENCIES="python3-pip python3-dev python3-venv python3-setuptools cython3 ipython3 python3-jinja2 python3-numpy python3-pytest-astropy python3-pytest-cov python3-pytest-xdist python3-pytest-filter-subpackage python3-objgraph python3-coverage tzdata"
# And with an arm64 processor, again with apt for convenience.
- name: arm64 architecture with apt
arch: arm64
language: c
dist: bionic
stage: Final tests
env: USE_CI_HELPERS=False APT_DEPENDENCIES="python3-pip python3-dev python3-venv python3-setuptools cython3 ipython3 python3-jinja2 python3-numpy python3-pytest-astropy python3-pytest-cov python3-pytest-xdist python3-pytest-filter-subpackage python3-objgraph python3-coverage tzdata"
allow_failures:
- name: Python 3.7 with remote data and dev version of key dependencies
os: linux
stage: Final tests
env: PYTHON_VERSION=3.7 NUMPY_VERSION=dev SETUP_CMD='test --remote-data'
CONDA_DEPENDENCIES=''
PIP_DEPENDENCIES="$DEV_PIP_DEP $ASDF_DEV"
MATPLOTLIB_VERSION=dev
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
# Write configuration items to standard location to make sure they are
# ignored (the tests will fail if not)
- mkdir -p $HOME/.astropy/config/
- printf "unicode_output = True\nmax_width = 500" > $HOME/.astropy/config/astropy.cfg
install:
- if [[ $USE_CI_HELPERS == True ]]; then
git clone git://github.com/astropy/ci-helpers.git;
source ci-helpers/travis/setup_conda.sh;
fi
- if [[ $INSTALL_WITH_PIP == True ]]; then
if [ -z $EXTRAS_INSTALL ]; then
pip install -e . ${OTHER_DEPENDENCY_PREFERENCES} ${PIP_FLAGS};
else
pip install -e .[$EXTRAS_INSTALL] ${OTHER_DEPENDENCY_PREFERENCES} ${PIP_FLAGS};
fi
fi
# For APT key updates, see https://ftp-master.debian.org/keys.html
- if [ $TRAVIS_CPU_ARCH == s390x ] || [ $TRAVIS_CPU_ARCH == arm64 ]; 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 -y --no-install-recommends ${APT_DEPENDENCIES};
fi
script:
script:
- if [ $TRAVIS_CPU_ARCH != s390x ] && [ $TRAVIS_CPU_ARCH != arm64 ]; then
$MAIN_CMD $SETUP_CMD;
else
python3 -m venv --system-site-packages tests;
source tests/bin/activate;
pip3 install -e .[test];
pytest-3;
fi
after_success:
- if [[ $SETUP_CMD == *--coverage* ]]; then
codecov --gcov-glob "*cextern*";
fi