/
.travis.yml
286 lines (248 loc) · 7.73 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
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
# Control file for Travis CI (https://travis-ci.org)
# Must be located in the root directory of the Git repository.
# Commit depth that is checked out.
git:
depth: 50
# By default, notification emails are sent to the PR creator and commiter.
notifications:
email: false
sudo: required
# Disabling the distro, so we get the latest.
# Note that for Python 3.7 and higher, at least Ubuntu xenial is required,
# which is the default on Travis since 6/2019.
# dist:
# - xenial
# We define the job matrix explicitly, in order to be able to minimize the
# combinations of runtime environments.
# For OS-X, using an explicit matrix is required anyway, because Travis at
# this point only has half-baked support for Python on OS-X that does
# not work. Also, on OS-X, it needs to be invoked with language=generic
# and an empty 'python' variable in order to prevent that Travis attempts
# to install Python.
matrix:
include:
- os: linux
language: python
python: "2.7"
env:
- PACKAGE_LEVEL=minimum
- os: linux
language: python
python: "2.7"
env:
- PACKAGE_LEVEL=latest
# - os: linux
# language: python
# python: "3.4"
# env:
# - PACKAGE_LEVEL=minimum
- os: linux
language: python
python: "3.4"
env:
- PACKAGE_LEVEL=latest
# - os: linux
# language: python
# python: "3.5"
# env:
# - PACKAGE_LEVEL=minimum
# - os: linux
# language: python
# python: "3.5"
# env:
# - PACKAGE_LEVEL=latest
# - os: linux
# language: python
# python: "3.6"
# env:
# - PACKAGE_LEVEL=minimum
# - os: linux
# language: python
# python: "3.6"
# env:
# - PACKAGE_LEVEL=latest
# - os: linux
# language: python
# python: "3.7"
# env:
# - PACKAGE_LEVEL=minimum
# - os: linux
# language: python
# python: "3.7"
# env:
# - PACKAGE_LEVEL=latest
- os: linux
language: python
python: "3.8"
env:
- PACKAGE_LEVEL=minimum
- os: linux
language: python
python: "3.8"
env:
- PACKAGE_LEVEL=latest
# - os: linux
# language: python
# python: "pypy" # currently Python 2.7.13, PyPy 7.1.1
# env:
# - PACKAGE_LEVEL=minimum
# - os: linux
# language: python
# python: "pypy" # currently Python 2.7.13, PyPy 7.1.1
# env:
# - PACKAGE_LEVEL=latest
# TODO: pypy3 disabled due to install error with typed-ast (from pylint)
# - os: linux
# language: python
# python: "pypy3" # currently Python 3.6.1, PyPy 7.1.1-beta0
# env:
# - PACKAGE_LEVEL=minimum
# TODO: pypy3 disabled due to install error with typed-ast (from pylint)
# - os: linux
# language: python
# python: "pypy3" # currently Python 3.6.1, PyPy 7.1.1-beta0
# env:
# - PACKAGE_LEVEL=latest
# - os: osx
# osx_image: xcode9.4 # macOS 10.13.6 with python2 @ 2.7.17
# language: generic
# python:
# env:
# - PYTHON=2
# - PACKAGE_LEVEL=minimum
# - os: osx
# osx_image: xcode9.4 # macOS 10.13.6 with python2 @ 2.7.17
# language: generic
# python:
# env:
# - PYTHON=2
# - PACKAGE_LEVEL=latest
# - os: osx
# osx_image: xcode12 # macOS 10.15.5 with python3 @ 3.7.7, upgraded to 3.8.3
# language: generic
# python:
# env:
# - PYTHON=3
# - PACKAGE_LEVEL=minimum
# - os: osx
# osx_image: xcode12 # macOS 10.15.5 with python3 @ 3.7.7, upgraded to 3.8.3
# language: generic
# python:
# env:
# - PYTHON=3
# - PACKAGE_LEVEL=latest
before_install:
# Debug original Python versions on macOS
- sh -c "which python; python --version"
- sh -c "which python2; python2 --version"
- sh -c "which python3; python3 --version"
- git --version
# The scheduled runs in Travis (for the "manual-ci-run-stable" and
# "manual-ci-run" branches) are push runs, and they occur regularly even
# when no push has happened. We still want these runs to run on the latest
# level, so we manually rebase the checked out branch on the target branch
# of the PRs for these branches. Since the PR context is not known in a push
# run, we need to know its target branch. Finding that out automatically
# ended up being too difficult, so we go with a manually updated env var
# for now.
- export STABLE_BRANCH=stable_1.1
- echo TRAVIS_BRANCH=$TRAVIS_BRANCH
- echo TRAVIS_PULL_REQUEST_BRANCH=$TRAVIS_PULL_REQUEST_BRANCH
# Push run for branch manual-ci-run-stable:
- if [[ "$TRAVIS_BRANCH" == "manual-ci-run-stable" && -n $STABLE_BRANCH ]]; then
echo Rebasing to $STABLE_BRANCH;
git fetch origin $STABLE_BRANCH;
git branch $STABLE_BRANCH FETCH_HEAD;
git rebase $STABLE_BRANCH;
fi
# Push run for branch manual-ci-run:
- if [[ "$TRAVIS_BRANCH" == "manual-ci-run" ]]; then
echo Rebasing to master;
git fetch origin master;
git branch master FETCH_HEAD;
git rebase master;
fi
- git log HEAD~~~~..HEAD --oneline --decorate
- if [[ "$TRAVIS_BRANCH" == "manual-ci-run-stable" || "$TRAVIS_PULL_REQUEST_BRANCH" == "manual-ci-run-stable" ]]; then
export _MANUAL_CI_RUN=true;
fi
- if [[ "$TRAVIS_BRANCH" == "manual-ci-run" || "$TRAVIS_PULL_REQUEST_BRANCH" == "manual-ci-run" ]]; then
export _MANUAL_CI_RUN=true;
fi
- echo _MANUAL_CI_RUN=$_MANUAL_CI_RUN
# commands to install dependencies
install:
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
if [[ "${PYTHON:0:1}" == "2" ]]; then
export PYTHON_CMD=python2;
export PIP_CMD=pip2;
else
export PYTHON_CMD=python3;
export PIP_CMD=pip3;
fi;
else
export PYTHON_CMD=python;
export PIP_CMD=pip;
fi;
echo "PYTHON_CMD=$PYTHON_CMD";
echo "PIP_CMD=$PIP_CMD"
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
if [[ "${PYTHON:0:1}" == "2" ]]; then
OSX_PYTHON_PKG=python@2;
else
OSX_PYTHON_PKG=python@3;
fi;
echo "OSX_PYTHON_PKG=$OSX_PYTHON_PKG";
fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
echo "travis.yml Updating package metadata";
brew update;
fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
echo "travis.yml Installing/upgrading Python";
brew ls --versions $OSX_PYTHON_PKG;
rc=$?;
if [[ $rc == 0 ]]; then
echo "Upgrading $OSX_PYTHON_PKG";
brew upgrade $OSX_PYTHON_PKG;
else
echo "Installing $OSX_PYTHON_PKG";
brew install $OSX_PYTHON_PKG;
fi;
echo "Unlinking $OSX_PYTHON_PKG";
brew unlink $OSX_PYTHON_PKG;
echo "Linking $OSX_PYTHON_PKG";
brew link --overwrite $OSX_PYTHON_PKG;
$PIP_CMD install --upgrade pip setuptools;
echo "Checking Python and Pip";
which $PYTHON_CMD && which $PIP_CMD;
fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
echo "travis.yml Installing Python virtualenv";
$PIP_CMD install virtualenv;
virtualenv $HOME/venv -p $PYTHON_CMD && source $HOME/venv/bin/activate;
fi
- env |sort
- pip list
- make platform env
- make install
- pip list
- make develop
- pip list
# commands to run builds & tests
script:
- make build
- make builddoc
- make check
- make pylint
# TODO(nocasedict): Re-enable once nocasedict has been released
# - make installtest
- make test
- if [[ "$TRAVIS_PYTHON_VERSION" != "pypy" ]]; then make leaktest; fi
after_success:
# Note: In case of error 422 (Couldn't find a repository matching this job),
# log on to https://coveralls.io to refresh the OAuth token, and
# make sure this project is enabled there.
- if [[ "$TRAVIS_OS_NAME" == "linux" && "$PACKAGE_LEVEL" == "latest" && -z $_MANUAL_CI_RUN ]]; then
coveralls;
fi