-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathnoxfile.py
More file actions
36 lines (26 loc) · 806 Bytes
/
noxfile.py
File metadata and controls
36 lines (26 loc) · 806 Bytes
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
from pathlib import Path
import nox
ROOT = Path(__file__).parent
TESTS = ROOT / "test_sanity.py"
nox.options.default_venv_backend = "uv|virtualenv"
nox.options.sessions = []
def session(default=True, **kwargs): # noqa: D103
def _session(fn):
if default:
nox.options.sessions.append(kwargs.get("name", fn.__name__))
return nox.session(**kwargs)(fn)
return _session
@session()
def tests(session):
"""
Run the sanity test suite to check the tests themselves.
"""
session.install("jsonschema", "pytest")
session.run("pytest", *session.posargs)
@session(tags=["style"])
def style(session):
"""
Check Python code style in the sanity test suite.
"""
session.install("ruff")
session.run("ruff", "check", ROOT, TESTS, __file__)