-
-
Notifications
You must be signed in to change notification settings - Fork 151
/
tox.ini
165 lines (143 loc) · 3.58 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
[tox]
basepython = python3.12
envlist =
check
# mypy
py313 # EOL 2028-10-31
py312 # EOL 2028-10-31
lxml
py311 # EOL 2027-10-24
py310 # EOL 2026-10-04
py39 # EOL 2025-10-05
py38 # EOL 2024-10-14
# Deprecated:
# 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:py313]
; ignore_outcome = True
[testenv]
usedevelop = True
extras =
test
passenv =
LC_ALL
LANG
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 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:lxml]
; skip_install = true
deps =
{[testenv]deps}
lxml
setenv =
COVERAGE_FILE = build/.coverage.{envname}
commands =
{[testenv]commands}
[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=40.0 --skip-empty --ignore-errors
[testenv:mypy]
skip_install = true
deps =
mypy
changedir = {toxinidir}
commands =
mypy wsgidav tests
[testenv:lint]
skip_install = true
deps =
ruff
commands =
ruff -V
ruff check wsgidav tests setup.py
ruff format --check wsgidav tests setup.py
[testenv:format]
description = Reformat python code using ruff (Black, isort, and pyupgrade)
deps =
{[testenv:lint]deps}
changedir = {toxinidir}
commands =
ruff check --fix wsgidav tests setup.py
ruff format wsgidav tests setup.py
{[testenv:lint]commands}
; [testenv:upgrade]
; description = Upgrade Python syntax to least supported version
; deps =
; {[testenv:format]deps}
; pyupgrade
; allowlist_externals:
; bash
; changedir = {toxinidir}
; commands =
; # Needs bash-style file pattern expansion:
; bash -ec 'pyupgrade --py37-plus --exit-zero-even-if-changed wsgidav/*.py tests/*.py setup.py'
; {[testenv:format]commands}
[testenv:docs]
description = Build Sphinx documentation (output directory: docs/sphinx-build)
changedir = docs
deps =
sphinx
furo
readthedocs-sphinx-search
sphinx_rtd_theme
myst-parser[linkify]
sphinxcontrib-googleanalytics
sphinxcontrib-mermaid
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.12
changedir = .
deps =
cx_Freeze
commands =
# http://www.sphinx-doc.org/en/master/man/sphinx-build.html
python setup_bdist_msi.py bdist_msi