-
Notifications
You must be signed in to change notification settings - Fork 306
/
noxfile.py
54 lines (41 loc) · 1.28 KB
/
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
"""Experimental nox configuration file."""
import nox
nox.options.default_venv_backend = "uv"
maxpython = "3.12"
doc_requirements = ("-r", "ci_requirements/requirements_docs_py312.txt")
sphinx_commands = (
"sphinx-build",
"docs/",
"docs/build/html",
"--nitpicky",
"--fail-on-warning",
"--keep-going",
)
html = ("-b", "html")
check_hyperlinks = ("-b", "linkcheck", "-q")
@nox.session(python=maxpython)
def docs(session):
"""Build documentation with Sphinx."""
session.install(*doc_requirements)
session.install(".")
session.run(*sphinx_commands, *html, *session.posargs)
@nox.session(python=maxpython)
def linkcheck(session):
"""Check hyperlinks in documentation."""
session.install(*doc_requirements)
session.install(".")
session.run(*sphinx_commands, *check_hyperlinks, *session.posargs)
@nox.session(python=maxpython)
def mypy(session):
"""Perform static type checking with mypy."""
mypy_command = ("mypy", ".")
mypy_options = (
"--install-types",
"--non-interactive",
"--show-error-context",
"--show-error-code-links",
"--pretty",
)
session.install("mypy >= 1.9.0", "pip")
session.install("-r", "requirements.txt")
session.run(*mypy_command, *mypy_options, *session.posargs)