-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathtox.ini
105 lines (101 loc) · 2.56 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
[tox]
requires =
setuptools>=65.3
tox>=4.6.3
tox-extra>=2.1
tox-uv>=1.20.2
env_list =
py
py-devel
lint
pkg
skip_missing_interpreters = true
[testenv]
description =
Unit testing
package = editable
deps =
devel: git+https://github.com/pytest-dev/pytest.git
extras =
test
pass_env =
CI
CURL_CA_BUNDLE
DOCKER_*
HOME
LANG
LC_*
NO_COLOR
PYTEST_*
PYTEST_REQPASS
PYTHON*
PYTHONBREAKPOINT
PYTHONIOENCODING
PYTHONPYCACHEPREFIX
PY_COLORS
REQUESTS_CA_BUNDLE
RTD_TOKEN
SETUPTOOLS_SCM_DEBUG
SSH_AUTH_SOCK
SSL_CERT_FILE
TOXENV
TWINE_*
UV_*
set_env =
COVERAGE_FILE = {env:COVERAGE_FILE:{env_dir}/.coverage.{env_name}}
COVERAGE_PROCESS_START = {tox_root}/pyproject.toml
FORCE_COLOR = 1
PIP_CONSTRAINT = {tox_root}/.config/constraints.txt
PIP_DISABLE_PIP_VERSION_CHECK = 1
PRE_COMMIT_COLOR = always
PYTHONDONTWRITEBYTECODE = 1
PY_COLORS = {env:PY_COLORS:1}
UV_CONSTRAINT = {tox_root}/.config/constraints.txt
deps, devel, lint, pkg: PIP_CONSTRAINT = /dev/null
deps, devel, lint, pkg: UV_CONSTRAINT = /dev/null
commands_pre =
sh -c "rm -f .tox/.coverage.* 2>/dev/null || true"
commands =
python -m pytest --collect-only
sh -c "PYTEST_REQPASS=100 pytest >/dev/null && exit 1 || true"
sh -c "PYTEST_REQPASS=4 coverage run -m pytest {posargs: \
-ra \
--showlocals \
--doctest-modules \
--durations=10 \
}"
{py,py310,py311,py312,py313}: 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"
allowlist_externals =
rm
sh
editable = true
[testenv:lint]
description = Run all linters
skip_install = true
deps =
pre-commit>=4.0.1
pre-commit-uv>=4.1.4
commands =
{env_python} -m pre_commit run --all-files --show-diff-on-failure {posargs:}
[testenv:pkg]
description =
Build package, verify metadata, install package and assert behavior when ansible is missing.
skip_install = true
deps =
build
twine
commands =
sh -c "rm -rf {tox_root}/dist/ && mkdir -p {tox_root}/dist/"
python -m build --outdir {tox_root}/dist/
sh -c "twine check --strict dist/*"
[testenv:deps]
description = Bump all test dependencies
base_python = python3.10
skip_install = true
deps =
{[testenv:lint]deps}
commands =
pre-commit run --all-files --show-diff-on-failure --hook-stage manual deps
pre-commit autoupdate
git diff --exit-code
env_dir = {work_dir}/lint