-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathnoxfile.py
More file actions
36 lines (31 loc) · 1.1 KB
/
noxfile.py
File metadata and controls
36 lines (31 loc) · 1.1 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
import tempfile
import nox
@nox.session(reuse_venv=True)
def docs(session):
pyproject = nox.project.load_toml("pyproject.toml")
deps = nox.project.dependency_groups(pyproject, "docs")
session.run("uv", "pip", "install", "-e", ".", *deps)
session.run("sphinx-build", "docs", "docs/_build/html")
@nox.session(reuse_venv=True)
def serve(session):
pyproject = nox.project.load_toml("pyproject.toml")
deps = nox.project.dependency_groups(pyproject, "docs")
session.run("uv", "pip", "install", "-e", ".", "sphinx-autobuild", *deps)
with tempfile.TemporaryDirectory() as destination:
session.run(
"sphinx-autobuild",
"--port=0",
"--pre-build",
"cmd /c npm run build",
"--watch=src/",
"--ignore=src/sphinx_breeze_theme/theme/breeze/static/",
"--ignore=docs/extensions/sphinx-gallery/",
"--ignore=docs/sg_execution_times.rst",
"--open-browser",
"-T",
"-a",
"-b=dirhtml",
"-a",
"docs/",
destination,
)