-
Notifications
You must be signed in to change notification settings - Fork 18
/
tox.ini
109 lines (103 loc) · 2.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
[tox]
requires =
tox>=4.11.3
tox-uv
env_list =
py
deps
docs
lint
milestone
pkg
skip_missing_interpreters = true
[testenv]
description = Run pytest under {basepython}
package = editable
extras =
test
pass_env =
CI
CONTAINER_*
DOCKER_*
GITHUB_*
HOME
PYTEST_*
SSH_AUTH_SOCK
TERM
USER
set_env =
!milestone: PIP_CONSTRAINT = {toxinidir}/.config/constraints.txt
COVERAGE_COMBINED = {envdir}/.coverage
COVERAGE_FILE = {env:COVERAGE_FILE:{envdir}/.coverage.{envname}}
COVERAGE_PROCESS_START = {toxinidir}/pyproject.toml
FORCE_COLOR = 1
PRE_COMMIT_COLOR = always
TERM = xterm-256color
commands_pre =
sh -c "rm -f {envdir}/.coverage* 2>/dev/null || true"
commands =
python -c 'import pathlib; pathlib.Path("{env_site_packages_dir}/cov.pth").write_text("import coverage; coverage.process_startup()")'
coverage run -m pytest {posargs:-n auto}
coverage combine -q --data-file={env:COVERAGE_COMBINED}
coverage xml --data-file={env:COVERAGE_COMBINED} -o {envdir}/coverage.xml --fail-under=0
coverage lcov --data-file={env:COVERAGE_COMBINED} -o {toxinidir}/.cache/.coverage/lcov.info --fail-under=0
coverage report --data-file={env:COVERAGE_COMBINED}
allowlist_externals =
git
rm
sh
[testenv:deps]
description = Bump all dependencies
skip_install = true
deps =
{[testenv:lint]deps}
extras =
set_env =
PIP_CONSTRAINT = /dev/null
commands_pre =
commands =
-pre-commit run --all-files --show-diff-on-failure --hook-stage manual up
-pre-commit autoupdate
git diff --exit-code
env_dir = {toxworkdir}/lint
[testenv:docs]
description = Builds docs
package = editable
skip_install = false
extras =
docs
set_env =
NO_COLOR = 1
TERM = dump
commands =
mkdocs build {posargs:}
[testenv:lint]
description = Enforce quality standards under {basepython}
skip_install = true
deps =
pre-commit
pre-commit-uv
set_env =
PIP_CONSTRAINT = /dev/null
commands =
pre-commit run --show-diff-on-failure --all-files
[testenv:milestone]
description =
Run tests with ansible-core milestone branch and without dependencies constraints
deps =
ansible-core@ https://github.com/ansible/ansible/archive/milestone.tar.gz
set_env =
{[testenv]set_env}
PIP_CONSTRAINT = /dev/null
[testenv:pkg]
description =
Do packaging/distribution
skip_install = true
deps =
build>=0.9
twine >= 4.0.2 # pyup: ignore
set_env =
commands =
rm -rfv {toxinidir}/dist/
python -m build --outdir {toxinidir}/dist/ {toxinidir}
sh -c "python -m twine check --strict {toxinidir}/dist/*"