-
Notifications
You must be signed in to change notification settings - Fork 29
/
tox.ini
142 lines (134 loc) · 3.32 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
[tox]
requires =
tox>=4.11.3
tox-extra>=2.0.2
env_list =
py
deps
docs
lint
milestone
pkg
ee
devspaces
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
XDG_RUNTIME_DIR
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.11
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 run --all-files --show-diff-on-failure --hook-stage manual lock
-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
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
ansible-creator<24.10.0
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:ee]
description =
Build the ee container image
skip_install = true
deps =
-r .config/requirements-test.in
ansible-builder
build
mk
setuptools # https://github.com/ansible/ansible-builder/issues/644
commands_pre =
commands =
./tools/ee.sh
allowlist_externals =
./tools/ee.sh
[testenv:devspaces]
description = Build devspaces container image for current architecture
skip_install = true
deps =
-r .config/requirements-test.in
mk
commands_pre =
commands =
./tools/devspaces.sh {posargs}
allowlist_externals =
./tools/devspaces.sh