forked from sphinx-doc/sphinx-autobuild
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnoxfile.py
49 lines (35 loc) · 1.15 KB
/
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
41
42
43
44
45
46
47
48
49
"""Development automation."""
import nox
def _install_this_editable(session, *, extras=None):
if extras is None:
extras = []
session.install("flit")
session.run(
"flit",
"install",
"-s",
"--deps=production",
"--extras",
",".join(extras),
silent=True,
)
@nox.session(reuse_venv=True)
def lint(session):
session.install("pre-commit")
session.run("pre-commit", "run", "--all-files", *session.posargs)
@nox.session(python=["3.7", "3.8", "3.9", "3.10", "3.11"])
def test(session):
_install_this_editable(session, extras=["test"])
default_args = ["--cov-report", "term", "--cov", "sphinx_autobuild"]
args = session.posargs or default_args
session.run("pytest", *args)
@nox.session(reuse_venv=True)
def docs(session):
_install_this_editable(session, extras=["docs"])
session.run("sphinx-build", "-b", "html", "docs/", "build/docs")
@nox.session(name="docs-live", reuse_venv=True)
def docs_live(session):
_install_this_editable(session, extras=["docs"])
session.run(
"sphinx-autobuild", "-b", "html", "docs/", "build/docs", *session.posargs
)