forked from gammapy/gammapy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
145 lines (113 loc) · 4.74 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
#
# 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
env:
global:
- PYTHON_VERSION=3.7
- NUMPY_VERSION=stable
- ASTROPY_VERSION=stable
- ASTROPY_USE_SYSTEM_PYTEST=1
- CONDA_DEPENDENCIES='Cython click scipy healpy matplotlib pyyaml pandas naima sherpa regions reproject pandoc ipython iminuit'
- CONDA_DEPENDENCIES_OSX='Cython click scipy healpy matplotlib pyyaml pandas naima sherpa regions reproject pandoc ipython iminuit'
- CONDA_DEPENDENCIES_WO_SHERPA='Cython click scipy healpy matplotlib pyyaml pandas naima regions reproject pandoc ipython iminuit'
- CONDA_DEPENDENCIES_DOCS='Cython click scipy healpy matplotlib pyyaml pandas naima pygments sherpa regions reproject pandoc ipython jupyter iminuit'
- PIP_DEPENDENCIES='nbsphinx sphinx-astropy sphinx-gallery sphinx-click sphinx_rtd_theme pytest-astropy parfive pydantic'
- CONDA_CHANNELS='astropy sherpa'
- FETCH_GAMMAPY_DATA=true
- TEST_COVERAGE=false
- TEST_PACKAGING=false
- RUN_INSTALL=true
- DEBUG=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 codecov"
# 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 pydantic'
# Run tests without GAMMAPY_DATA available
- stage: Initial tests
env: CMD='make test'
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 CONDA_CHANNELS='astropy sherpa conda-forge'
# 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='git+http://github.com/sherpa/sherpa.git#egg=sherpa pytest-astropy parfive pydantic'
# Test Jupyter notebooks
- env: PYTHON_VERSION=3.6 CMD='make test-nb'
CONDA_DEPENDENCIES=$CONDA_DEPENDENCIES_DOCS
# 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 pydantic;
conda info;
conda --version;
conda build --version;
conda 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_DATA; then
export GAMMAPY_DATA=${HOME}/gammapy-data;
pip install -e .;
gammapy download datasets --out=$GAMMAPY_DATA --tests --silent;
fi
- if $RUN_INSTALL; then
pip install -e .;
fi
- $CMD
after_success:
- if $TEST_COVERAGE; then
codecov -X gcov;
fi