-
Notifications
You must be signed in to change notification settings - Fork 0
/
noxfile.py
75 lines (59 loc) · 1.75 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
67
68
69
70
71
72
73
74
75
from nox_poetry import Session, session
@session()
def tests(session: Session) -> None:
args = session.posargs or ["--cov", "--cov-report=xml"]
session.install(".[all]")
session.install(
"torch-scatter", "-f", "https://data.pyg.org/whl/torch-2.0.0+cpu.html"
)
session.install(
"torch-sparse", "-f", "https://data.pyg.org/whl/torch-2.0.0+cpu.html"
)
session.install("strawman")
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(".[all]")
session.install("mypy")
session.run(
"mypy",
"--install-types",
"--non-interactive",
"--ignore-missing-imports",
*args,
)
@session()
def doctests(session: Session) -> None:
session.install(".[all]")
session.install("xdoctest")
session.install("pygments")
session.run("xdoctest", "-m", "klinker")
@session()
def build_docs(session: Session) -> None:
session.install(".[docs]")
session.run("mkdocs", "build", external=True)