File: tox.ini

package info (click to toggle)
python-blessed 1.21.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 8,296 kB
  • sloc: python: 7,215; makefile: 13; sh: 7
file content (283 lines) | stat: -rw-r--r-- 6,302 bytes parent folder | download
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]
requires =
    # Pin virtualenv to the last version supporting 2.7 and 3.6
    virtualenv<=20.21.1
ignore_basepython_conflict = True
skip_missing_interpreters = True
envlist =
    about
    stamp
    autopep8
    docformatter
    isort
    pylint
    pylint_tests
    flake8
    flake8_tests
    pydocstyle
    mypy
    sphinx
    py{27,35,36,37,38,39,310,311,312,313}


####### Python Test Environments #######

[testenv]
basepython = python3.13
passenv =
    TEST_QUICK
    TEST_KEYBOARD
    TEST_RAW
setenv =
    TEST_QUICK = {env:TEST_QUICK:1}
deps =
    pytest
    pytest-cov
    pytest-xdist
commands =
    pytest {posargs: --strict-markers --verbose --durations=3} tests

[testenv:py313]
setenv =
    TEST_QUICK = {env:TEST_QUICK:0}
    TEST_KEYBOARD = {env:TEST_KEYBOARD:1}
deps =
    {[testenv]deps}
    pytest-rerunfailures
commands =
    pytest {posargs: --reruns 5 --strict-markers --verbose --durations=3} tests

[testenv:py27]
setenv =
    TEST_QUICK = {env:TEST_QUICK:0}
    TEST_KEYBOARD = {env:TEST_KEYBOARD:1}
deps =
    mock
    pytest <= 4.7
    pytest-cov  # 2.7 still supported as of 2.12.1
    pytest-xdist==1.34.0


####### Linting and Formatting Environments #######

[testenv:autopep8]
deps =
    autopep8
commands =
    autopep8 --in-place  --recursive --aggressive --aggressive blessed/ bin/ setup.py

[testenv:docformatter]
# docformatter pinned due to https://github.com/PyCQA/docformatter/issues/264
deps =
    docformatter<1.7.4
    untokenize
commands =
    docformatter \
        --in-place \
        --recursive \
        --pre-summary-newline \
        --wrap-summaries=100 \
        --wrap-descriptions=100 \
        {toxinidir}/blessed/ \
        {toxinidir}/bin \
        {toxinidir}/setup.py \
        {toxinidir}/docs/conf.py

[testenv:docformatter_check]
# docformatter pinned due to https://github.com/PyCQA/docformatter/issues/264
deps =
    docformatter<1.7.4
    untokenize
commands =
    docformatter \
        --check \
        --recursive \
        --pre-summary-newline \
        --wrap-summaries=100 \
        --wrap-descriptions=100 \
        {toxinidir}/blessed/ \
        {toxinidir}/bin \
        {toxinidir}/setup.py \
        {toxinidir}/docs/conf.py

[testenv:flake8]
deps =
    flake8
commands =
    flake8 --exclude=tests,docs/sphinxext/github.py setup.py docs/ blessed/ bin/

[testenv:flake8_tests]
deps =
    {[testenv:flake8]deps}
commands =
    flake8 --ignore=W504,F401 tests/

[testenv:isort]
deps =
    {[testenv]deps}
    -r docs/requirements.txt
    isort
commands =
    isort blessed


[testenv:isort_check]
deps =
    {[testenv:isort]deps}
commands =
    isort --diff --check-only blessed

[testenv:linkcheck]
deps =
    -r {toxinidir}/docs/requirements.txt
commands =
    sphinx-build -v -W -d {toxinidir}/docs/_build/doctrees -b linkcheck docs docs/_build/linkcheck

[testenv:mypy]
deps =
    mypy
commands =
    mypy --strict {toxinidir}/blessed

[testenv:pydocstyle]
deps =
    pydocstyle
    restructuredtext_lint
    doc8
    pygments
commands =
    pydocstyle --source --explain {toxinidir}/blessed
    rst-lint README.rst
    doc8 --ignore-path docs/_build --ignore D000 docs

[testenv:pylint]
deps =
    pylint
commands =
    pylint {posargs} blessed

[testenv:pylint_tests]
deps =
    pylint
commands =
    pylint \
        --disable invalid-name,import-error,import-outside-toplevel \
        --disable protected-access,superfluous-parens,unused-argument \
        {posargs} tests

[testenv:lint]
deps =
    {[testenv:docformatter_check]deps}
    {[testenv:flake8]deps}
    {[testenv:flake8_tests]deps}
    {[testenv:isort_check]deps}
    {[testenv:mypy]deps}
    {[testenv:pydocstyle]deps}
    {[testenv:pylint]deps}
    {[testenv:pylint_tests]deps}

commands =
    {[testenv:docformatter_check]commands}
    {[testenv:flake8]commands}
    {[testenv:flake8_tests]commands}
    {[testenv:isort_check]commands}
    {[testenv:mypy]commands}
    {[testenv:pydocstyle]commands}
    {[testenv:pylint]commands}
    {[testenv:pylint_tests]commands}


####### Utility Environments #######

[testenv:about]
basepython = {env:TOXPYTHON:{[testenv]basepython}}
commands =
    python -VV
    python {toxinidir}/bin/display-sighandlers.py
    python {toxinidir}/bin/display-terminalinfo.py
    python {toxinidir}/bin/display-fpathconf.py

[testenv:develop]
commands =
    {posargs}

[testenv:publish_static]
# Synchronize the artifacts in docs/_static/ with https://dxtz6bzwq9sxx.cloudfront.net/
deps =
    awscli
commands =
    aws s3 sync --exclude '*.DS_Store*' --delete --acl=public-read docs/_static/ s3://python-blessed/

[testenv:sphinx]
deps =
    -r {toxinidir}/docs/requirements.txt
commands =
    sphinx-build {posargs:-v -W -d {toxinidir}/docs/_build/doctrees -b html docs {toxinidir}/docs/_build/html}

[testenv:stamp]
commands =
    python {toxinidir}/version.py


####### TOOL CONFIGS #######

[coverage:run]
branch = True
parallel = True
source =
    blessed
omit =
    tests/*
data_file = .coverage.${TOX_ENV_NAME}

[coverage:report]
precision = 1
exclude_lines =
    pragma: no cover

[doc8]
max-line-length = 100

[flake8]
max-line-length = 100
exclude = .tox,build

[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,THIRDPARTY,FIRSTPARTY,LOCALFOLDER
no_lines_before=LOCALFOLDER
known_third_party = jinxed
atomic = true

[pydocstyle]
ignore =
    D101,  # Missing docstring in public class
    D105,  # Missing docstring in magic method
    D203,  # 1 blank line required before class docstring
    D204,  # 1 blank line required after class docstring
    D212,  # Multi-line docstring summary should start at the first line
    D401  # First line should be in imperative mood

[pytest]
addopts =
    --color=yes
    --cov
    --cov-append
    --cov-report=xml
    --disable-pytest-warnings
    --ignore=setup.py
    --ignore=.tox
    --junit-xml=.tox/results.{envname}.xml
# if any test takes over 30 seconds, dump traceback
faulthandler_timeout = 30
filterwarnings = error
junit_family = xunit1
log_format=%(levelname)s %(relativeCreated)2.2f %(filename)s:%(lineno)d %(message)s
norecursedirs = .git .tox build