-
Notifications
You must be signed in to change notification settings - Fork 241
/
Copy pathnoxfile.py
68 lines (56 loc) · 1.48 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
import nox
nox.options.reuse_existing_virtualenvs = True
nox.options.default_venv_backend = "uv|virtualenv"
@nox.session
def tests(session: nox.Session) -> None:
session.install("coverage", "pretend", ".[tests]")
session.run(
"coverage",
"run",
"--parallel-mode",
"-m",
"pytest",
"--capture=no",
"--strict-markers",
*session.posargs,
)
session.run("coverage", "combine")
session.run("coverage", "report", "-m")
@nox.session
def docs(session: nox.Session) -> None:
session.install("doc8", ".[docs]")
tmpdir = session.create_tmp()
session.run(
"sphinx-build",
"-W",
"-b",
"html",
"-d",
f"{tmpdir}/doctrees",
"docs",
"docs/_build/html",
)
session.run(
"sphinx-build",
"-W",
"-b",
"doctest",
"-d",
f"{tmpdir}/doctrees",
"docs",
"docs/_build/html",
)
session.run(
"sphinx-build", "-W", "-b", "linkcheck", "docs", "docs/_build/html"
)
session.run("doc8", "README.rst", "docs/", "--ignore-path", "docs/_build/")
@nox.session
def meta(session: nox.Session) -> None:
session.install("ruff", "check-manifest")
session.run("ruff", "check", ".")
session.run("ruff", "format", "--check", ".")
session.run("check-manifest", ".")
@nox.session
def mypy(session: nox.Session) -> None:
session.install(".[tests]", "mypy")
session.run("mypy")