-
-
Notifications
You must be signed in to change notification settings - Fork 4
/
noxfile.py
40 lines (30 loc) · 979 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
39
40
import os
import nox
os.environ["PDM_IGNORE_SAVED_PYTHON"] = "1"
@nox.session(python=("3.8", "3.9", "3.10", "3.11"))
def test(session):
session.run("pdm", "install", "-dGtest", external=True)
session.run("pytest", "tests/")
@nox.session(python="3.11")
def docs(session):
session.install("-r", "docs/requirements.txt")
# Generate documentation into `build/docs`
session.run("sphinx-build", "-W", "-b", "html", "docs/", "build/docs")
@nox.session(name="docs-live", python="3.11")
def docs_live(session):
session.install("-r", "docs/requirements.txt")
session.install("-e", ".")
session.install("sphinx-autobuild")
session.run(
"sphinx-autobuild",
"docs/",
"build/docs",
# Rebuild all files when rebuilding
"-a",
# Trigger rebuilds on code changes (for autodoc)
"--watch",
"src/monas",
# Use a not-common high-numbered port
"--port",
"8765",
)