forked from jonathan-taylor/regreg
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
178 lines (173 loc) · 5.58 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
# vim ft=yaml
# Multiple lines can be made a single "virtual line" because of the way that
# Travis munges each line before executing it to print out the exit status.
# It's okay for it to be on multiple physical lines, so long as you remember:
# - There can't be any leading "-"s - All newlines will be removed, so use
# ";"s
sudo: false # To use travis container infrastructure
language: python
cache:
directories:
- $HOME/.cache/pip
env:
global:
# Maximal dependencies
- DEPENDS="cython numpy scipy matplotlib"
- EXTRA_WHEELS="https://5cf40426d9f06eb7461d-6fe47d9331aba7cd62fc36c7196769e4.ssl.cf2.rackcdn.com"
- PRE_WHEELS="https://7933911d6844c6c53a7d-47bd50c35cd79bd838daf386af554a83.ssl.cf2.rackcdn.com"
- EXTRA_PIP_FLAGS="--find-links=$EXTRA_WHEELS"
- PRE_PIP_FLAGS="--pre --find-links $PRE_WHEELS"
- INSTALL_TYPE="pip"
python:
- 3.4
- 3.5
- 3.6
matrix:
include:
- python: 2.7
env:
- COVERAGE=1
# To test minimum dependencies
# Check these dependencies against regreg/info.py and requirements.txt
- python: 2.7
env:
- DEPENDS="cython==0.18 numpy==1.7.1 scipy==0.9.0"
# Testing without matplotlib
- python: 2.7
env:
- DEPENDS="cython numpy scipy"
# Documentation doctests
- python: 2.7
env:
- DOC_DOC_TEST=1
# Setup.py install
- python: 2.7
env:
- INSTALL_TYPE=setup
- python: 2.7
env:
# Sdist install should collect all dependencies
- INSTALL_TYPE=sdist
- DEPENDS="cython numpy scipy"
- python: 2.7
env:
# Wheel install should collect all dependencies
- INSTALL_TYPE=wheel
- DEPENDS="cython numpy scipy"
- python: 2.7
env:
- INSTALL_TYPE=requirements
- DEPENDS=
# test 3.5 against pre-release builds of everything
- python: 3.5
env:
- EXTRA_PIP_FLAGS="$EXTRA_PIP_FLAGS $PRE_PIP_FLAGS"
# test python setup.py install
- python: 3.5
env:
- INSTALL_TYPE=setup
- python: 3.5
env:
- INSTALL_TYPE="pip_e"
- python: 3.5
sudo: true
dist: trusty
env:
- DOC_BUILD=1
- python: 3.5
sudo: true
dist: trusty
env:
- R_TESTS=1
- python: 2.7
sudo: true
dist: trusty
env:
- R_TESTS=1
- os: osx
osx_image: xcode7.3
language: generic
env: TRAVIS_PYTHON_VERSION=3.5
before_install:
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
source tools/travis_osx_install.sh ;
else
source tools/travis_linux_install.sh ;
fi
- python --version # just to check
- pip install -U pip
- pip install nose mock # always
- if [ -n "$PRE_DEPENDS" ]; then
pip install $EXTRA_PIP_FLAGS $PRE_DEPENDS;
fi
- pip install $EXTRA_PIP_FLAGS $DEPENDS
- if [ "${COVERAGE}" == "1" ]; then
pip install coverage coveralls;
fi
install:
# command to run tests, e.g. python setup.py test
- |
if [ "$INSTALL_TYPE" == "pip" ]; then
pip install .
elif [ "$INSTALL_TYPE" == "pip_e" ]; then
pip install -e .
elif [ "$INSTALL_TYPE" == "setup" ]; then
python setup.py install
elif [ "$INSTALL_TYPE" == "sdist" ]; then
python setup.py egg_info # check egg_info while we're here
python setup.py sdist
pip install $EXTRA_PIP_FLAGS dist/*.tar.gz
elif [ "$INSTALL_TYPE" == "wheel" ]; then
pip install wheel
python setup.py bdist_wheel
pip install $EXTRA_PIP_FLAGS dist/*.whl
elif [ "$INSTALL_TYPE" == "requirements" ]; then
pip install $EXTRA_PIP_FLAGS -r requirements.txt
pip install -r requirements.txt
python setup.py install
fi
script:
- |
echo "backend : agg" > matplotlibrc
if [ "$DOC_BUILD" ]; then # doc build
sudo apt-get install software-properties-common
sudo add-apt-repository -y ppa:marutter/rrutter
sudo apt-get update
sudo apt-get install -y r-base r-base-dev
# gglasso has been removed from CRAN archive
# try a hard install from old version
sudo Rscript -e "install.packages('https://cran.r-project.org/src/contrib/Archive/gglasso/gglasso_1.3.tar.gz')"
sudo Rscript -e "install.packages(c('glmnet', 'lars', 'Matrix', 'SLOPE'), repos='http://cloud.r-project.org');"
pip install -r doc-requirements.txt
cd doc
# Build without the API documentation, for the doctests
make htmlonly
make doctest
# Now build the full docs
make clean
make html
elif [ "$R_TESTS" ]; then
sudo apt-get install software-properties-common
sudo add-apt-repository -y ppa:marutter/rrutter
sudo apt-get update
sudo apt-get install -y r-base r-base-dev
pip install -r test-requirements.txt
pip install -e .
nosetests $DOCTEST_ARGS --verbose regreg
else
# Doctests only on platforms that have compatible fp output
if [ `uname` == "Darwin" ] ||
[ "${TRAVIS_PYTHON_VERSION:0:1}" == "3" ]; then
DOCTEST_ARGS="--with-doctest";
fi
# Change into an innocuous directory and find tests from installation
mkdir for_testing
cd for_testing
if [ "${COVERAGE}" == "1" ]; then
cp ../.coveragerc .
COVER_ARGS="--with-coverage --cover-package regreg"
fi
nosetests $DOCTEST_ARGS --verbose $COVER_ARGS regreg
fi
after_success:
- if [ "${COVERAGE}" == "1" ]; then coveralls; fi