-
Notifications
You must be signed in to change notification settings - Fork 58
/
tox.ini
195 lines (160 loc) · 5.68 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
[tox]
envlist = update, compile, autopep8, docformatter, isort, pylint, flake8, pydocstyle, docs, verify_tables, py{27, 35, 36, 37, 38, 39, 310, 311, 312}, pypy{27, 36, 37, 38, 39, 310}
skip_missing_interpreters = true
# https://tox.wiki/en/4.11.3/faq.html#testing-end-of-life-python-versions
requires = virtualenv<20.22.0
[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:\
--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,docopt,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=setup.py --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 through 3.11 are compiled by python3.11.
[testenv:compile]
basepython = python3.11
commands = python -m compileall {toxinidir}/wcwidth {toxinidir}/bin {toxinidir}/tests {toxinidir}/docs
[testenv:update_requirements_update]
basepython = python3.12
deps = pip-tools
commands = {[base]pip_compile_command} requirements-update.in -o requirements-update.txt
[testenv:update_requirements_docs]
basepython = python3.11
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_requirements37]
basepython = python3.7
deps = pip-tools
commands = {[base]pip_compile_command} requirements-tests37.in -o requirements-tests37.txt
[testenv:py38]
deps = -r requirements-tests37.txt
[testenv:pypy38]
deps = -r requirements-tests37.txt
[testenv:py37]
deps = -r requirements-tests37.txt
[testenv:pypy37]
deps = -r requirements-tests37.txt
[testenv:py36]
deps = -r requirements-tests36.txt
[testenv:pypy36]
deps = -r requirements-tests36.txt
[testenv:py35]
deps = -r requirements-tests37.in
[testenv:py27]
deps = -r requirements-tests37.in
[testenv:pypy27]
deps = -r requirements-tests37.in
[testenv:update]
basepython = python3.12
usedevelop = true
deps = -r requirements-update.txt
commands = python {toxinidir}/bin/update-tables.py {posargs:--no-check-last-modified}
[testenv:autopep8]
basepython = python3.11
commands =
{envbindir}/autopep8 \
--in-place \
--recursive \
--aggressive \
--aggressive \
wcwidth/ bin/ tests/ setup.py
[testenv:docformatter]
basepython = python3.11
commands =
{envbindir}/docformatter \
--in-place \
--recursive \
--pre-summary-newline \
--wrap-summaries=100 \
--wrap-descriptions=100 \
{toxinidir}/wcwidth \
{toxinidir}/bin \
{toxinidir}/setup.py \
{toxinidir}/docs/conf.py
[testenv:isort]
basepython = python3.11
commands = {envbindir}/isort --quiet --apply --recursive wcwidth tests bin
[testenv:pylint]
basepython = python3.11
commands = {envbindir}/pylint --rcfile={toxinidir}/.pylintrc \
--ignore=tests,docs,setup.py,conf.py,build,distutils,.pyenv,.git,.tox \
{posargs:{toxinidir}}/wcwidth
[testenv:flake8]
basepython = python3.11
commands = {envbindir}/flake8 --exclude=tests setup.py docs/ wcwidth/ bin/ tests/
[testenv:pydocstyle]
basepython = python3.11
commands = {envbindir}/pydocstyle --source --explain {toxinidir}/wcwidth
{envbindir}/rst-lint README.rst
{envbindir}/doc8 --ignore-path docs/_build --ignore-path docs/requirements.txt --ignore D000 docs
[testenv:docs]
basepython = python3.11
deps = -r {toxinidir}/docs/requirements.txt
commands = sphinx-build docs/ build/sphinx
[testenv:verify_tables]
basepython = python3.12
commands = python {toxinidir}/bin/verify-table-integrity.py
[testenv:sphinx]
basepython = python3.11
deps = -r {toxinidir}/docs/requirements.txt
commands = {envbindir}/sphinx-build {posargs:-v -W -d {toxinidir}/docs/_build/doctrees -b html docs {toxinidir}/docs/_build/html}
[testenv:linkcheck]
basepython = python3.11
deps = -r {toxinidir}/docs/requirements.txt
commands = {envbindir}/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