-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathnoxfile.py
66 lines (52 loc) · 1.78 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
from nox_poetry import Session, session
@session()
def tests(session: Session) -> None:
args = session.posargs or ["--cov", "--cov-report=xml"]
session.install(".")
session.install("strawman")
session.install("pytest")
session.install("pytest-cov")
session.install("pytest-mock")
session.run("pytest", *args)
locations = ["sylloge", "tests", "noxfile.py"]
@session(tags=["not test", "style"]) # type: ignore[call-overload]
def lint(session: Session) -> None:
session.install("pre-commit")
session.run(
"pre-commit",
"run",
"--all-files",
"--hook-stage=manual",
*session.posargs,
)
@session(tags=["not test", "style"]) # type: ignore[call-overload]
def style_checking(session: Session) -> None:
args = session.posargs or locations
session.install("ruff")
session.run("ruff", "check", *args)
@session()
def pyroma(session: Session) -> None:
session.install("poetry-core>=1.0.0")
session.install("pyroma")
session.run("pyroma", "--min", "10", ".")
@session(tags=["not test", "style"]) # type: ignore[call-overload]
def type_checking(session: Session) -> None:
args = session.posargs or locations
session.run_always("poetry", "install", external=True)
session.run(
"mypy",
"--install-types",
"--ignore-missing-imports",
"--non-interactive",
*args,
)
@session(tags=["not test"]) # type: ignore[call-overload]
def build_docs(session: Session) -> None:
session.install(".[docs]")
session.install("sphinx")
session.install("insegel")
session.install("sphinx-automodapi")
session.install("sphinx-autodoc-typehints")
session.cd("docs")
session.run("make", "clean", external=True)
session.run("make", "html", external=True)