-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnoxfile.py
31 lines (22 loc) · 920 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
import nox
from nox import Session
PYTHON = "3.10"
@nox.session(python=PYTHON)
def docs(session: Session) -> None:
"""Build the documentation."""
session.install("--requirement=docs/requirements.txt")
if session.interactive:
session.run("open", "http://127.0.0.1:8000/", external=True)
session.run("mkdocs", "serve", *session.posargs)
else:
session.run("mkdocs", "build")
@nox.session(python=PYTHON, name="deploy-docs")
def deploy_docs(session: Session) -> None:
"""Deploy the documentation."""
session.install("--requirement=docs/requirements.txt")
session.run("mkdocs", "gh-deploy", "--force")
@nox.session(python=PYTHON, name="check-types", tags=["lint"])
def check_types(session: Session) -> None:
"""Check typing with mypy."""
session.install("mypy", "nox", "--constraint=.github/workflows/constraints.txt")
session.run("mypy", "noxfile.py")