forked from glue-viz/glue
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
246 lines (194 loc) · 8.87 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
language: c
sudo: false
addons:
apt:
packages:
- ruby
notifications:
email: false
env:
global:
# We add astropy-ci-extras to have the latest version of Astropy with older Numpy versions.
- CONDA_CHANNELS="astropy-ci-extras astropy glueviz"
- ASTROPY_VERSION=stable
- NUMPY_VERSION=1.13
- NO_CFG_FILES=false
- QT_PKG=pyqt5
- SETUP_XVFB=True
- CONDA_DEPENDENCIES="pip dill ipython matplotlib scipy cython h5py pygments pyzmq scikit-image pandas sphinx xlrd pillow pytest mock coverage pyyaml sphinx_rtd_theme qtpy traitlets ipykernel qtconsole spectral-cube pytest-cov mpl-scatter-density bottleneck"
- PIP_DEPENDENCIES="codecov pyavm astrodendro plotly objgraph pytest-qt pytest-faulthandler flake8"
- PIP_FALLBACK=false
- REMOVE_INSTALL_REQUIRES=0
- secure: NvQVc3XmmjXNVKrmaD31IgltsOImlnt3frAl4wU0pM223iejr7V57hz/V5Isx6sTANWEiRBMG27v2T8e5IiB7DQTxFUleZk3DWXQV1grw/GarEGUawXAgwDWpF0AE/7BRVJYqo2Elgaqf28+Jkun8ewvfPCiEROD2jWEpnZj+IQ=
- secure: "SU9BYH8d9eNigypG3lC83s0NY6Mq9AHGKXyEGeXDtz1npJIC1KHdzPMP1v1K3dzCgl1p6ReMXPjZMCENyfNkad/xvzTzGk0Nu/4BjihrUPV6+ratVeLpv0JLm8ikh8q+sZURkdtzUOlds+Hfn5ku4LdpT87tcKHY9TINAGA34ZM="
- AWS_ACCESS_KEY_ID: AKIAI2ERWDHLW3W24X3A
- AWS_SECRET_ACCESS_KEY: $AWS_SECRET_KEY_ID
stages:
- name: Initial
- name: Full
matrix:
# Don't wait for allowed failures
fast_finish: true
include:
- os: linux
stage: Initial
env: PYTHON_VERSION=2.7
- os: linux
stage: Initial
env: PYTHON_VERSION=3.6
- os: linux
stage: Initial
env: PYTHON_VERSION=3.7
NUMPY_VERSION=1.14
- os: osx
stage: Full
env: PYTHON_VERSION=2.7
- os: osx
stage: Full
env: PYTHON_VERSION=3.6
# Astropy dev
- os: linux
stage: Full
env: PYTHON_VERSION=3.6
ASTROPY_VERSION=dev
# Numpy dev
- os: linux
stage: Full
env: PYTHON_VERSION=3.6
NUMPY_VERSION=dev
# The following configuration tests that glue functions with minimal
# dependencies.
- os: linux
stage: Full
env: PYTHON_VERSION=3.6
CONDA_DEPENDENCIES="pip setuptools pandas mock matplotlib qtpy ipython ipykernel qtconsole mpl-scatter-density bottleneck"
PIP_DEPENDENCIES="pytest-cov codecov flake8"
REMOVE_INSTALL_REQUIRES=1
- os: linux
stage: Full
env: PYTHON_VERSION=3.6
DOC_TRIGGER=1
PYTEST_ARGS="--no-optional-skip"
NO_CFG_FILES=true
# Test with older package versions:
- os: linux
stage: Full
env: PYTHON_VERSION=2.7
MATPLOTLIB_VERSION=2.0
PANDAS_VERSION=0.18
SETUPTOOLS=1.0
IPYTHON_VERSION=4
NUMPY_VERSION=1.11
# Test with PySide2
- os: osx
stage: Full
env: PYTHON_VERSION=3.6
CONDA_CHANNELS="astropy-ci-extras astropy glueviz conda-forge"
QT_PKG=pyside2
- os: linux
stage: Full
env: PYTHON_VERSION=3.6
CONDA_CHANNELS="astropy-ci-extras astropy glueviz conda-forge"
QT_PKG=pyside2
# Test without any Qt installation, which will also cause all qt
# sub-directories to be removed, to make sure that no non-Qt code has
# any dependence on Qt code.
- os: linux
stage: Full
env: PYTHON_VERSION=3.6
PIP_DEPENDENCIES="codecov pyavm astrodendro plotly objgraph flake8"
QT_PKG=False
allow_failures:
# For now PySide2 can give segfaults when the process terminates - see
# https://bugreports.qt.io/browse/PYSIDE-585
# We therefore need to mark these as allowed failures for now
- os: osx
env: PYTHON_VERSION=3.6
CONDA_CHANNELS="astropy-ci-extras astropy glueviz conda-forge"
QT_PKG=pyside2
- os: linux
env: PYTHON_VERSION=3.6
CONDA_CHANNELS="astropy-ci-extras astropy glueviz conda-forge"
QT_PKG=pyside2
before_install:
# Prepare dependency list.
- if [[ $QT_PKG == pyside2 ]]; then export CONDA_DEPENDENCIES="pyside2 "$CONDA_DEPENDENCIES; fi
- if [[ $QT_PKG == pyqt5 ]]; then export CONDA_DEPENDENCIES="pyqt=5 "$CONDA_DEPENDENCIES; fi
# Documentation dependencies
- if [ $DOC_TRIGGER ]; then export PIP_DEPENDENCIES="sphinx-automodapi numpydoc requests "$PIP_DEPENDENCIES; fi
# Install ci-helpers and set up conda
- git clone git://github.com/astropy/ci-helpers.git
- source ci-helpers/travis/setup_conda.sh
# now set up a plugin configuration file with some plugins disabled. This is
# to make sure that when we run the tests, glue will ignore this
# configuration and will instead run tests for all plugins.
- if [[ $NO_CFG_FILES == false ]]; then mkdir ~/.glue; printf "[plugins]\nspectrum_tool = 0\n" >> ~/.glue/plugins.cfg; fi
install:
- LC_ALL=C
# Uninstall PyQt if we are using PySide
- if [ $QT_PKG == pyside2 ]; then conda remove --no-pin --force pyqt sip || true; fi
# Uninstall any version of Qt if QT_PKG is False, and remove all qt
# sub-directories
- if [[ $QT_PKG == False ]]; then
sed -i.bak '/qtpy/d' setup.py;
sed -i.bak '/sys.exit(1)/d' setup.py;
conda remove --no-pin --force pyqt || true;
conda remove --no-pin --force pyside || true;
conda remove --no-pin --force pyside2 || true;
conda remove --no-pin --force qt || true;
find . -name "qt" -type d -exec rm -r {} \; || true;
rm glue/external/qt.py || true;
sed -i.bak 's/in REQUIRED_PLUGINS/in REQUIRED_PLUGINS and False/' glue/main.py || true;
fi
# Set MPLBACKEND to Agg by default - this will get overriden if Qt is present,
# but it avoids having Matplotlib default to the osx backend on MacOS X
- export MPLBACKEND='Agg';
# List installed packages - use the export command so as to be able to
# reproduce the exact environment locally. Do this before installing glue
# since we don't want glue to appear in the list of packages for the
# environment.
- conda env export
# If REMOVE_INSTALL_REQUIRES is set, then we need to get rid of the
# install_requires section in setup.py. This is used for the absolute
# minimal build to make sure that things still work. In practice,
# glue could never be run with such a restrictive set of dependencies
# because install_requires will not be empty for users, but it ensures
# that if we change some of the dependencies from required to optional
# in future (apart from a core few), things will still work.
- if [[ $REMOVE_INSTALL_REQUIRES == 1 ]]; then sed -i.bak s/install_requires=install_requires/install_requires=[]/g setup.py; fi
# We need to install glue in order to make sure that the entry points are
# installed.
- pip install . --no-deps --verbose
# Check that all the plugins load correctly
- python -c 'from glue.logger import logger; logger.setLevel("DEBUG"); from glue.main import load_plugins; load_plugins()'
# List installed packages again - just to check if any packages got installed
# in the previous step.
- conda env export
script:
# In the following, we make sure there are no font sizes hard-coded in *.ui files.
# We do this because the default application font size may change on different
# platforms, but the sizes in ui files are absolute, which can lead to mismatched
# font sizes.
- find glue -name "*.ui" -exec grep "pointsize" {} \; >& font.log
- test ! -s font.log
- if [[ $QT_PKG == False ]]; then glue --version; fi
# Do style checks
- flake8 --max-line-length=100 --exclude=external glue
- pytest --cov glue --durations=20 -vs $PYTEST_ARGS glue
# In the following, we use separate if statements for each line, to make
# sure the exit code from each one is taken into account for the overall
# exit code.
- if [ $DOC_TRIGGER ]; then cd doc; make html linkcheck 2> warnings.log; cd ..; fi
- if [ $DOC_TRIGGER ]; then cat doc/warnings.log; fi
- if [ $DOC_TRIGGER ]; then grep -v "numpy.dtype size changed" doc/warnings.log | grep -v "return f(\*args, \*\*kwds)" || true > doc/warnings_filt.log; fi
- if [ $DOC_TRIGGER ]; then cat doc/warnings_filt.log; fi
# make sure stderr was empty, i.e. no warnings
- if [ $DOC_TRIGGER ]; then test ! -s doc/warnings_filt.log; fi
# Check for any broken links, ignore 'redirected with Found'
- if [ $DOC_TRIGGER ]; then grep -v "redirected with Found" doc/_build/linkcheck/output.txt || true > doc/_build/linkcheck/output_no_found_redirect.txt; fi
- if [ $DOC_TRIGGER ]; then test ! -s doc/_build/linkcheck/output_no_found_redirect.txt; fi
# Check spelling
# - if [ $DOC_TRIGGER ]; then make spelling; fi
after_success:
# Coverage testing
- if [[ $QT_PKG != False ]]; then codecov; fi