forked from jquast/telnetlib3
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtox.ini
More file actions
283 lines (250 loc) · 6.14 KB
/
tox.ini
File metadata and controls
283 lines (250 loc) · 6.14 KB
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
[tox]
ignore_basepython_conflict = True
skip_missing_interpreters = True
envlist =
py{39,310,311,312,313,314,315}
black
docformatter
isort
pylint
pylint_tests
flake8
flake8_tests
pydocstyle
mypy
docs
####### Python Test Environments #######
[testenv]
basepython = python3.13
setenv =
TERM = xterm-256color
passenv =
PYTHONASYNCIODEBUG
deps =
pexpect
pytest
pytest-asyncio>=0.21
pytest-cov
pytest-timeout
pytest-xdist
trustme
usedevelop = True
commands =
pytest {posargs:--strict-markers --verbose --durations=10} telnetlib3/tests
####### Linting and Formatting Environments #######
[testenv:black]
deps =
black
commands =
black telnetlib3/ bin/
[testenv:docformatter]
basepython = python3.13
deps =
docformatter>=1.7.7
untokenize
commands =
docformatter \
--in-place \
--recursive \
--pre-summary-newline \
--wrap-summaries=100 \
--wrap-descriptions=100 \
{toxinidir}/telnetlib3/ \
{toxinidir}/docs/conf.py
[testenv:docformatter_check]
basepython = python3.13
deps =
docformatter>=1.7.7
untokenize
commands =
docformatter \
--check \
--diff \
--recursive \
--pre-summary-newline \
--wrap-summaries=100 \
--wrap-descriptions=100 \
{toxinidir}/telnetlib3/ \
{toxinidir}/docs/conf.py
[testenv:flake8]
deps =
flake8
commands =
flake8 --exclude=tests telnetlib3/ bin/
[testenv:flake8_tests]
deps =
flake8
commands =
# F811: pytest fixtures appear as redefinitions
# E402: imports after conftest fixtures
# E712: comparison to False in tests is intentional
flake8 --ignore=W504,F401,E501,F811,E402,E712,F841,W503,E203 telnetlib3/tests/
[testenv:isort]
deps =
isort
commands =
isort telnetlib3 bin
[testenv:isort_check]
deps =
isort
commands =
isort --diff --check-only telnetlib3 bin
[testenv:mypy]
deps =
mypy
commands =
mypy --strict telnetlib3
[testenv:pydocstyle]
deps =
pydocstyle
restructuredtext_lint
doc8
pygments
commands =
pydocstyle --source --explain {toxinidir}/telnetlib3
rst-lint README.rst
doc8 --ignore-path docs/_build --ignore D000 docs
[testenv:pylint]
deps =
pylint
prettytable
ucs-detect>=2
commands =
pylint {posargs} telnetlib3 bin --ignore=tests
[testenv:pylint_tests]
deps =
{[testenv]deps}
pylint
commands =
pylint \
--disable=attribute-defined-outside-init \
--disable=comparison-with-callable \
--disable=missing-class-docstring \
--disable=missing-function-docstring \
--disable=missing-module-docstring \
--disable=possibly-used-before-assignment \
--disable=redefined-outer-name \
--disable=unnecessary-dunder-call \
--disable=unpacking-non-sequence \
--disable=unused-import \
--disable=unused-variable \
{posargs} telnetlib3/tests
[testenv:codespell]
deps =
codespell
commands =
codespell --skip="*.pyc,*.log,*.debug,typescript*,htmlcov*,_build,build,data,*.egg-info,.tox,.git" \
--ignore-words-list="wont,nams,flushin,thirdparty,lient,caf,alo,implementor,untils,hel,acter" \
--uri-ignore-words-list "*" \
--summary --count
[testenv:format]
deps =
{[testenv:isort]deps}
{[testenv:black]deps}
{[testenv:docformatter]deps}
commands =
{[testenv:isort]commands}
{[testenv:black]commands}
{[testenv:docformatter]commands}
[testenv:lint]
deps =
{[testenv:flake8]deps}
{[testenv:isort_check]deps}
{[testenv:mypy]deps}
{[testenv:pydocstyle]deps}
{[testenv:pylint]deps}
{[testenv:codespell]deps}
commands =
{[testenv:flake8]commands}
{[testenv:flake8_tests]commands}
{[testenv:isort_check]commands}
{[testenv:mypy]commands}
{[testenv:pydocstyle]commands}
{[testenv:pylint]commands}
{[testenv:codespell]commands}
####### Documentation #######
[testenv:docs]
basepython = python3.12
extras = docs
commands =
sphinx-build -E -a -v -n -W \
-d {toxinidir}/docs/_build/doctrees \
{posargs:-b html} docs \
{toxinidir}/docs/_build/html
####### Tool Configs #######
[coverage:run]
branch = True
parallel = True
source = telnetlib3
omit = telnetlib3/tests/*
telnetlib3/telnetlib.py
telnetlib3/_types.py
# Too complex for good coverage, though some tests exists, it
# is tested by running a public server: telnet 1984.ws 555
telnetlib3/fingerprinting_display.py
relative_files = True
[coverage:report]
precision = 1
exclude_lines =
pragma: no cover
omit = telnetlib3/tests/*
telnetlib3/telnetlib.py
telnetlib3/_types.py
telnetlib3/fingerprinting_display.py
[coverage:paths]
source = telnetlib3/
[doc8]
max-line-length = 100
[flake8]
max-line-length = 100
exclude = .tox,build
# E203: whitespace before ':' - conflicts with black's slice formatting
# W503: line break before binary operator - conflicts with black (PEP 8 now recommends this)
# E704: abstract method stub on one line - conflicts with black
ignore = E203, W503, E704
[isort]
profile = black
line_length = 100
length_sort = 1
import_heading_stdlib = std imports
import_heading_thirdparty = 3rd party
import_heading_firstparty = local
import_heading_localfolder = local
sections = FUTURE,STDLIB,THIRDPARTY,FIRSTPARTY,LOCALFOLDER
no_lines_before = LOCALFOLDER
indented_import_headings = false
atomic = true
[pydocstyle]
ignore =
D101,
D105,
D203,
D204,
D212,
D401
[pytest]
norecursedirs = .git .tox build
asyncio_mode = auto
log_level = debug
log_format = %(levelname)8s %(filename)s:%(lineno)s %(message)s
# PTY tests require --capture=no to function (fork/pty breaks with capture)
addopts =
--strict-markers
--verbose
--capture=no
-n auto
-p no:benchmark
--color=yes
--cov
--cov-append
--cov-report=xml
--disable-pytest-warnings
--ignore=setup.py
--ignore=.tox
--ignore=telnetlib3/tests/test_benchmarks.py
--durations=10
--timeout=15
--junit-xml=.tox/results.{envname}.xml
faulthandler_timeout = 30
filterwarnings =
junit_family = xunit1