forked from hynek/structlog
-
Notifications
You must be signed in to change notification settings - Fork 0
/
tox.ini
117 lines (94 loc) · 2.73 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
[tox]
min_version = 4
env_list =
pre-commit,
mypy-pkg,
py3{8,9,10,11,12}-{tests,mypy}
py3{8,11}-tests-{colorama,be,rich},
docs,
coverage-report
[testenv]
package = wheel
wheel_build_env = .pkg
extras =
tests: tests
mypy: typing
pass_env =
FORCE_COLOR
NO_COLOR
commands =
tests: pytest {posargs}
mypy: mypy tests/typing
# Run oldest and latest under Coverage.
[testenv:py3{8,11}-tests{,-colorama,-be,-rich}]
deps =
coverage[toml]
py311: twisted
colorama: colorama
rich: rich
be: better-exceptions
commands = coverage run -m pytest {posargs}
[testenv:coverage-report]
# Keep in sync with .python-version
base_python = py311
deps = coverage[toml]
skip_install = true
parallel_show_output = true
depends = py3{8,11}-{tests,colorama,be,rich}
commands =
coverage combine
coverage report
[testenv:docs]
# Keep base_python in sync with ci.yml/docs and .readthedocs.yaml.
base_python = py311
extras = docs
commands =
sphinx-build -n -T -W -b html -d {envtmpdir}/doctrees docs docs/_build/html
sphinx-build -n -T -W -b doctest -d {envtmpdir}/doctrees docs docs/_build/html
[testenv:docs-watch]
package = editable
base_python = {[testenv:docs]base_python}
extras = {[testenv:docs]extras}
deps = watchfiles
commands =
watchfiles \
--ignore-paths docs/_build/ \
'sphinx-build -W -n --jobs auto -b html -d {envtmpdir}/doctrees docs docs/_build/html' \
src \
docs
[testenv:docs-linkcheck]
base_python = {[testenv:docs]base_python}
extras = {[testenv:docs]extras}
commands = sphinx-build -W -b linkcheck -d {envtmpdir}/doctrees docs docs/_build/html
[testenv:pre-commit]
skip_install = true
deps = pre-commit
commands = pre-commit run --all-files
[testenv:mypy-pkg]
extras = typing
commands = mypy src
[testenv:pyright]
deps = pyright
extras = typing
commands = pyright tests/typing
[testenv:color-force]
help = A visual check that FORCE_COLOR is working.
set_env = FORCE_COLOR=1
commands = python -c "import structlog; structlog.get_logger().warning('should be colorful')"
[testenv:color-no]
help = A visual check that NO_COLOR is working.
set_env = NO_COLOR=1
commands = python -c "import structlog; structlog.get_logger().warning('should be plain')"
[testenv:docset]
deps = doc2dash
extras = docs
allowlist_externals =
rm
cp
tar
commands =
rm -rf structlog.docset structlog.tgz docs/_build
sphinx-build -n -T -W -b html -d {envtmpdir}/doctrees docs docs/_build/html
doc2dash --index-page index.html --icon docs/_static/docset-icon.png --online-redirect-url https://www.structlog.org/en/latest/ docs/_build/html
cp docs/_static/[email protected] structlog.docset/[email protected]
tar --exclude='.DS_Store' -cvzf structlog.tgz structlog.docset