-
Notifications
You must be signed in to change notification settings - Fork 75
Expand file tree
/
Copy pathtox.ini
More file actions
109 lines (104 loc) · 2.43 KB
/
tox.ini
File metadata and controls
109 lines (104 loc) · 2.43 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
[tox]
requires =
setuptools>=65.3
tox>=4.24.2
tox-extra>=2.1
tox-uv>=1.25
coverage>=6.4.4
env_list =
py
py-devel
lint
skip_missing_interpreters = true
[testenv]
description =
Run the tests under {base_python}
package = editable
deps =
pytest
pytest-order
pip
extras =
pass_env =
CI
CURL_CA_BUNDLE
FORCE_COLOR
HOME
LANG
LC_*
NO_COLOR
PYTEST_*
PYTHON*
PYTHONBREAKPOINT
PYTHONIOENCODING
PYTHONPYCACHEPREFIX
PY_COLORS
REQUESTS_CA_BUNDLE
SETUPTOOLS_SCM_DEBUG
SSH_AUTH_SOCK
SSL_CERT_FILE
UV_*
set_env =
COVERAGE_FILE = {env:COVERAGE_FILE:{env_dir}/.coverage.{envname}}
COVERAGE_PROCESS_START = {tox_root}/pyproject.toml
FORCE_COLOR = 1
PIP_CONSTRAINT = /dev/null
PIP_DISABLE_PIP_VERSION_CHECK = 1
PRE_COMMIT_COLOR = always
UV_CONSTRAINT = /dev/null
commands_pre =
sh -c "rm -f {env_dir}/.coverage.* 2>/dev/null || true"
{env_python} -m pip check
commands =
sh -c "{env_python} -m pip freeze > {env_dir}/log/requirements.txt"
coverage run -m pytest {posargs: \
# -n auto \ # Using this breaks coverage (UNIQUE constraint failed: context.context)
-ra \
--showlocals \
--durations=10 \
test
}
{py,py311,py313,py314}: sh -c "coverage combine -a -q --data-file={env_dir}/.coverage {work_dir}/*/.coverage.* && coverage xml --data-file={env_dir}/.coverage -o {env_dir}/coverage.xml --fail-under=0 && coverage report --data-file={env_dir}/.coverage"
allowlist_externals =
bash
find
git
pwd
rm
sh
tox
[testenv:lint]
description = Run all linters
skip_install = true
deps =
pre-commit>=4.1
pre-commit-uv>=4.1.4
pytest>=7.2.2 # to updated schemas
setuptools>=51.1.1
pass_env =
{[testenv]pass_env}
PRE_COMMIT_HOME
commands_pre =
commands =
{env_python} -m pre_commit run --all-files --show-diff-on-failure {posargs:}
[testenv:clean]
description = Remove temporary files
skip_install = true
deps =
commands_pre =
commands =
find . -type d \( -name __pycache__ -o -name .mypy_cache \) -delete
find . -type f \( -name '*.py[co]' -o -name ".coverage*" -o -name coverage.xml \) -delete
commands_post =
[testenv:docs]
description = Builds docs
package = editable
skip_install = false
extras =
docs
set_env =
NO_COLOR = 1
TERM = dump
commands_pre =
commands =
mkdocs {posargs:build --strict --site-dir=_readthedocs/html/}