-
-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathtox.ini
128 lines (118 loc) · 3.99 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
[tox]
requires =
tox>4
tox-gh-actions
envlist =
{py38,py39,py310,py311,py312}-unit
{py38,py39,py310,py311,py312}-integration
{py38,py39,py310,py311,py312}-smoke
suicide_timeout = 1
[gh-actions]
python =
3.8: py38-unit, py38-integration, py38-smoke
3.9: py39-unit, py39-integration, py39-smoke
3.10: py310-unit, py310-integration, py310-smoke
3.11: py311-unit, py311-integration, py311-smoke
3.12: py312-unit, py312-integration, py312-smoke
[testenv]
description = Run tests using {basepython}
skip_install = true
allowlist_externals = poetry, pytest, bash, tox
setenv =
PYTHONUNBUFFERED = 1
PYTHONDONTWRITEBYTECODE = 1
commands_pre =
poetry install -E "all" --with test
commands =
unit: poetry run pytest tests/unit/ --maxfail=3 {posargs}
integration: poetry run pytest tests/integration/ --exitfirst --dist=loadscope {posargs}
smoke: poetry run pytest tests/smoke/ --exitfirst --dist=loadscope {posargs}
basepython =
3.8: py38
3.9: py39
3.10: py310
3.11: py311
3.12: py312
mypy: py312
lint: py312
clean: py312
xdist: py312
parallel: py312
docs: py312
docs-livehtml: py312
docs-apidoc: py312
usedevelop = True
[testenv:xdist]
description = Run tests using {basepython} with xdist
setenv =
PYTHONUNBUFFERED = 1
PYTHONDONTWRITEBYTECODE = 1
commands_pre =
poetry install -E "all" --with test
commands =
poetry run pytest tests --exitfirst \
-n auto --dist=loadscope \
--reruns 5 --rerun-except AssertionError \
{posargs}
[testenv:parallel]
description = Run unit, integration and smoke tests using {basepython} in parallel
setenv =
PYTHONUNBUFFERED = 1
PYTHONDONTWRITEBYTECODE = 1
commands_pre =
poetry install -E "all" --with test
commands =
tox -e py312-unit,py312-integration,py312-smoke -p auto -o -- --exitfirst \
-n auto --dist=loadscope \
--reruns 5 --reruns-delay 60 --rerun-except AssertionError \
{posargs}
[testenv:mypy]
description = Run mypy using {basepython}
commands_pre =
poetry install -E "all" --only dev
poetry run mypy --install-types --non-interactive
commands =
poetry run mypy --config-file pyproject.toml
[testenv:lint]
description = Run code+doc lint using {basepython}
allowlist_externals = poetry, make
commands_pre =
poetry install -E "all" --with dev,docs
commands =
poetry run pre-commit {posargs:run --all-files --show-diff-on-failure}
make -C ./docs apicheck
make -C ./docs linkcheck
make -C ./docs configcheck
[testenv:clean]
description = Clean up build and test artifacts using {basepython}
allowlist_externals = poetry, pytest, bash, find, make
commands_pre =
pip install -U cleanpy
commands =
cleanpy .
make -C ./docs clean
bash -c 'files=$(find . -name "*.coverage*" -type f); if [ -n "$files" ]; then echo "Removed coverage file(s):"; echo "$files" | tr " " "\n"; rm $files; fi'
bash -c 'containers=$(docker ps -aq --filter label=creator=pytest-docker-tools); if [ -n "$containers" ]; then echo "Removed Docker container(s):"; docker rm -f $containers; fi'
bash -c 'networks=$(docker network ls --filter name=pytest- -q); if [ -n "$networks" ]; then echo "Removed Docker network(s):"; docker network rm $networks; fi'
bash -c 'volumes=$(docker volume ls --filter name=pytest- -q); if [ -n "$volumes" ]; then echo "Removed Docker volume(s):"; docker volume rm $volumes; fi'
[testenv:docs]
description = Build docs using {basepython}
allowlist_externals = poetry, make
commands_pre =
poetry install -E "all" --with docs
commands =
make -C ./docs html
[testenv:docs-livehtml]
description = Build docs using {basepython} and serve in http://0.0.0.0:7010
allowlist_externals = poetry, make
commands_pre =
poetry install -E "all" --with docs
commands =
make -C ./docs livehtml
[testenv:docs-apidoc]
description = Regenerate API Reference doc section using {basepython}
allowlist_externals = poetry, make
commands_pre =
poetry install -E "all" --with docs
commands =
make -C ./docs apidoc