-
Notifications
You must be signed in to change notification settings - Fork 663
/
tox.ini
130 lines (123 loc) · 3.09 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
[tox]
requires =
tox>=4.23.2
tox-uv>=1.16
env_list =
py
deps
docs
lint
milestone
pkg
eco
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
base_python = python3.10
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 deps
-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 =
pip
pre-commit>=4.0.1
pre-commit-uv>=4.1.4
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/*"
[testenv:eco]
description = Smoketest of combining all known to be maintained plugins (ecosystem)
package = editable
pip_pre = true
deps =
molecule-plugins[azure,containers,docker,ec2,gce,podman,vagrant]>=23
pipdeptree>=2
tox-ansible>=1.5.1
extras =
test
commands_pre =
commands =
pip check
pipdeptree --reverse -e pip,pbr,six,setuptools,toml,urllib3
molecule --version
molecule drivers
sh -c ./tools/smoketest.sh