/
.travis.yml
169 lines (132 loc) · 5.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
#
# 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
stage: Comprehensive tests
# 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:
- PYTHON_VERSION=3.7
- NUMPY_VERSION=1.15
- ASTROPY_VERSION=stable
- ASTROPY_USE_SYSTEM_PYTEST=1
- CONDA_DEPENDENCIES='Cython click scipy healpy matplotlib pyyaml uncertainties pandas naima sherpa libgfortran regions reproject pandoc ipython iminuit'
- CONDA_DEPENDENCIES_OSX='Cython click scipy healpy matplotlib pyyaml uncertainties pandas naima sherpa regions reproject pandoc ipython iminuit'
- CONDA_DEPENDENCIES_WO_SHERPA='Cython click scipy healpy matplotlib pyyaml uncertainties pandas naima regions reproject pandoc ipython iminuit'
- CONDA_DEPENDENCIES_DOCS='Cython click scipy healpy matplotlib pyyaml uncertainties pandas naima pygments sherpa libgfortran regions reproject pandoc ipython jupyter'
- CONDA_DEPENDENCIES_NOTEBOOKS='Cython click scipy healpy matplotlib pyyaml uncertainties pandas naima sherpa libgfortran iminuit regions reproject pandoc ipython jupyter'
- PIP_DEPENDENCIES='nbsphinx sphinx-astropy sphinx-click sphinx_rtd_theme pytest-astropy parfive jsonschema'
- CONDA_CHANNELS='conda-forge sherpa'
- FETCH_GAMMAPY_EXTRA=false
- FETCH_GAMMAPY_DATA=true
- TEST_COVERAGE=false
- TEST_PACKAGING=false
- TEST_FERMIPY=false
- RUN_INSTALL=true
stages:
# Do the style check and a single test job, don't proceed if it fails
- name: Initial tests
# Test docs, dev dependencies, and without optional dependencies
- name: Comprehensive tests
matrix:
# Don't wait for allowed failures
fast_finish: true
include:
# Main test, used for coverage
- stage: Initial tests
env: TEST_COVERAGE=true CMD='make test-cov'
PIP_DEPENDENCIES="$PIP_DEPENDENCIES pytest-cov"
# MacOS X tests
- os: osx
env: PYTHON_VERSION=3.6 CMD='make test'
CONDA_DEPENDENCIES=$CONDA_DEPENDENCIES_OSX
# Run tests without optional dependencies
- env: PYTHON_VERSION=3.6 CMD='make test'
CONDA_DEPENDENCIES='Cython click regions'
PIP_DEPENDENCIES='pytest-astropy parfive jsonschema'
# Run tests without GAMMAPY_EXTRA available
- stage: Initial tests
env: CMD='make test'
FETCH_GAMMAPY_EXTRA=false FETCH_GAMMAPY_DATA=false
# Build docs
- env: CMD='make docs-all'
CONDA_DEPENDENCIES=$CONDA_DEPENDENCIES_DOCS
# Test conda build (which runs a bunch of useful tests after building the package)
# See https://conda.io/docs/bdist_conda.html
- env: CMD='python setup.py bdist_conda'
TEST_PACKAGING=true
# Test with Astropy LTS version
- env: PYTHON_VERSION=3.6 ASTROPY_VERSION=lts CMD='make test'
CONDA_DEPENDENCIES=$CONDA_DEPENDENCIES
# Test with Astropy dev version
- env: PYTHON_VERSION=3.6 ASTROPY_VERSION=dev CMD='make test'
CONDA_DEPENDENCIES=$CONDA_DEPENDENCIES
# Test with Sherpa dev, this may take a longer time
- env: PYTHON_VERSION=3.6 SETUP_CMD='make test'
CONDA_DEPENDENCIES=$CONDA_DEPENDENCIES_WO_SHERPA DEBUG=True
PIP_DEPENDENCIES='uncertainties git+http://github.com/sherpa/sherpa.git#egg=sherpa pytest-astropy parfive jsonschema'
# Test Fermipy master against gammapy master
- env: PYTHON_VERSION=3.6 CMD='pip install .'
TEST_FERMIPY=true
# Test Jupyter notebooks
- env: PYTHON_VERSION=3.6 CMD='make test-nb'
CONDA_DEPENDENCIES=$CONDA_DEPENDENCIES_NOTEBOOKS
# Test example scripts
- env: PYTHON_VERSION=3.6 CMD='make test-scripts'
CONDA_DEPENDENCIES=$CONDA_DEPENDENCIES
install:
- git clone git://github.com/astropy/ci-helpers.git
- source ci-helpers/travis/setup_conda.sh
# 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 $TEST_PACKAGING; 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:
- 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_GAMMAPY_DATA; then
export GAMMAPY_DATA=${HOME}/gammapy-data;
pip install -e .;
gammapy download datasets --out=$GAMMAPY_DATA --silent;
fi
- if $RUN_INSTALL; then
pip install -e .;
fi
- $CMD
- if $TEST_FERMIPY; then
git clone https://github.com/fermiPy/fermipy.git;
cd fermipy;
pytest -v;
fi
after_success:
- if $TEST_COVERAGE; then
pip install coveralls;
coveralls;
fi