-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtox.ini
More file actions
59 lines (52 loc) · 1.72 KB
/
Copy pathtox.ini
File metadata and controls
59 lines (52 loc) · 1.72 KB
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
# Tox configuration file using uv as the backend runner
# Read more under https://tox.wiki/
[tox]
minversion = 4.0
envlist = default
[testenv]
description = Invoke pytest to run automated tests
allowlist_externals = uv
skip_install = True
commands =
uv run --all-extras pytest {posargs}
[testenv:typecheck]
description = Run static type checking with mypy
skip_install = True
commands =
uv run --all-extras mypy src/
[testenv:lint]
description = Perform static analysis and style checks
skip_install = True
commands =
uv run ruff check {posargs:.}
uv run ruff format --check {posargs:.}
[testenv:{build,clean}]
description =
build: Build the package
clean: Remove old distribution files
skip_install = True
commands =
clean: python -c 'import shutil; [shutil.rmtree(p, True) for p in ("build", "dist", "docs/_build")]'
clean: python -c 'import pathlib, shutil; [shutil.rmtree(p, True) for p in pathlib.Path("src").glob("*.egg-info")]'
build: uv build {posargs}
[testenv:{docs,doctests,linkcheck}]
description =
docs: Invoke sphinx-build to build the docs
doctests: Invoke sphinx-build to run doctests
linkcheck: Check for broken links in the documentation
setenv =
DOCSDIR = {toxinidir}/docs
BUILDDIR = {toxinidir}/docs/_build
docs: BUILD = html
doctests: BUILD = doctest
linkcheck: BUILD = linkcheck
skip_install = True
commands =
uv run sphinx-apidoc -f -o "{env:DOCSDIR}/api" src/
uv run sphinx-build --color -b {env:BUILD} -d "{env:BUILDDIR}/doctrees" "{env:DOCSDIR}" "{env:BUILDDIR}/{env:BUILD}" {posargs}
[testenv:publish]
description =
Publish the package you have been developing to a package index server.
skip_install = True
commands =
uv publish {posargs:dist/*}