-
-
Notifications
You must be signed in to change notification settings - Fork 69
/
tox.ini
190 lines (165 loc) · 5.32 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
[tox]
basepython = python3.11
envlist =
check
# mypy
py311 # EOL 2027-10-24
py310 # EOL 2026-10-04
py39 # EOL 2025-10-05
py38 # EOL 2024-10-14
py37 # EOL 2023-06-27
# py36 # EOL 2021-12-21
# py35 # EOL 2020-09-13
# py34 # EOL 2019-03-18
coverage
skip_missing_interpreters = true
[testenv]
usedevelop = True
extras =
test
passenv =
LC_ALL
LANG
TRAVIS
TRAVIS_BRANCH
TRAVIS_OS_NAME
TRAVIS_BUILD_ID
deps =
cheroot
defusedxml
Jinja2
json5
PyYAML
pytest
pytest-cov
#pytest-remove-stale-bytecode
pytest-html
redis
requests
webtest
setenv =
COVERAGE_FILE = build/.coverage.{envname}
commands =
# Run everything from /tests folder:
python -V
pip install pip install pytest-html==4.0.0rc4
pip list
# Note: also honors .coveragerc:
pytest -ra -v -x --cov=wsgidav --durations=10 --html=build/pytest/report-{envname}.html --self-contained-html {posargs}
; pytest -ra -v -x --cov=wsgidav --durations=10 {posargs}
[testenv:coverage]
skip_install = true
deps =
coverage
setenv =
COVERAGE_FILE = build/.coverage
commands =
coverage erase
coverage combine
# ENCODING ERRORS ON Windonws: See
# https://github.com/pytest-dev/pytest-html/issues/336#issuecomment-1546864331
coverage html --directory=build --ignore-errors
; coverage xml
coverage report --fail-under=30.0 --skip-empty --ignore-errors
[testenv:mypy]
skip_install = true
deps =
mypy
changedir = {toxinidir}
commands =
mypy wsgidav tests
[testenv:flake8]
skip_install = true
deps =
# Required by flake8-bandit
# bandit
# Flake8
# Configuration is defined in the [flake8] section of setup.cfg.
# Run `flake8 --help` to see the available options of *installed* plugins.
flake8 ~=6.0
# --- Helper to generate HTML reports:
# flake8-html
# --- Useful flake8 plugins:
flake8-annotations-complexity # TAE002 too complex annotation (X > Y)
# flake8-bandit # Security checks, e.g. S101
flake8-breakpoint # Check forgotten breakpoints and debugger calls
flake8-bugbear ~=23.1 # (B...) Check for error-prone constructs
# flake8-builtins # Check for python builtins being used as variables or parameters (A...)
flake8-coding # C101 Coding magic comment not found, ...
# flake8-commas # C812 missing trailing comma -> Handled by Black # flake8-comprehensions # flake8-docstrings # flake8-eradicate # E800 Found commented out code # flake8-expression-complexity # ECE001 Expression is too complex (X > Y) # flake8-if-expr # KEK100 don`t use "[on_true] if [expression] else [on_false]" syntax # flake8-import-order # (we run `isort --check`) # flake8-isort # (we run `isort --check`) # flake8-logging-format # G001 Logging statement uses string.format() # flake8-pep3101 # Use "".format instead of %
# flake8-print # T001 print found
# flake8-pytest-style # PT009 use a regular assert instead of unittest-style 'assertTrue'
flake8-quotes ~=3.3.2 # See also [flake8] config
# flake8-return # R503 you should add explicit return at end of the function if function have return value except None
# flake8-rst-docstrings # Docstrings should work with Sphinx (RSTnnn)
# flake8-string-format # Check for valid string.format() args
# flake8-todo # T000 Todo note found
# mccabe # Check conplexity (see also max_complexity setting)
# pep8-naming
# Flake8 plugin 'wemake'
# (e.g. WPSnnn style errors)
# wemake-python-styleguide
changedir = {toxinidir}
commands =
flake8 wsgidav tests setup.py --doctests --statistics
[testenv:check]
description = Check Black formatting compliance and add flake8-bugbear checks
skip_install = true
deps =
black ~=22.12
isort
{[testenv:flake8]deps}
changedir = {toxinidir}
commands =
{[testenv:flake8]commands}
isort --check-only --profile black wsgidav tests setup.py
black --check --diff wsgidav tests setup.py
[testenv:format]
description = Reformat python code using Black and isort
# skip_install = true
deps =
{[testenv:check]deps}
changedir = {toxinidir}
commands =
isort --profile black wsgidav tests setup.py {posargs}
black wsgidav tests setup.py
{[testenv:flake8]commands}
[testenv:docs]
description = Build Sphinx documentation (output directory: docs/sphinx-build)
changedir = docs
deps =
sphinx
recommonmark
#sphinx_rtd_theme
furo
readthedocs-sphinx-search
commands =
# http://www.sphinx-doc.org/en/master/man/sphinx-build.html
sphinx-build -b html source build
[testenv:stressor]
description =
Execute stressor test and benchmark
(Needs `wsgidav --root tests/stressor/htdocs/ --host 127.0.0.1 --port 8082 --auth anonymous --no-config -q`)
changedir = {toxinidir}
deps =
stressor
commands =
; stressor run tests/stressor/test_rw.yaml --single --max-errors=0 -q {posargs}
stressor run tests/stressor/test_rw.yaml -q {posargs}
[testenv:bdist_msi]
description = Build MSI installer in dist/ (Windows only)
# basepython = python3.7
changedir = .
deps =
cx_Freeze
commands =
# http://www.sphinx-doc.org/en/master/man/sphinx-build.html
python setup_bdist_msi.py bdist_msi
# [testenv:clean]
# commands =
# coverage erase
# [testenv:stats]
# commands =
# coverage combine
# coverage report
# coverage html