-
Notifications
You must be signed in to change notification settings - Fork 25
/
Copy pathnoxfile.py
38 lines (27 loc) · 970 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
37
38
"""
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
"""
import nox
nox.options.reuse_existing_virtualenvs = True
BUILD_COMMAND = ["-b", "dirhtml", "docs/source", "docs/_build/dirhtml"]
def install_deps(session):
session.conda_install("python=3.10")
session.install("-r", "docs/requirements.txt")
@nox.session(venv_backend="conda")
def docs(session):
install_deps(session)
if "live" in session.posargs:
# Add relative paths here if we ever need to ignore them during autobuilds
AUTOBUILD_IGNORE = [
"docs/_build",
"docs/source/tmp",
]
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)