-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnoxfile.py
More file actions
38 lines (29 loc) · 1011 Bytes
/
noxfile.py
File metadata and controls
38 lines (29 loc) · 1011 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
37
38
"""Nox configuration."""
from __future__ import annotations
import nox
PYTHONS = ["3.10", "3.11", "3.12", "3.13", "3.14"]
@nox.session(python=PYTHONS)
def tests(session: nox.Session) -> None:
"""Run the test suite."""
uv_sync(session)
session.run("pytest")
# Or:
# session.run("uv", "run", "--active", "make", "test")
@nox.session
def check(session: nox.Session) -> None:
"""Run all checks (lint, typecheck, tests)."""
uv_sync(session)
session.run("ruff", "check", "src")
session.run("ruff", "format", "--check", "src")
session.run("ty", "check", "src")
# session.run("pyrefly", "check", "src")
# session.run("mypy", "src")
# session.run("mypy", "--strict", "src")
# Or:
# session.run("uv", "run", "--active", "make", "check")
#
# Utils
#
def uv_sync(session: nox.Session) -> None:
session.run("uv", "sync", "-q", "--active", external=True)
# session.run("uv", "sync", "-q", "--all-groups", "--all-extras", "--active", external=True)