-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathnoxfile.py
36 lines (29 loc) · 928 Bytes
/
noxfile.py
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
import nox
nox.options.sessions = ["tests", "docs"]
nox.options.default_venv_backend = "uv|virtualenv"
@nox.session
def tests(session: nox.Session) -> None:
"""Run tests with pytest."""
session.install(".")
session.run("pytest", *session.posargs)
@nox.session
def docs(session: nox.Session) -> None:
"""Build documentation with Sphinx."""
session.install(".", "-r", "docs/requirements.txt")
session.run(
"sphinx-build",
"docs/source",
"docs/build/html",
"--nitpicky",
"--builder",
"html",
*session.posargs,
)
@nox.session
def build(session: nox.Session) -> None:
"""Build & verify the source distribution and wheel."""
session.install("twine", "build")
build_command = ("python", "-m", "build")
session.run(*build_command, "--sdist")
session.run(*build_command, "--wheel")
session.run("twine", "check", "dist/*")