-
Notifications
You must be signed in to change notification settings - Fork 66
Expand file tree
/
Copy pathtox.ini
More file actions
243 lines (206 loc) · 7.28 KB
/
tox.ini
File metadata and controls
243 lines (206 loc) · 7.28 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
[tox]
envlist = update, fetch, compile, autopep8, docformatter, docformatter_check, isort, isort_check, pylint, pylint_tests, flake8, flake8_tests, pydocstyle, mypy, codespell, format, lint, docs, verify_tables, py{38, 39, 310, 311, 312, 313, 314}, pypy{38, 39, 310, 311}
skip_missing_interpreters = true
[base]
pip_compile_command = pip-compile --resolver=backtracking --strip-extras --no-emit-index-url --allow-unsafe --upgrade
[testenv]
deps = -r requirements-tests39.txt
commands = {envpython} -m pytest --cov-config={toxinidir}/tox.ini {posargs:\
-n auto \
--verbose \
--junit-xml=.tox/results.{envname}.xml \
--durations=3 \
} \
--log-format='%(levelname)s %(relativeCreated)2.2f %(filename)s:%(lineno)d %(message)s' \
tests
passenv = TEST_QUICK,TEST_KEYBOARD,TEST_RAW
[isort]
line_length = 100
indent = ' '
multi_line_output = 1
length_sort = 1
import_heading_stdlib = std imports
import_heading_thirdparty = 3rd party
import_heading_firstparty = local
import_heading_localfolder = local
sections=FUTURE,STDLIB,TYPING_STDLIB,THIRDPARTY,FIRSTPARTY,LOCALFOLDER
no_lines_before=LOCALFOLDER
known_first_party = wcwidth
known_third_party = codecov,blessed
known_typing_stdlib = typing,typing_extensions
atomic = true
[pytest]
norecursedirs = .git .tox build
addopts = --disable-pytest-warnings
--cov-append --cov-report=html --color=yes --ignore=.tox
--cov=wcwidth
filterwarnings =
error
junit_family = xunit1
[flake8]
exclude = .tox,build
max-line-length = 100
ignore = E402,E501,F401,W503,W504
[coverage:run]
branch = True
source = wcwidth
parallel = True
relative_files = True
[coverage:report]
omit = tests/*
exclude_lines = pragma: no cover
precision = 1
[coverage:paths]
source = wcwidth/
# wcwidth itself has no 3rd party dependencies, but to ensure the best available
# version for the newest to oldest python versions for testing, must also use some
# targeted versions to 'compile' those requirements into their frozen form,
# otherwise incompatible packages would be pinned. At the time of this writing the
# files compiled for version 3.9 and later are compiled by python3.13 [WIP].
[testenv:compile]
basepython = python3.13
commands = python -m compileall {toxinidir}/wcwidth {toxinidir}/bin {toxinidir}/tests {toxinidir}/docs
[testenv:update_requirements_update]
basepython = python3.13
deps = pip-tools
commands = {[base]pip_compile_command} requirements-update.in -o requirements-update.txt
[testenv:update_requirements_docs]
basepython = python3.12
deps = pip-tools
commands = {[base]pip_compile_command} requirements-docs.in -o docs/requirements.txt
[testenv:update_requirements39]
basepython = python3.9
deps = pip-tools
commands = {[base]pip_compile_command} requirements-tests39.in -o requirements-tests39.txt
[testenv:update_requirements38]
basepython = python3.8
deps = pip-tools
commands = {[base]pip_compile_command} requirements-tests38.in -o requirements-tests38.txt
[testenv:py38]
deps = -r requirements-tests38.txt
[testenv:pypy38]
deps = -r requirements-tests38.txt
[testenv:update]
basepython = python3.14
usedevelop = true
deps = -r requirements-update.txt
commands = python {toxinidir}/bin/update-tables.py {posargs:--fetch-all-versions}
[testenv:fetch]
basepython = python3.14
usedevelop = true
deps = -r requirements-update.txt
commands = - python {toxinidir}/bin/update-tables.py {posargs:--only-fetch}
[testenv:autopep8]
basepython = python3.14
deps = autopep8
commands =
autopep8 \
--in-place \
--recursive \
--aggressive \
--aggressive \
--max-line-length 100 \
wcwidth/ bin/ tests/
[testenv:isort]
deps = isort
basepython = python3.13
commands = isort --quiet --apply --recursive wcwidth tests bin
[testenv:pylint]
basepython = python3.13
deps = pylint
commands = pylint --rcfile={toxinidir}/.pylintrc \
--ignore=tests,docs,conf.py,build,distutils,.pyenv,.git,.tox \
{posargs:{toxinidir}}/wcwidth
[testenv:flake8]
basepython = python3.13
deps = flake8
commands = flake8 --exclude=tests docs/ wcwidth/ bin/ tests/
[testenv:docs]
# matches .readthedocs.yaml and environment
basepython = python3.12
deps = -r {toxinidir}/docs/requirements.txt
commands = sphinx-build -W docs/ build/sphinx
[testenv:verify_tables]
basepython = python3.13
commands = python {toxinidir}/bin/verify-table-integrity.py
[testenv:linkcheck]
basepython = python3.11
deps = -r {toxinidir}/docs/requirements.txt
commands = sphinx-build -v -W -d {toxinidir}/docs/_build/doctrees -b linkcheck docs docs/_build/linkcheck
[testenv:codecov]
basepython = python{env:TOXPYTHON:{env:TRAVIS_PYTHON_VERSION:3.10}}
passenv = TOXENV,CI,TRAVIS,TRAVIS_*,CODECOV_*
deps = codecov
commands = codecov -e TOXENV
[testenv:pydocstyle]
basepython = python3.13
deps = pydocstyle
doc8
pygments
commands = pydocstyle --source --explain {toxinidir}/wcwidth
doc8 --ignore-path docs/_build --ignore-path docs/requirements.txt --ignore D000 --max-line-length 100 docs
[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}/wcwidth/ {toxinidir}/bin {toxinidir}/tests/
[testenv:docformatter_check]
basepython = python3.13
deps = {[testenv:docformatter]deps}
commands = docformatter --check --diff --recursive --pre-summary-newline \
--wrap-summaries=100 --wrap-descriptions=100 \
{toxinidir}/wcwidth/ {toxinidir}/bin {toxinidir}/tests/
[testenv:isort_check]
basepython = python3.13
deps = isort
commands = isort --diff --check-only wcwidth tests bin
[testenv:flake8_tests]
basepython = python3.13
deps = flake8
commands = flake8 --ignore=E501,W504,F401 tests/
[testenv:pylint_tests]
basepython = python3.13
deps = pytest
pylint
commands = pylint --rcfile={toxinidir}/.pylintrc \
--disable=protected-access,unused-argument,missing-function-docstring,line-too-long \
tests
[testenv:mypy]
basepython = python3.14
deps = mypy
commands = mypy --strict wcwidth
[mypy]
warn_unused_configs = true
warn_redundant_casts = true
warn_unused_ignores = true
[testenv:codespell]
basepython = python3.13
deps = codespell
commands = codespell --skip="*.pyc,htmlcov,_build,build,*.egg-info,.tox,data,./tests/*.txt,*.csv,*.ods,table_*.py,docs/specs.rst,*.isorted" \
--ignore-words-list="thirdparty,claus,oclock,womens,aprox" \
--uri-ignore-words-list '*' \
--summary --count
[testenv:format]
basepython = python3.13
deps = {[testenv:isort]deps}
{[testenv:docformatter]deps}
{[testenv:autopep8]deps}
commands = {[testenv:isort]commands}
{[testenv:docformatter]commands}
{[testenv:autopep8]commands}
[testenv:lint]
basepython = python3.13
deps = {[testenv:flake8]deps}
{[testenv:isort_check]deps}
{[testenv:pydocstyle]deps}
{[testenv:pylint_tests]deps}
{[testenv:codespell]deps}
commands = {[testenv:flake8]commands}
{[testenv:flake8_tests]commands}
{[testenv:isort_check]commands}
{[testenv:pydocstyle]commands}
{[testenv:pylint]commands}
{[testenv:pylint_tests]commands}
{[testenv:codespell]commands}