-
Notifications
You must be signed in to change notification settings - Fork 50
/
Copy pathnoxfile.py
46 lines (33 loc) · 1 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
"""Automation using nox.
"""
import nox
nox.options.reuse_existing_virtualenvs = True
@nox.session(python=["3.7", "3.8", "3.9", "3.10", "3.11", "3.12", "pypy3"])
def test(session: nox.Session) -> None:
session.install("-r", "dev-requirements.txt")
session.install(".")
session.run("pytest", *session.posargs)
@nox.session
def docs(session: nox.Session) -> None:
session.install("-e", ".")
session.install("-r", "docs/requirements.txt")
session.run(
"sphinx-build",
"-W",
"-d=docs/_build/doctrees/html",
"-b=dirhtml",
"docs/",
"docs/_build/html",
)
@nox.session
def lint(session: nox.Session) -> None:
session.install("pre-commit")
if session.posargs:
args = session.posargs + ["--all-files"]
else:
args = ["--all-files", "--show-diff-on-failure"]
session.run("pre-commit", "run", *args)
@nox.session
def release(session: nox.Session) -> None:
session.install("flit")
session.run("flit", "publish")