forked from statsmodels/statsmodels
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
163 lines (152 loc) · 5.25 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
# Travis script that uses miniconda in place of the system installed python
# versions. Allows substantial flexibility for choosing versions of
# required packages and is simpler to use to test up-to-date scientific Python
# stack
dist: bionic
language: python
cache:
- directories:
- $HOME/.cache/pip
- $TRAVIS_BUILD_DIR/docs/source/examples/notebooks
git:
depth: 10000
env:
# Default values for common packages, override as needed
global:
- OPTIONAL=
- COVERAGE=false
- USE_MATPLOTLIB=true
- USE_CVXOPT=true
- MATPLOTLIB=
- DOCBUILD=false
- LINT=false
- MKL_NUM_THREADS=1 # Enforce single thread
- NUMEXPR_NUM_THREADS=1
- OMP_NUM_THREADS=1
- OPENBLAS_NUM_THREADS=1
- PYTHONHASHSEED=0 # Ensure tests are correctly gathered by xdist
- BLAS="mkl blas=*=mkl" # Use Intel MKL by default
- BUILD_INIT=tools/ci/travis_conda.sh
- DEPEND_ALWAYS="pyyaml joblib pip colorama"
- # Doctr deploy key for statsmodels/statsmodels.github.io
- secure: "AzwB23FWdilHKVcEJnj57AsoY5yKTWT8cQKzsH2ih9i08wIXvZXP/Ui8XRDygV9tDKfqGVltC7HpBBDE3C4ngeMlis4uuKWlkp0O1757YQe+OdDnimuDZhrh3ILEk7xW3ab5YizjLeyv3iiBW7cNS5z8W3Yu8HeJPkr6Ck30gAA="
- SM_CYTHON_COVERAGE=false # Run takes > 1 hour and so not feasible
- PYTEST_OPTIONS=--skip-slow # skip slow on travis since tested on azure
- XDIST_OPTS=""
matrix:
fast_finish: true
include:
# Documentation build (on Python 3.7 + cutting edge packages). Slowest build
- python: 3.8
env:
- BUILD_INIT=tools/ci/travis_pip.sh
- USE_MATPLOTLIB=false
- USE_CVXOPT=false
- LINT=true
- python: 3.7
env:
- PYTHON=3.7
- DOCBUILD=true
# Python 3.7 + fixed pandas
- python: 3.7
env:
- PYTHON=3.7
- PANDAS=0.25
- NUMPY=1.17
- SCIPY=1.4
- COVERAGE=true
- PYTEST_OPTIONS=
# Python 3.6 + legacy blas + older pandas
- python: 3.6
env:
- PYTHON=3.6
- NUMPY=1.16
- PANDAS=0.24
- SCIPY=1.3
- BLAS="nomkl blas=*=openblas"
- COVERAGE=true
- PYTEST_OPTIONS=
# Python 3.6 + oldest packages
- python: 3.6
env:
- PYTHON=3.6
- NUMPY=1.15
- SCIPY=1.2
- PANDAS=0.23
- MATPLOTLIB=2
- LINT=true
# Latest pre-release packages
- python: 3.8
env:
- PIP_PRE=true
- BUILD_INIT=tools/ci/travis_pip.sh
- os: osx
language: generic
env:
- PYTHON=3.7
allow_failures:
# pre-testing is a little fragile. Make it an FYI.
- python: 3.8
env:
- PIP_PRE=true
- BUILD_INIT=tools/ci/travis_pip.sh
notifications:
email:
on_success: always
before_install:
# Skip if commit message contains [skip travis] or [travis skip]
- COMMIT_MESSAGE=$(git show -s $TRAVIS_COMMIT_RANGE | awk 'BEGIN{count=0}{if ($1=="Author:") count++; if (count==1) print $0}')
- if [[ $TRAVIS_PULL_REQUEST == false ]]; then COMMIT_MESSAGE=${TRAVIS_COMMIT_MESSAGE}; fi
- if echo "$COMMIT_MESSAGE" | grep -E '\[(skip travis|travis skip)\]'; then exit 0 ; fi
# Show information about CPU running job to understand BLAS issues
- if [ "$TRAVIS_OS_NAME" = "linux" ]; then sudo lshw -class processor; fi
- if [ "$TRAVIS_OS_NAME" = "osx" ]; then sysctl -a | grep machdep.cpu; fi
# Fix for headless TravisCI
- "export DISPLAY=:99.0"
- if [ "$TRAVIS_OS_NAME" = "linux" ]; then ( sh -e /etc/init.d/xvfb start )& fi
- if [ "$TRAVIS_OS_NAME" = "osx" ]; then ( sudo Xvfb :99 -ac -screen 0 1024x768x8; echo ok )& fi
# Avoid noise from matplotlib
- mkdir -p $HOME/.config/matplotlib
- SRCDIR=$PWD
# Source recipe to install packages
- source $BUILD_INIT
- pip install pytest pip pytest-randomly nose jupyter_client nbformat
# Moved to enable Python 3.8 since cvxopt wheel is not available
- if [ ${USE_CVXOPT} = true ]; then pip install cvxopt; fi
# Pin to 1.29 for now due to test discovery issues
- if [ "$TRAVIS_OS_NAME" = "osx" ]; then pip install "pytest-xdist==1.29"; fi;
- |
if [ ${COVERAGE} = true ]; then
pip install codecov coverage coveralls pytest-cov
export COVERAGE_OPTS="--cov=statsmodels --cov-report="
echo "Cython coverage:" ${SM_CYTHON_COVERAGE}
else
export COVERAGE_OPTS=""
fi
- pip install flake8
- pip list
- export SRCDIR=$PWD
# Install packages
install:
# Bug in NumPy < 1.16.1 that raises ValueError on size mismatch
- if [[ ${NUMPY} != "1.15" ]]; then pip install -e .; else python setup.py develop; fi
before_script:
- if [[ ${DOCBUILD} = true ]]; then source tools/ci/docbuild_install.sh; fi;
- if [[ ${TRAVIS_OS_NAME} = "osx" ]]; then export XDIST_OPTS="-n 2"; fi
script:
# Show versions
- python -c 'import statsmodels.api as sm; sm.show_versions();'
# docbuild or run tests
- |
if [[ ${DOCBUILD} = true ]]; then
cd ${SRCDIR}/docs
source ${SRCDIR}/tools/ci/docbuild.sh;
else
echo pytest -r a ${COVERAGE_OPTS} statsmodels --skip-examples ${XDIST_OPTS} ${PYTEST_OPTIONS}
pytest -r a ${COVERAGE_OPTS} statsmodels --skip-examples ${XDIST_OPTS} ${PYTEST_OPTIONS}
fi
- cd $SRCDIR
- ./lint.sh
after_success:
- if [[ ${COVERAGE} = true ]]; then coveralls; fi
- if [[ ${COVERAGE} = true ]]; then codecov; fi