-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathtox.ini
106 lines (96 loc) · 2.56 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
[tox]
envlist = python
isolated_build = true
minversion = 3.23.0
[testenv]
description = Run test suite
commands =
{envpython} -m \
pytest \
{tty:--color=yes} \
--cov-config={toxinidir}/.coveragerc \
--cov={envsitepackagesdir}/ansible_pygments \
{posargs:}
deps =
importlib_metadata; python_version < "3.10"
pytest
pytest-clarity
pytest-cov
# pytest-xdist
isolated_build = true
usedevelop = false
[testenv:cleanup-dists]
description =
Wipe the the dist{/} folder
# NOTE: `package_env = none` is needed so it's possible to use `--installpkg`
# NOTE: with the main `testenv`.
# Ref: https://github.com/tox-dev/tox/issues/2442
package_env = ❌ DUMMY NON-EXISTENT ENV NAME ❌
usedevelop = false
skip_install = true
deps =
commands =
{envpython} -c \
"import shutil, sys; \
shutil.rmtree(sys.argv[1], ignore_errors=True)" \
{toxinidir}{/}dist{/}
[testenv:build-dists]
description =
Build dists and put them into the dist{/} folder
depends =
cleanup-dists
isolated_build = true
# NOTE: `package_env = none` is needed so it's possible to use `--installpkg`
# NOTE: with the main `testenv`.
# Ref: https://github.com/tox-dev/tox/issues/2442
package_env = ❌ DUMMY NON-EXISTENT ENV NAME ❌
# `usedevelop = true` overrides `skip_install` instruction, it's unwanted
usedevelop = false
skip_install = true
deps =
build ~= 0.9.0
passenv =
PEP517_BUILD_ARGS
commands =
{envpython} -m build \
--outdir '{toxinidir}{/}dist{/}' \
{posargs:{env:PEP517_BUILD_ARGS:}} \
'{toxinidir}'
[testenv:metadata-validation]
description =
Verify that dists under the `dist{/}`
dir have valid metadata
depends =
build-dists
deps =
twine
# NOTE: `package_env = none` is needed so it's possible to use `--installpkg`
# NOTE: with the main `testenv`.
# Ref: https://github.com/tox-dev/tox/issues/2442
package_env = ❌ DUMMY NON-EXISTENT ENV NAME ❌
usedevelop = false
skip_install = true
commands =
twine check {toxinidir}{/}dist{/}*
[testenv:lint]
description = Run the quality checks
commands =
{envpython} -m \
pre_commit run \
--show-diff-on-failure \
--hook-stage manual \
{posargs:--all-files}
# Print out the advice on how to install pre-commit from this env into Git:
-{envpython} -c \
'cmd = "{envpython} -m pre_commit install"; \
scr_width = len(cmd) + 10; sep = "=" * scr_width; \
cmd_str = " $ " + cmd; \
print(\
"\n" + sep + "\nTo install pre-commit hooks into the Git repo, run:\n\n" + \
cmd_str + "\n\n" + sep + "\n"\
)'
deps =
{[testenv]deps}
pre-commit >= 2.6.0
pylint >= 2.5.3
isolated_build = true