-
Notifications
You must be signed in to change notification settings - Fork 62
Expand file tree
/
Copy pathnoxfile.py
More file actions
45 lines (32 loc) · 1.18 KB
/
noxfile.py
File metadata and controls
45 lines (32 loc) · 1.18 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
"""Nox configuration file."""
import os
import nox
nox.options.default_venv_backend = "uv"
python = ["3.11", "3.12", "3.13", "3.14"]
num_cpus = os.cpu_count() or 1
xdist = ("-n", "auto") if num_cpus > 2 else ()
@nox.session(python=python)
def pytest_min_deps(session: nox.Session) -> None:
"""Run pytest with no optional dependencies."""
session.install(".[test]")
session.run("coverage", "erase")
session.run("pytest", *xdist)
@nox.session(python=python)
def pytest_all_deps(session: nox.Session) -> None:
"""Run pytest with "other" optional dependencies."""
session.install(".[test,other]")
session.run("coverage", "erase")
session.run("pytest", *xdist)
@nox.session(python="3.13")
def pytest_typeguard(session: nox.Session) -> None:
"""Run pytest with typeguard."""
session.install(".[test,other]")
session.run("coverage", "erase")
session.run("pytest", "--typeguard-packages=adaptive", *xdist)
@nox.session(python="3.13")
def coverage(session: nox.Session) -> None:
"""Generate coverage report."""
session.install(".[test,other]")
session.run("pytest", *xdist)
session.run("coverage", "report")
session.run("coverage", "xml")