forked from ansible/ansible-creator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtox.ini
67 lines (63 loc) · 1.85 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
[tox]
requires =
tox>=4.6.3
env_list =
py
pkg
lint
docs
[testenv]
description = Run pytest under {basepython}
package = editable
extras =
test
set_env =
COVERAGE_FILE = {env:COVERAGE_FILE:{toxworkdir}/.coverage.{envname}}
COVERAGE_PROCESS_START = {toxinidir}/pyproject.toml
PIP_CONSTRAINT = {toxinidir}/.config/constraints.txt
devel, lint, pkg: PIP_CONSTRAINT = /dev/null
commands_pre =
{envpython} -m pip check
sh -c "rm -f .coverage {toxworkdir}/.coverage.* 2>/dev/null || true"
commands =
coverage run -m pytest {posargs:tests}
sh -c "coverage combine -a -q --data-file=.coverage {toxworkdir}/.coverage.*"
sh -c "COVERAGE_FILE= coverage xml --ignore-errors -q --fail-under=0"
sh -c "COVERAGE_FILE= coverage report"
allowlist_externals =
sh
[testenv:pkg]
description =
Build package, verify metadata, install package and assert behavior when ansible is missing.
skip_install = true
deps =
build>=0.9
twine>=4.0.1
commands =
{envpython} -c 'import os.path, shutil, sys; \
dist_dir = os.path.join("{toxinidir}", "dist"); \
os.path.isdir(dist_dir) or sys.exit(0); \
print("Removing \{!s\} contents...".format(dist_dir), file=sys.stderr); \
shutil.rmtree(dist_dir)'
{envpython} -m build \
--outdir {toxinidir}/dist/ \
{toxinidir}
twine check --strict {toxinidir}/dist/*
sh -c "python3 -m pip install {toxinidir}/dist/*.whl"
pip uninstall -y ansible-creator
[testenv:lint]
description = Enforce quality standards under {basepython} ({envpython})
base_python = python3.10
skip_install = true
deps =
pre-commit
commands =
pre-commit run --show-diff-on-failure --all-files
[testenv:docs]
description = Builds docs
package = editable
skip_install = false
extras =
docs
commands =
mkdocs {posargs:build --strict --site-dir=_readthedocs/html/}