-
Notifications
You must be signed in to change notification settings - Fork 256
Expand file tree
/
Copy pathnoxfile.py
More file actions
76 lines (62 loc) · 2.06 KB
/
noxfile.py
File metadata and controls
76 lines (62 loc) · 2.06 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
#!/usr/bin/env -S uv run --script
# /// script
# dependencies = ["nox>=2025.11.12"]
# ///
import nox
# Tags:
# test-min - for local testing of min deps
# test-max - for local testing of max deps
# pr - for pull-requests
# pr-matrix - for pull-requests, will us OS matrix
# [*((python-version, uv-resolution), [*tags])]
MATRIX = [
(("3.10", "lowest-direct"), ["test-min", "pr-matrix"]),
(("3.10", "highest"), []),
(("3.11", "highest"), []),
(("3.12", "highest"), ["pr-matrix"]),
(("3.13", "highest"), []),
(("3.14", "highest"), ["test-max", "pr-matrix"]),
]
def setup_uv(session: nox.Session, resolution="highest") -> None:
"""
IMPORTANT: make sure to set `venv_backend="uv"` on @nox.session().
"""
session.run_install(
"uv",
"sync",
f"--resolution={resolution}",
f"--python={session.virtualenv.location}",
env={"UV_PROJECT_ENVIRONMENT": session.virtualenv.location},
)
@nox.session(venv_backend="uv", tags=["pr", "lint"])
def lint(session: nox.Session) -> None:
"""
Run the linters
"""
setup_uv(session)
session.run("ruff", "check", *session.posargs)
@nox.session(venv_backend="uv")
@nox.parametrize(
"python,resolution",
[x[0] for x in MATRIX],
ids=['py' + ':'.join(x[0]) for x in MATRIX],
tags=[x[1] for x in MATRIX],
)
def test(session: nox.Session, resolution) -> None:
"""
Run the tests (can use `-t test-min` or `-t test-max` to filter)
"""
setup_uv(session, resolution)
session.run("pytest", *session.posargs, '-v', env={"QIIMETEST": "1"})
@nox.session(venv_backend="uv", tags=["pr"])
def test_mystery_stew(session: nox.Session) -> None:
"""
Run mystery-stew tests for the artifact API
"""
setup_uv(session)
session.run("uv", 'run', '-n',
"--with=git+https://github.com/qiime2/q2-mystery-stew",
"--with=git+https://github.com/qiime2/q2",
"pytest",
"src/rachis/tests/mystery_stew.py",
env={"MYSTERY_STEW": "1", "QIIMETEST": "1"})