forked from gammapy/gammapy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
195 lines (154 loc) · 7.22 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
#
# This travis-ci build matrix config is a modified copy of the one from Astropy
#
# We can't use `language: python` here because it's not supported on Mac.
# But that's OK ... the language here is irrelevant because we use conda
# to install our own Python.
language: c
os:
- linux
# This is a signal to travis-ci to use the new build infrastructure
sudo: false
addons:
apt:
packages: &default_apt
- graphviz
- texlive-latex-extra
- dvipng
- gfortran
env:
global:
- NUMPY_VERSION=stable
- ASTROPY_VERSION=stable
- CONDA_DEPENDENCIES='Cython click scipy h5py matplotlib pyyaml scikit-image scikit-learn pandas naima photutils sherpa libgfortran regions reproject'
- CONDA_DEPENDENCIES_OSX='Cython click scipy h5py matplotlib pyyaml scikit-image scikit-learn pandas naima photutils sherpa regions reproject'
- CONDA_DEPENDENCIES_WO_SHERPA='Cython click scipy h5py matplotlib pyyaml scikit-image scikit-learn pandas naima photutils regions reproject'
- CONDA_DOCS_DEPENDENCIES='Cython click scipy h5py matplotlib pyyaml scikit-image scikit-learn pandas naima photutils pygments aplpy sherpa libgfortran regions reproject'
- CONDA_DOCS_DEPENDENCIES_WO_SHERPA='Cython click scipy h5py matplotlib pyyaml scikit-image scikit-learn pandas naima photutils pygments aplpy regions reproject'
- CONDA_DEPENDENCIES_NOTEBOOKS='Cython click scipy h5py matplotlib pyyaml scikit-image scikit-learn pandas naima photutils aplpy sherpa libgfortran runipy regions reproject'
- CONDA_DEPENDENCIES_NOTEBOOKS_WO_SHERPA='Cython click scipy h5py matplotlib pyyaml scikit-image scikit-learn pandas naima photutils aplpy libgfortran runipy regions reproject'
- PIP_DEPENDENCIES='uncertainties'
- CONDA_CHANNELS='conda-forge astropy sherpa'
- FETCH_GAMMAPY_EXTRA=true
- FETCH_GAMMA_CAT=true
- PACKAGING_TEST=false
- MAIN_CMD='python setup.py'
matrix:
- PYTHON_VERSION=3.6 SETUP_CMD='egg_info'
- PYTHON_VERSION=3.5 SETUP_CMD='egg_info'
- PYTHON_VERSION=2.7 SETUP_CMD='egg_info'
matrix:
# Don't wait for allowed failures
fast_finish: true
include:
# MacOS X tests
- os: osx
env: PYTHON_VERSION=2.7 SETUP_CMD='test'
CONDA_DEPENDENCIES=$CONDA_DEPENDENCIES_OSX
- os: osx
env: PYTHON_VERSION=3.5 SETUP_CMD='test'
CONDA_DEPENDENCIES=$CONDA_DEPENDENCIES_OSX
# The main build that's used for coverage measurement
- os: linux
env: PYTHON_VERSION=3.6 SETUP_CMD='test -V --coverage'
# Run tests without optional dependencies
- os: linux
env: PYTHON_VERSION=3.5 SETUP_CMD='test -V'
CONDA_DEPENDENCIES='Cython click regions'
PIP_DEPENDENCIES=''
# Run tests without GAMMAPY_EXTRA available
- os: linux
env: FETCH_GAMMAPY_EXTRA=false PYTHON_VERSION=3.6 SETUP_CMD='test -V'
CONDA_DEPENDENCIES=$CONDA_DEPENDENCIES
# Build docs
- os: linux
env: PYTHON_VERSION=2.7 SETUP_CMD='build_docs -w'
CONDA_DEPENDENCIES=$CONDA_DOCS_DEPENDENCIES
- os: linux
env: PYTHON_VERSION=3.6 SETUP_CMD='build_docs -w'
CONDA_DEPENDENCIES=$CONDA_DOCS_DEPENDENCIES
# Test conda build (which runs a bunch of useful tests after building the package)
# See https://conda.io/docs/bdist_conda.html
- os: linux
env: PYTHON_VERSION=3.6 MAIN_CMD='make' SETUP_CMD='conda'
PACKAGING_TEST=true
# Older Python versions
- os: linux
env: PYTHON_VERSION=3.5 SETUP_CMD='test -V'
- os: linux
env: PYTHON_VERSION=2.7 SETUP_CMD='test -V'
# Test with Astropy dev and LTS versions
# - os: linux
# env: PYTHON_VERSION=2.7 ASTROPY_VERSION=lts SETUP_CMD='test -V'
# - os: linux
# env: PYTHON_VERSION=3.5 ASTROPY_VERSION=lts SETUP_CMD='test -V'
# CONDA_DEPENDENCIES=$CONDA_DEPENDENCIES_WO_SHERPA
- os: linux
env: PYTHON_VERSION=2.7 ASTROPY_VERSION=dev SETUP_CMD='test -V'
- os: linux
env: PYTHON_VERSION=3.5 ASTROPY_VERSION=dev SETUP_CMD='test -V'
CONDA_DEPENDENCIES=$CONDA_DEPENDENCIES
# Temporarily disabled because of this issue:
# https://travis-ci.org/gammapy/gammapy/jobs/115820975
# https://github.com/gammapy/gammapy/pull/483
# Test the dev version of Sherpa, this may take a longer time
#- os: linux
# env: PYTHON_VERSION=2.7 SETUP_CMD='test -V'
# CONDA_DEPENDENCIES=$CONDA_DEPENDENCIES_WO_SHERPA DEBUG=True
# PIP_DEPENDENCIES='uncertainties git+http://github.com/sherpa/sherpa.git#egg=sherpa'
# Test with other numpy versions
- os: linux
env: PYTHON_VERSION=3.6 NUMPY_VERSION=dev SETUP_CMD='test -V'
CONDA_DEPENDENCIES=$CONDA_DEPENDENCIES_WO_SHERPA
- os: linux
env: PYTHON_VERSION=2.7 NUMPY_VERSION=prerelease SETUP_CMD='test -V'
- os: linux
env: PYTHON_VERSION=3.6 NUMPY_VERSION=1.10 SETUP_CMD='test -V'
# Test IPython notebooks
- os: linux
env: PYTHON_VERSION=3.5 MAIN_CMD='make' SETUP_CMD='test-notebooks'
CONDA_DEPENDENCIES=$CONDA_DEPENDENCIES_NOTEBOOKS
- os: linux
env: PYTHON_VERSION=2.7 MAIN_CMD='make' SETUP_CMD='test-notebooks'
CONDA_DEPENDENCIES=$CONDA_DEPENDENCIES_NOTEBOOKS
# You can move builds that temporarily fail because of some non-Gammapy here.
# Please add a link to a GH issue that tracks the upstream issue.
# copy the part from the `include` section above here.
# allow_failures:
# # See https://github.com/gammapy/gammapy/pull/899#issuecomment-281001655
# - os: linux
# env: PYTHON_VERSION=3.4 SETUP_CMD='test -V'
# CONDA_DEPENDENCIES=$CONDA_DEPENDENCIES_WO_SHERPA
install:
- git clone git://github.com/astropy/ci-helpers.git
- source ci-helpers/travis/setup_conda_$TRAVIS_OS_NAME.sh
- if $FETCH_GAMMAPY_EXTRA; then
git clone https://github.com/gammapy/gammapy-extra.git $HOME/gammapy-extra;
export GAMMAPY_EXTRA=${HOME}/gammapy-extra;
fi
- if $FETCH_GAMMA_CAT; then
git clone https://github.com/gammapy/gamma-cat.git $HOME/gamma-cat;
export GAMMA_CAT=${HOME}/gamma-cat;
fi
# From https://conda.io/docs/bdist_conda.html
# bdist_conda must be installed into a root conda environment,
# as it imports conda and conda_build. It is included as part of the conda build package.
- if $PACKAGING_TEST; then
conda install -n root conda-build astropy Cython click regions;
conda info;
conda --version;
conda build --version;
source activate root;
fi
# This is needed to make matplotlib plot testing work
- if [[ $TRAVIS_OS_NAME == 'linux' ]]; then
export DISPLAY=:99.0;
sh -e /etc/init.d/xvfb start;
export QT_API=pyqt;
fi
script:
- $MAIN_CMD $SETUP_CMD
after_success:
- if [[ $SETUP_CMD == 'test -V --coverage' ]]; then
coveralls --rcfile='gammapy/tests/coveragerc';
fi