-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathnoxfile.py
53 lines (44 loc) · 1.31 KB
/
noxfile.py
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
from __future__ import annotations
import nox
import nox.tasks
MIN_RAY_VERSION = "==2.20.0"
@nox.session(python=["3.9", "3.10", "3.11", "3.12"], reuse_venv=True)
@nox.parametrize(
"ray_version", [MIN_RAY_VERSION, ""], ids=["min-version", "latest-version"]
)
def test(session: nox.Session, ray_version):
packages = [
"pytest",
"pytest-cov",
"typing-extensions",
"async-timeout",
"madbg==1.3.2",
"pdbr",
f"ray[default]{ray_version}",
]
if session.python == "3.12" and ray_version == MIN_RAY_VERSION:
session.skip()
coverage_file = session.posargs[0] if session.posargs else "coverage.xml"
session.install(*packages)
session.run("pytest", "--cov", "-v", f"--cov-report=xml:{coverage_file}")
@nox.session(python="3.11", reuse_venv=True)
@nox.parametrize(
"ray_version", [MIN_RAY_VERSION, ""], ids=["min-version", "latest-version"]
)
def test_mypy(session, ray_version):
session.install(
"pytest",
"typing-extensions",
"mypy==1.9",
"pytest-mypy-plugins",
"madbg==1.3.2",
"pdbr",
f"ray[default]{ray_version}",
)
session.run(
"pytest",
"tests/mypy",
"-v",
"--mypy-only-local-stub",
"--mypy-pyproject-toml-file=pyproject.toml",
)