forked from twisted/klein
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtox.ini
249 lines (167 loc) · 4.13 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
[tox]
envlist =
flake8
mypy
# Twisted 15.5 is the first version to support Python 3 (3.3+)
coverage-py{27,py,34,35,36}-tw{155,166,171,current,trunk}
docs, docs-linkcheck
skip_missing_interpreters = True
##
# Default environment: unit tests
##
[testenv]
basepython =
pypy: pypy
py27: python2.7
py34: python3.4
py35: python3.5
py36: python3.6
py37: python3.7
deps =
tw150: Twisted==15.0
tw151: Twisted==15.1
tw152: Twisted==15.2
tw153: Twisted==15.3
tw154: Twisted==15.4
tw155: Twisted==15.5
tw160: Twisted==16.0
tw161: Twisted==16.1
tw162: Twisted==16.2
tw163: Twisted==16.3
tw164: Twisted==16.4
tw165: Twisted==16.5
tw166: Twisted==16.6
tw171: Twisted==17.1
tw175: Twisted==17.5
tw179: Twisted==17.9
twcurrent: Twisted
twtrunk: https://github.com/twisted/twisted/archive/trunk.zip
{trial,coverage}: mock
coverage: coverage
passenv =
# See https://github.com/codecov/codecov-python/blob/5b9d539a6a09bc84501b381b563956295478651a/README.md#using-tox
codecov: TOXENV
codecov: CI
codecov: TRAVIS TRAVIS_*
setenv =
PIP_DISABLE_PIP_VERSION_CHECK=1
VIRTUALENV_NO_DOWNLOAD=1
commands =
"{toxinidir}/.travis/environment"
# Run trial without coverage
trial: trial --random=0 --logfile="{envlogdir}/trial.log" --temp-directory="{envlogdir}/trial.d" {posargs:klein}
# Run trial with coverage
coverage: coverage run -p "{envbindir}/trial" --random=0 --logfile="{envlogdir}/trial.log" --temp-directory="{envlogdir}/trial.d" {posargs:klein}
##
# Flake8 linting
##
[testenv:flake8]
skip_install = True
deps =
flake8
flake8-bugbear
flake8_docstrings
flake8-import-order
flake8-pep3101
pep8-naming
mccabe
basepython = python3.6
commands =
"{toxinidir}/.travis/environment"
flake8 {posargs:src/klein}
[flake8]
select = B,C,E,F,I,N,S,W
disable-noqa = True
show-source = True
doctests = True
# Codes: http://flake8.pycqa.org/en/latest/user/error-codes.html
ignore =
# too many blank lines
E302,
# too many blank lines
E303,
# function name should be lowercase
N802,
# argument name should be lowercase
N803,
# variable in function should be lowercase
N806,
# flake8-import-order: local module name space
application-import-names = klein
# McCabe complexity checker
max-complexity = 21
##
# Mypy linting
##
[testenv:mypy]
basepython = python3.6
skip_install = True
deps =
mypy
commands =
"{toxinidir}/.travis/environment"
"{toxinidir}/.travis/mypy" --config-file="{toxinidir}/tox.ini" {posargs:src}
[mypy]
# Global settings
warn_redundant_casts = True
warn_unused_ignores = True
strict_optional = True
show_column_numbers = True
# Module default settings
# disallow_untyped_calls = True
disallow_untyped_defs = True
# warn_return_any = True
# Need some stub files to get rid of this
ignore_missing_imports = True
##
# Run twistedchecker
##
[testenv:twistedchecker]
deps = twistedchecker
basepython = python2.7
commands =
"{toxinidir}/.travis/environment"
twistedchecker {posargs:klein}
##
# Run twistedchecker on changes relative to master
##
[testenv:twistedchecker-diff]
deps =
{[testenv:twistedchecker]deps}
diff_cover
basepython = python2.7
commands =
"{toxinidir}/.travis/environment"
"{toxinidir}/.travis/twistedchecker-diff" {posargs:klein}
##
# Publish to Codecov
##
[testenv:codecov]
basepython = python
skip_install = True
deps = codecov
commands =
"{toxinidir}/.travis/environment"
coverage combine --append
codecov -e TOXENV --required
##
# Build the documentation
##
[testenv:docs]
deps =
sphinx
sphinx_rtd_theme
basepython = python2.7
commands =
"{toxinidir}/.travis/environment"
sphinx-build -b html -d "{envtmpdir}/doctrees" docs docs/_build/html
##
# Check for broken links in documentation
##
[testenv:docs-linkcheck]
deps = {[testenv:docs]deps}
basepython = python2.7
commands =
"{toxinidir}/.travis/environment"
sphinx-build -b html -d "{envtmpdir}/doctrees" docs docs/_build/html
sphinx-build -b linkcheck docs docs/_build/html