-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy path.travis.yml
268 lines (263 loc) · 6.84 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
language: python
# https://docs.travis-ci.com/user/languages/python/
# Because the code depends a lot on the Python interpreter
# used (Python version and Python implementation), we want
# to test all the possible configurations, including
# deprecated versions.
# Also, on Travis, all versions do not exist on all distros
# (and when they do, they might actually correspond to
# different minor versions of the interpreter). Thus, we end
# end with a matrix to perform tests on different distros.
# Failure is allowed on versions that are known to be missing
# (these configs are tested anyway in case they come back).
matrix:
include:
- os: linux
dist: trusty
python: 2.6
- os: linux
dist: xenial
python: 2.6
- os: linux
dist: trusty
python: 2.7
- os: linux
dist: xenial
python: 2.7
- os: linux
dist: trusty
python: 3.2
- os: linux
dist: xenial
python: 3.2
- os: linux
dist: trusty
python: 3.3
- os: linux
dist: xenial
python: 3.3
- os: linux
dist: trusty
python: 3.4
- os: linux
dist: xenial
python: 3.4
- os: linux
dist: trusty
python: 3.5
- os: linux
dist: xenial
python: 3.5
- os: linux
dist: trusty
python: 3.5-dev
- os: linux
dist: xenial
python: 3.5-dev
- os: linux
dist: trusty
python: 3.6
- os: linux
dist: xenial
python: 3.6
- os: linux
dist: trusty
python: 3.6-dev
- os: linux
dist: xenial
python: 3.6-dev
- os: linux
dist: trusty
python: 3.7
- os: linux
dist: xenial
python: 3.7
- os: linux
dist: trusty
python: 3.7-dev
- os: linux
dist: xenial
python: 3.7-dev
- os: linux
dist: trusty
python: 3.8
- os: linux
dist: xenial
python: 3.8
- os: linux
dist: trusty
python: 3.8-dev
- os: linux
dist: xenial
python: 3.8-dev
- os: linux
dist: trusty
python: 3.9
- os: linux
dist: xenial
python: 3.9
- os: linux
dist: trusty
python: 3.9-dev
- os: linux
dist: xenial
python: 3.10-dev
- os: linux
dist: trusty
python: nightly
- os: linux
dist: xenial
python: nightly
- os: linux
dist: trusty
python: pypy-5.3.1
- os: linux
dist: xenial
python: pypy-5.3.1
- os: linux
dist: trusty
python: pypy-5.4.1
- os: linux
dist: xenial
python: pypy-5.4.1
- os: linux
dist: trusty
python: pypy
- os: linux
dist: xenial
python: pypy
- os: linux
dist: trusty
python: pypy3
- os: linux
dist: xenial
python: pypy3
allow_failures:
- os: linux
dist: xenial
python: 2.6
- os: linux
dist: xenial
python: 3.2
- os: linux
dist: xenial
python: 3.3
- os: linux
dist: trusty
python: 3.7
- os: linux
dist: trusty
python: 3.8
- os: linux
dist: trusty
python: 3.8-dev
- os: linux
dist: trusty
python: 3.9
- os: linux
dist: xenial
python: 3.9
- os: linux
dist: trusty
python: 3.9-dev
- os: linux
dist: xenial
python: pypy-5.3.1
- os: linux
dist: xenial
python: pypy-5.4.1
- os: linux
dist: xenial
python: pypy
- os: linux
dist: xenial
python: pypy3
install:
# From https://github.com/frol/flask-restplus-server-example/blob/master/.travis.yml
# Travis has pypy 2.5.0, which is way too old, so we upgrade it on the fly:
- |
if ([ "$TRAVIS_PYTHON_VERSION" = "pypy-5.3.1" ] ||
[ "$TRAVIS_PYTHON_VERSION" = "pypy-5.4.1" ]); then
export PYENV_ROOT="$HOME/.pyenv"
if [ -f "$PYENV_ROOT/bin/pyenv" ]; then
pushd "$PYENV_ROOT" && git pull && popd
else
rm -rf "$PYENV_ROOT" && git clone --depth 1 https://github.com/yyuu/pyenv.git "$PYENV_ROOT"
fi
case "$TRAVIS_PYTHON_VERSION" in
"pypy-5.3.1") export PYPY_VERSION="5.3.1";;
"pypy-5.4.1") export PYPY_VERSION="5.4.1";;
esac
"$PYENV_ROOT/bin/pyenv" install --skip-existing "pypy-$PYPY_VERSION"
virtualenv --python="$PYENV_ROOT/versions/pypy-$PYPY_VERSION/bin/python" "$HOME/virtualenvs/pypy-$PYPY_VERSION"
source "$HOME/virtualenvs/pypy-$PYPY_VERSION/bin/activate"
fi
- pip install --upgrade pycodestyle
- pip install pep257 || true
- pip install pydocstyle || true
- |
if ([ "$TRAVIS_PYTHON_VERSION" != "2.6" ]); then
pip install --upgrade pyflakes
fi
- |
if ([ "$TRAVIS_PYTHON_VERSION" != "nightly" ]); then
pip install unittest2
fi
- |
# https://bitbucket.org/ned/coveragepy/issues/407/coverage-failing-on-python-325-using
if ([ "$TRAVIS_PYTHON_VERSION" != "3.2" ]); then
pip install coverage
else
pip install coverage==3.7.1
fi
- |
case "$TRAVIS_PYTHON_VERSION" in
"2.6") ;; # coveralls not supported
"pypy-5.3.1") ;; # coveralls not supported
"pypy-5.4.1") ;; # coveralls installation fails
"pypy") ;; # coveralls installation fails
*) pip install coveralls;;
esac
before_script:
# Information about Python version
- echo $TRAVIS_PYTHON_VERSION
- python -VV
- python -c "import sys; print(sys.version_info)" || true
- python -c "import sys; print(sys._git)" || true
- pycodestyle --ignore=E501,E231,E203,W503,E126,E123,E223,E226 *.py */*.py
- pycodestyle --select=E501,E231,E203,W503,E126,E123,E223,E226 *.py */*.py || true
- pep257 *.py */*.py || true
- pydocstyle *.py */*.py || true
- pyflakes . || true
script:
# Coverage leads to a different behavior sometimes - so we run the tests
# without and with coverage and failures are allowed on the second- #36
# (Except for Python 2.6 because the direct run fails)
- |
if ([ "$TRAVIS_PYTHON_VERSION" == "2.6" ]); then
:
elif ([ "$TRAVIS_PYTHON_VERSION" == "nightly" ]); then
python -m unittest discover --start-directory=didyoumean --pattern=*.py
else
python -m unittest2 discover --start-directory=didyoumean --pattern=*.py
fi
- |
if ([ "$TRAVIS_PYTHON_VERSION" == "2.6" ]); then
coverage run -m unittest2 discover --start-directory=didyoumean --pattern=*.py
elif ([ "$TRAVIS_PYTHON_VERSION" == "nightly" ]); then
coverage run -m unittest discover --start-directory=didyoumean --pattern=*.py || true
else
coverage run -m unittest2 discover --start-directory=didyoumean --pattern=*.py || true
fi
- python didyoumean/didyoumean_sugg_tests.py
- python didyoumean/readme_examples.py
- |
if ([ "$TRAVIS_PYTHON_VERSION" != "pypy-5.4.1" ]); then
pip install .
else
pip install . || true # May fail but let's try anyway (see Issue #45)
fi
after_success:
- coveralls
# Information about Python builtins/keywords
# - python -c "import sys; import keyword; print({sys.version_info: {'kword': set(keyword.kwlist), 'builtins': set(dir(__builtins__))}})" || true