-
-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathtox.ini
91 lines (83 loc) · 2.05 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
[tox]
envlist = python
minversion = 3.21.0
[testenv]
commands =
{envpython} -m \
pytest \
{tty:--color=yes} \
{posargs:}
python setup.py checkdocs
usedevelop = True
extras = testing
passenv =
WEBTEST_INTERACTIVE
CI
GITHUB_WORKFLOW
PYTEST_*
[testenv:build-dists]
description =
Build dists and put them into the dist{/} folder
basepython = python3
isolated_build = true
# `usedevelop = true` overrides `skip_install` instruction, it's unwanted
usedevelop = false
skip_install = true
deps =
build ~= 0.10.0
commands =
{envpython} -c \
"import shutil; \
shutil.rmtree('{toxinidir}{/}dist{/}', ignore_errors=True)"
{envpython} -m build \
--outdir '{toxinidir}{/}dist{/}' \
{posargs:--sdist --wheel} \
'{toxinidir}'
[testenv:build-docs]
basepython = python3.8
description = Build The Docs
changedir = docs
commands =
# Build docs site:
python -m sphinx \
-j auto \
-a -n -W \
-b html \
{tty:--color} \
-d "{toxworkdir}/docs_doctree" \
. "{toxworkdir}/docs_out"
# Print out the output docs dir and a way to serve html:
python -c\
'import pathlib;\
docs_dir = pathlib.Path(r"{toxworkdir}") / "docs_out";\
index_file = docs_dir / "index.html";\
print(f"\nDocumentation available under\
`file://\{index_file\}`\n\nTo serve docs, use\
`python3 -m http.server --directory \
\N\{QUOTATION MARK\}\{docs_dir\}\N\{QUOTATION MARK\} 0`\n")'
extras =
docs
testing
[testenv:metadata-validation]
depends =
build-dists
deps =
twine
description =
Verify that dists under the `dist{/}`
dir have valid metadata
# Ref: https://twitter.com/di_codes/status/1044358639081975813
commands =
{envpython} -m \
twine check \
{toxinidir}{/}dist{/}*
skip_install = true
usedevelop = false
[testenv:pre-commit]
deps = pre-commit
commands = pre-commit run --all-files {posargs}
[testenv:pre-commit-pep257]
deps = pre-commit
commands =
sed -i.bak 's/^\s\+exclude: magicbus\/test$//g' .pre-commit-config.yaml
pre-commit run --all-files pep257 {posargs}