-
Notifications
You must be signed in to change notification settings - Fork 18
Expand file tree
/
Copy pathnoxfile.py
More file actions
27 lines (23 loc) · 806 Bytes
/
noxfile.py
File metadata and controls
27 lines (23 loc) · 806 Bytes
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
import nox
nox.options.default_venv_backend = "uv"
nox.options.reuse_existing_virtualenvs = True
build_command = ["-b", "dirhtml", ".", "_build/dirhtml"]
@nox.session()
def docs(session):
"""Build the documentation with sphinx-build"""
session.install("-r", "requirements.txt")
session.run("sphinx-build", *build_command)
@nox.session(name="docs-live")
def docs_live(session):
"""Build the documentation with sphinx-autobuild for live preview"""
session.install("-r", "requirements.txt")
AUTOBUILD_IGNORE = [
"_build",
"build_assets",
"images/shared_responsibility_diagram.png",
]
cmd = ["sphinx-autobuild"]
for folder in AUTOBUILD_IGNORE:
cmd.extend(["--ignore", f"*/{folder}/*"])
cmd.extend(build_command)
session.run(*cmd)