Repository navigation
Expand file tree
/
Copy pathnoxfile.py
More file actions
84 lines (60 loc) · 1.93 KB
/
Copy pathnoxfile.py
File metadata and controls
84 lines (60 loc) · 1.93 KB
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
76
77
78
79
80
81
82
83
84
"""Nox configuration for Mako."""
from __future__ import annotations
import sys
import nox
nox.needs_version = ">=2025.10.16"
if True:
sys.path.insert(0, ".")
from tools.toxnox import tox_parameters
from tools.toxnox import apply_pytest_opts
PYTHON_VERSIONS = [
"3.10",
"3.11",
"3.12",
"3.13",
"3.14",
"3.14t",
"3.15",
]
pyproject = nox.project.load_toml("pyproject.toml")
nox.options.sessions = ["tests"]
nox.options.tags = ["py-tests"]
@nox.session()
@tox_parameters(["python"], [PYTHON_VERSIONS], base_tag="tests")
def tests(session: nox.Session) -> None:
"""Run the main test suite."""
session.install(".")
session.install(*nox.project.dependency_groups(pyproject, "tests"))
posargs = apply_pytest_opts(session, "mako", [])
session.run("python", "-m", "pytest", *posargs)
@nox.session(name="coverage")
def coverage(session: nox.Session) -> None:
"""Run tests with coverage."""
session.install("-e", ".")
session.install(*nox.project.dependency_groups(pyproject, "tests"))
session.install(*nox.project.dependency_groups(pyproject, "coverage"))
posargs = apply_pytest_opts(session, "mako", ["mako"], coverage=True)
session.run("python", "-m", "pytest", *posargs)
@nox.session(name="pep8")
def lint(session: nox.Session) -> None:
"""Run linting and formatting checks."""
session.install(*nox.project.dependency_groups(pyproject, "lint"))
file_paths = [
"./mako/",
"./test/",
"./examples/",
"./tools/",
"noxfile.py",
"setup.py",
"doc/build/conf.py",
]
session.run("flake8p", *file_paths)
session.run("black", "--check", *file_paths)
@nox.session(name="pep484")
def mypy_check(session: nox.Session) -> None:
"""Run mypy type checking - not yet implemented."""
session.run(
"python",
"-c",
"print('pep484 is not yet implemented for this project')",
)