forked from sncosmo/sncosmo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
131 lines (109 loc) · 4.65 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
language: python
# Setting sudo to false opts in to Travis-CI container-based builds.
sudo: false
# The apt packages below are needed for sphinx builds, which can no longer
# be installed with sudo apt-get.
# (need g++ for iminuit install)
addons:
apt:
packages:
- graphviz
- texlive-latex-extra
- dvipng
- g++
python:
- 2.6
- 2.7
- 3.3
- 3.4
# This is just for "egg_info". All other builds are explicitly given in the matrix
env:
global:
# The following versions are the 'default' for tests, unless
# overidden underneath. They are defined here in order to save having
# to repeat them for all configurations.
- NUMPY_VERSION=1.9
- ASTROPY_VERSION=stable
- CONDA_INSTALL='conda install -c astropy-ci-extras --yes'
- PIP_INSTALL='pip install'
- COVERAGE=N
- PEP8=N
- DOCS=N
- DEPS=N
matrix:
- CMD='python setup.py egg_info'
matrix:
include:
# Do a coverage test in Python 2.
- python: 2.7
env: CMD='python setup.py test --coverage' COVERAGE=Y DEPS=Y
# Check for sphinx doc build warnings
# Currently skipping until sphinx is updated. Also, astropy-helpers seems to have
# problems installing with conda on travis, though it works locally.
#- python: 2.7
# env: CMD='python setup.py install; cd docs; sphinx-build . _build/html -W' DOCS=Y DEPS=Y
# Try Astropy development version
- python: 2.7
env: ASTROPY_VERSION=development CMD='python setup.py test' DEPS=Y
- python: 3.4
env: ASTROPY_VERSION=development CMD='python setup.py test' DEPS=Y
# Try all python versions with the latest numpy
- python: 2.6
env: CMD='python setup.py test' DEPS=Y
- python: 2.7
env: CMD='python setup.py test' DEPS=Y
- python: 3.3
env: CMD='python setup.py test' DEPS=Y
- python: 3.4
env: CMD='python setup.py test' DEPS=Y
# Try older numpy versions
- python: 2.7
env: NUMPY_VERSION=1.8 CMD='python setup.py test' DEPS=Y
- python: 2.7
env: NUMPY_VERSION=1.7 CMD='python setup.py test' DEPS=Y
- python: 2.7
env: NUMPY_VERSION=1.6 CMD='python setup.py test' DEPS=Y
# pep8 checker
- python: 2.7
env: CMD='pep8 sncosmo --exclude=version.py' PEP8=Y
before_install:
# Use utf8 encoding. Should be default, but this is insurance against
# future changes
- export PYTHONIOENCODING=UTF8
- wget http://repo.continuum.io/miniconda/Miniconda-latest-Linux-x86_64.sh -O miniconda.sh
- chmod +x miniconda.sh
- ./miniconda.sh -b
- export PATH=/home/travis/miniconda/bin:$PATH
- conda update --yes conda
# Make sure that interactive matplotlib backends work
- export DISPLAY=:99.0
- sh -e /etc/init.d/xvfb start
install:
# CONDA
- conda create --yes -n test -c astropy-ci-extras python=$TRAVIS_PYTHON_VERSION
- source activate test
# DEPENDENCIES
# Leave the `numpy=$NUMPY_VERSION` in the `conda`
# install since this ensures Numpy does not get automatically upgraded.
- if [[ $DEPS == Y ]]; then $CONDA_INSTALL numpy=$NUMPY_VERSION pytest pip Cython jinja2 scipy matplotlib; fi
- if [[ $DEPS == Y ]]; then $PIP_INSTALL pytest-xdist; fi
# ASTROPY
- if [[ $DEPS == Y ]] && [[ $ASTROPY_VERSION == development ]]; then $PIP_INSTALL git+http://github.com/astropy/astropy.git#egg=astropy; fi
- if [[ $DEPS == Y ]] && [[ $ASTROPY_VERSION == stable ]]; then $CONDA_INSTALL numpy=$NUMPY_VERSION astropy; fi
# IMINUIT
# Currently need the dev version of iminuit for Python 3
# TODO: remove ipython once https://github.com/iminuit/iminuit/issues/166 is fixed
- if [[ $DEPS == Y && $TRAVIS_PYTHON_VERSION < 3 ]]; then $PIP_INSTALL iminuit; fi
- if [[ $DEPS == Y && $TRAVIS_PYTHON_VERSION > 3 ]]; then $PIP_INSTALL git+http://github.com/iminuit/iminuit.git#egg=iminuit; fi
- if [[ $DEPS == Y && $TRAVIS_PYTHON_VERSION > 3 ]]; then $CONDA_INSTALL numpy=$NUMPY_VERSION ipython; fi
# DOCUMENTATION DEPENDENCIES
# Note that this matplotlib will *not* work with py 3.x, but our sphinx build is
# currently 2.7, so that's fine
- if [[ $DOCS == Y ]]; then $CONDA_INSTALL numpy=$NUMPY_VERSION astropy-helpers sphinx; fi
# PEP8 / COVERAGE DEPENDENCIES
- if [[ $PEP8 == Y ]]; then $CONDA_INSTALL pep8; fi
- if [[ $COVERAGE == Y ]]; then $PIP_INSTALL coverage coveralls; fi
script:
- $CMD
after_success:
- if [[ $COVERAGE == Y ]]; then coveralls --rcfile='sncosmo/tests/coveragerc'; fi