-
-
Notifications
You must be signed in to change notification settings - Fork 19
/
tox.ini
98 lines (79 loc) · 2.07 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
# SPDX-FileCopyrightText: 2023 Hynek Schlawack <[email protected]>
#
# SPDX-License-Identifier: MIT
[tox]
min_version = 4
env_list =
pre-commit,
docs,
mypy-pkg,
pyright,
py3{9,10,11,12,13}-mypy
py3{9,10,11,12,13}-tests{,-optional},
coverage-report
[pkgenv]
pass_env = SETUPTOOLS_SCM_PRETEND_VERSION
[testenv]
package = wheel
wheel_build_env = .pkg
extras =
tests: tests
mypy: typing
deps =
mypy: mypy
tests: coverage[toml]
optional: aiohttp
optional: fastapi
optional: flask
optional: httpx
optional: pyramid
optional: starlette
commands =
tests: coverage run -m pytest {posargs}
mypy: mypy tests/typing docs/examples/fastapi/simple_fastapi_app.py docs/examples/starlette/simple_starlette_app.py
[testenv:coverage-report]
description = Report coverage over all test runs.
deps = coverage
skip_install = true
commands =
coverage combine
coverage report
[testenv:pre-commit]
description = Run all pre-commit hooks.
skip_install = true
deps = pre-commit-uv
commands = pre-commit run --all-files
[testenv:mypy-pkg]
description = Type-check the package.
extras = typing
commands = mypy src
[testenv:pyright]
deps = pyright
extras = typing
commands = pyright tests/typing src
[testenv:docs]
# Keep base_python in sync with ci.yml/docs and .readthedocs.yaml.
base_python = py312
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
# Sybil
pytest docs
[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 -b html -d {envtmpdir}/doctrees docs docs/_build/html' \
src \
docs \
README.md \
CHANGELOG.md
[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