-
Notifications
You must be signed in to change notification settings - Fork 62
Expand file tree
/
Copy pathnoxfile.py
More file actions
53 lines (38 loc) · 1.5 KB
/
Copy pathnoxfile.py
File metadata and controls
53 lines (38 loc) · 1.5 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
"""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_rust_backend(session: nox.Session) -> None:
"""Run the test suite with the Rust triangulation backend required."""
session.install(".[test,other,rust]")
session.run("coverage", "erase")
session.run("pytest", *xdist, env={"ADAPTIVE_TRIANGULATION_BACKEND": "rust"})
@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")