forked from falconry/falcon
-
Notifications
You must be signed in to change notification settings - Fork 0
/
tox.ini
322 lines (260 loc) · 8.11 KB
/
tox.ini
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
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
[tox]
# --------------------------------------------------------------------
#
# NOTE(kgriffs): The py27, and py36 envs are required when
# checking combined coverage. To check coverage:
#
# $ tools/mintest.sh
#
# Which is equivalent to:
#
# $ rm -f .coverage.*
# $ tox -e py27,py36,pep8 && tools/testing/combine_coverage.sh
#
# You can then drill down into coverage details by opening the HTML
# report at ".coverage_html/index.html".
#
# If you are using pyenv and get an error along the lines of
# "failed to get version_info", you may need to activate all of
# the python version required by tox before trying again. For
# example:
#
# $ pyenv shell 2.7.13 3.6.2
#
# --------------------------------------------------------------------
envlist = py27,
py36,
pep8,
docs
[testenv]
setenv =
PIP_CONFIG_FILE={toxinidir}/pip.conf
deps = -r{toxinidir}/requirements/tests
commands = {toxinidir}/tools/clean.sh {toxinidir}/falcon
pytest tests []
# --------------------------------------------------------------------
# Coverage
# --------------------------------------------------------------------
[with-coverage]
whitelist_externals = mkdir
mv
commands = {toxinidir}/tools/clean.sh {toxinidir}/falcon
coverage run -m pytest tests []
[testenv:py27]
deps = {[testenv]deps}
pytest-randomly
whitelist_externals = {[with-coverage]whitelist_externals}
; setenv = TOXINIDIR={toxinidir}
commands = {[with-coverage]commands}
[testenv:py36]
deps = {[testenv]deps}
pytest-randomly
jsonschema
whitelist_externals = {[with-coverage]whitelist_externals}
commands = {[with-coverage]commands}
# --------------------------------------------------------------------
# Additional test suite environments
# --------------------------------------------------------------------
[testenv:py34]
basepython = python3.4
[testenv:pypy]
basepython = pypy
[testenv:pypy3]
basepython = pypy3
# --------------------------------------------------------------------
# Debugging
# --------------------------------------------------------------------
[with-debug-tools]
deps = -r{toxinidir}/requirements/tests
pdbpp
[testenv:py2_debug]
basepython = python2.7
deps = {[with-debug-tools]deps}
funcsigs
jsonschema
[testenv:py3_debug]
basepython = python3.6
deps = {[with-debug-tools]deps}
# --------------------------------------------------------------------
# ujson
# --------------------------------------------------------------------
[with-ujson]
deps = -r{toxinidir}/requirements/tests
ujson
[testenv:py27_ujson]
basepython = python2.7
deps = {[with-ujson]deps}
[testenv:py35_ujson]
basepython = python3.5
deps = {[with-ujson]deps}
[testenv:py36_ujson]
basepython = python3.6
deps = {[with-ujson]deps}
# --------------------------------------------------------------------
# Cython
# --------------------------------------------------------------------
[with-cython]
deps = -r{toxinidir}/requirements/tests
cython
[testenv:py27_cython]
basepython = python2.7
deps = {[with-cython]deps}
[testenv:py34_cython]
basepython = python3.4
deps = {[with-cython]deps}
[testenv:py35_cython]
basepython = python3.5
deps = {[with-cython]deps}
[testenv:py36_cython]
basepython = python3.6
deps = {[with-cython]deps}
# --------------------------------------------------------------------
# Smoke testing with a sample app
# --------------------------------------------------------------------
[smoke-test]
commands = falcon-bench -t 1 -b falcon-ext
[testenv:py27_smoke]
basepython = python2.7
deps = -r{toxinidir}/requirements/bench
commands = {[smoke-test]commands}
[testenv:py27_smoke_cython]
basepython = python2.7
deps = -r{toxinidir}/requirements/bench
cython
commands = {[smoke-test]commands}
[testenv:py36_smoke]
basepython = python3.6
deps = -r{toxinidir}/requirements/bench
commands = {[smoke-test]commands}
[testenv:py36_smoke_cython]
basepython = python3.6
deps = -r{toxinidir}/requirements/bench
cython
commands = {[smoke-test]commands}
# --------------------------------------------------------------------
# Lint
# --------------------------------------------------------------------
[testenv:py3kwarn]
basepython = python2.7
deps = py3kwarn
commands = py3kwarn falcon
[testenv:pep8]
deps = flake8
flake8-quotes
flake8-import-order
# NOTE(kgriffs): Run with py27 since some code branches assume the
# unicode type is defined, and pep8 complains in those cases when
# running under py3.
basepython = python2.7
commands = flake8 \
--max-complexity=15 \
--exclude=.ecosystem,.eggs,.tox,.venv,build,dist,docs,examples,falcon/bench/nuts \
--ignore=F403 \
--max-line-length=99 \
--import-order-style=google \
--application-import-names=falcon \
[]
[testenv:pep8-examples]
deps = flake8
flake8-quotes
flake8-import-order
# NOTE(kgriffs): Run with py27 since some code branches assume the
# unicode type is defined, and pep8 complains in those cases when
# running under py3.
basepython = python2.7
commands = flake8 examples \
--max-complexity=12 \
--ignore=F403 \
--max-line-length=99 \
--import-order-style=google \
--application-import-names=look \
[]
# --------------------------------------------------------------------
# For viewing environ dicts generated by various WSGI servers
# --------------------------------------------------------------------
[testenv:py27_dump_uwsgi]
basepython = python2.7
deps = uwsgi
commands = uwsgi --http localhost:8000 --wsgi-file {toxinidir}/tests/dump_wsgi.py
[testenv:py27_dump_gunicorn]
basepython = python2.7
deps = gunicorn
commands = gunicorn -b localhost:8000 tests.dump_wsgi
[testenv:py36_dump_gunicorn]
basepython = python3.6
deps = gunicorn
commands = gunicorn -b localhost:8000 tests.dump_wsgi
[testenv:py27_dump_waitress]
basepython = python2.7
deps = waitress
commands = waitress-serve --listen=localhost:8000 tests.dump_wsgi:application
[testenv:py27_dump_wsgiref]
basepython = python2.7
commands = python tests/dump_wsgi.py
[testenv:py36_dump_wsgiref]
basepython = python3.6
commands = python tests/dump_wsgi.py
# --------------------------------------------------------------------
# Benchmarking
# --------------------------------------------------------------------
[testenv:py27_bench]
basepython = python2.7
deps = -r{toxinidir}/requirements/bench
commands = falcon-bench []
[testenv:py27_bench_cython]
basepython = python2.7
deps = -r{toxinidir}/requirements/bench
cython
commands = falcon-bench []
[testenv:py34_bench]
basepython = python3.4
deps = -r{toxinidir}/requirements/bench
commands = falcon-bench []
[testenv:py34_bench_cython]
basepython = python3.4
deps = -r{toxinidir}/requirements/bench
cython
commands = falcon-bench []
[testenv:py35_bench]
basepython = python3.5
deps = -r{toxinidir}/requirements/bench
commands = falcon-bench []
[testenv:py35_bench_cython]
basepython = python3.5
deps = -r{toxinidir}/requirements/bench
cython
commands = falcon-bench []
[testenv:py36_bench]
basepython = python3.6
deps = -r{toxinidir}/requirements/bench
commands = falcon-bench []
[testenv:py36_bench_cython]
basepython = python3.6
deps = -r{toxinidir}/requirements/bench
cython
commands = falcon-bench []
[testenv:pypy_bench]
basepython = pypy
deps = -r{toxinidir}/requirements/bench
commands = falcon-bench []
[testenv:pypy3_bench]
basepython = pypy3
deps = -r{toxinidir}/requirements/bench
commands = falcon-bench []
# --------------------------------------------------------------------
# Documentation
# --------------------------------------------------------------------
[testenv:docs]
basepython = python2.7
deps = -r{toxinidir}/requirements/docs
commands =
sphinx-build -j 4 -W -E -b html docs docs/_build/html []
# --------------------------------------------------------------------
# Ecosystem
# --------------------------------------------------------------------
[testenv:hug]
basepython = python3.6
deps = virtualenv
commands =
{toxinidir}/tools/testing/install_hug.sh
{toxinidir}/tools/testing/test_hug.sh