forked from glue-viz/glue
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
227 lines (181 loc) · 8.51 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
language: c
os:
- linux
- osx
sudo: false
addons:
apt:
packages:
- rubygems
notifications:
email: false
env:
matrix:
- PYTHON_VERSION=2.7
- PYTHON_VERSION=3.6
global:
# We add astropy-ci-extras to have the latest version of Astropy with older Numpy versions.
- CONDA_CHANNELS=astropy-ci-extras
- MATPLOTLIB_VERSION=1.5
- NUMPY_VERSION=1.11
- ASTROPY_VERSION=1.3
- IPYTHON_VERSION=5
- PYTEST_ARGS="--cov glue -vs"
- NO_CFG_FILES=false
- QT_PKG=pyqt5
- SETUP_XVFB=True
# Note that we need to specify requests 2.9 because of a bug in the version check in linkchecker, and we can't use conda since requests 2.9 won't exist for e.g. Python 3.6
- CONDA_DEPENDENCIES="nomkl 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"
- PIP_DEPENDENCIES="pytest-cov coveralls pyavm astrodendro awscli plotly spectral-cube requests==2.9 glue-vispy-viewers"
- 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
matrix:
# Don't wait for allowed failures
fast_finish: true
include:
# Astropy dev
- os: linux
env: PYTHON_VERSION=3.6
ASTROPY_VERSION=dev
# Numpy dev
- os: linux
env: PYTHON_VERSION=3.6
NUMPY_VERSION=dev
# The following configuration tests that glue functions with minimal
# dependencies.
- os: linux
env: PYTHON_VERSION=3.6
PYTEST_ARGS="--cov glue"
CONDA_DEPENDENCIES="pip setuptools pandas mock matplotlib qtpy ipython ipykernel qtconsole"
PIP_DEPENDENCIES="pytest-cov coveralls"
REMOVE_INSTALL_REQUIRES=1
# We need to keep the following on 2.7 because of linkchecker
- os: linux
env: PYTHON_VERSION=2.7
DOC_TRIGGER=1
APP_TRIGGER=1
PYTEST_ARGS="--cov glue --no-optional-skip"
NO_CFG_FILES=true
# Test with older package versions:
- os: linux
env: PYTHON_VERSION=2.7
QT_PKG=pyqt
- os: linux
env: PYTHON_VERSION=2.7
MATPLOTLIB_VERSION=1.4
NUMPY_VERSION=1.9
IPYTHON_VERSION=4
PANDAS_VERSION=0.14
SETUPTOOLS=1.0
QT_PKG=pyqt
- os: linux
env: PYTHON_VERSION=2.7
MATPLOTLIB_VERSION=1.5
NUMPY_VERSION=1.10
QT_PKG=pyqt
# Test with PySide, but due to segmentation faults, mark as an
# allowed failure.
- os: linux
env: PYTHON_VERSION=2.7
QT_PKG=pyside
# 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
env: PYTHON_VERSION=3.6
QT_PKG=False
allow_failures:
- os: linux
env: PYTHON_VERSION=2.7 NUMPY_VERSION=dev
PIP_DEPENDENCIES="pytest-cov coveralls pyavm astrodendro awscli plotly"
- os: linux
env: PYTHON_VERSION=2.7 QT_PKG=pyside
before_install:
# Prepare dependency list. Note that in future, PyQt5 will be the pyqt conda
# package with a version of 5.x rather than a pyqt5 package, so we explicitly
# request pyqt=4 for PyQt4.
- if [[ $QT_PKG == pyside ]]; then export CONDA_DEPENDENCIES="pyside "$CONDA_DEPENDENCIES; fi
- if [[ $QT_PKG == pyqt ]]; then export CONDA_DEPENDENCIES="pyqt=4 "$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 linkchecker "$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_$TRAVIS_OS_NAME.sh
# setup tools to trigger mac buildbot
- if [ $TRAVIS_PULL_REQUEST == false && $APP_TRIGGER ]; then source .setup_app_trigger.sh; fi
- if [ $TRAVIS_BRANCH = master ]; then export S3_DIR=latest; else export S3_DIR=$TRAVIS_BRANCH; fi
# 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 == pyside ]; then conda remove --no-pin --force pyqt sip || true; fi
- if [[ $QT_PKG == pyqt5 ]]; then
export QT_QPA_PLATFORM_PLUGIN_PATH=$HOME/miniconda/envs/test/lib/qt5/plugins/platforms;
export QT_DEBUG_PLUGINS=1;
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 qtpy || true;
conda remove --no-pin --force pyqt || true;
conda remove --no-pin --force pyside || true;
conda remove --no-pin --force qt || true;
pip uninstall --yes qtpy || true;
find . -name "qt" -type d -exec rm -r {} \; || true;
rm glue/external/qt.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 ]; 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
# 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
- python setup.py test -a "$PYTEST_ARGS";
# 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 2> warnings.log; cd ..; fi
- if [ $DOC_TRIGGER ]; then cat doc/warnings.log; fi
# make sure stderr was empty, i.e. no warnings
- if [ $DOC_TRIGGER ]; then test ! -s doc/warnings.log; fi
- if [ $DOC_TRIGGER ]; then linkchecker --ignore-url=".*fontawesome_webfont.*" doc/_build/html; fi
after_success:
# Coverage testing
- if [[ $QT_PKG != False ]]; then coveralls; fi
# Trigger the building of the MacOS X app in the Travis-MacGlue repo
- if [ $TRAVIS_PULL_REQUEST == false && $APP_TRIGGER ]; then ./.trigger_app_build.sh; fi