-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnoxfile.py
59 lines (45 loc) · 1.32 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
from nox_poetry import Session, session
@session()
def tests(session: Session) -> None:
args = session.posargs or ["-m", "not slow", "--cov=eche", "--cov-report=xml"]
session.install(".[all]")
session.install("pytest")
session.install("pytest-cov")
session.install("pytest-mock")
session.run("pytest", *args)
locations = ["src", "tests", "noxfile.py"]
@session()
def lint(session: Session) -> None:
session.install("pre-commit")
session.run(
"pre-commit",
"run",
"--all-files",
"--hook-stage=manual",
*session.posargs,
)
@session()
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()
def type_checking(session: Session) -> None:
args = session.posargs or locations
session.install("mypy")
session.run(
"mypy",
"--install-types",
"--non-interactive",
"--ignore-missing-imports",
*args,
)
@session()
def build_docs(session: Session) -> None:
session.install(".[docs]")
session.run("mkdocs", "build", external=True)