-
Notifications
You must be signed in to change notification settings - Fork 103
/
noxfile.py
29 lines (26 loc) · 930 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
"""A nox configuration file so that we can build the documentation easily with nox.
- see the README.md for information about nox.
- ref: https://nox.thea.codes/en/stable/
"""
import nox
nox.options.reuse_existing_virtualenvs = True
build_command = ["-b", "html", "doc", "doc/_build/html"]
@nox.session(python="3.9")
def docs(session):
session.install("-r", "doc/doc-requirements.txt")
if "live" in session.posargs:
AUTOBUILD_IGNORE = [
"*/.github/*",
"*/_data/*",
"*/howto/languages.rst",
"*/howto/user_interface.rst",
"*/howto/lab_workspaces.rst",
"*/using/config_files.rst",
]
cmd = ["sphinx-autobuild"]
for folder in AUTOBUILD_IGNORE:
cmd.extend(["--ignore", f"*/{folder}/*"])
cmd.extend(build_command)
session.run(*cmd)
else:
session.run("sphinx-build", *build_command)