generated from marshallmcdonnell/intersect-training-packaging-example
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnoxfile.py
31 lines (23 loc) · 726 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
import argparse
import nox
@nox.session(reuse_venv=True)
def docs(session: nox.Session) -> None:
"""
Build the docs. Pass "--serve" to serve.
"""
parser = argparse.ArgumentParser()
parser.add_argument("--serve", action="store_true", help="Serve after building")
args, posargs = parser.parse_known_args(session.posargs)
session.install("-e.[docs]")
session.chdir("docs")
session.run(
"sphinx-build",
"-b",
"html",
".",
f"_build/html",
*posargs,
)
if args.serve:
session.log("Launching docs at http://localhost:8000/ - use Ctrl-C to quit")
session.run("python", "-m", "http.server", "8000", "-d", "_build/html")