-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtox.toml
More file actions
117 lines (106 loc) · 5.18 KB
/
Copy pathtox.toml
File metadata and controls
117 lines (106 loc) · 5.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
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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
requires = ["tox>=4.40", "tox-uv>=1.33"]
env_list = [
"dev",
"py310-bt023rc0-cpu",
"py314-bt023rc0-cpu",
# Runtime: {python}-{beartype}-{backend}. Keep default environments
# installable as backend Python floors and ceilings move independently.
# Intermediate and cross-axis versions can still be tested manually.
"py310-bt023rc0-numpy22",
"py310-bt023rc0-jax05",
"py310-bt023rc0-torch26",
"py310-bt023rc0-optree014",
"py313-bt023rc0-numpy24",
"py313-bt023rc0-jax09",
"py313-bt023rc0-torch210",
"py313-bt023rc0-optree019",
# Check Python 3.13 with its compatible dependencies; CI also covers 3.10-3.14.
{ product = [
["py313"],
["bt023rc0"],
["type"],
["pyright1408", "mypy119", "ty", "pyrefly"],
] },
]
# ---------------------------------------------------------------------------
# Base — shared by all factor-based environments
# ---------------------------------------------------------------------------
[env_run_base]
runner = "uv-venv-runner"
description = "{env_name}"
set_env = { UV_TORCH_BACKEND = "cpu" }
deps = [
"pytest>=9.0.2",
"pytest-xdist>=3.5.0",
# --- beartype ---
{ replace = "if", condition = "factor.bt023rc0", then = "beartype==0.23.0rc0" },
# --- numpy ---
# env_list uses numpy22 and numpy24; intermediate versions available for manual testing
{ replace = "if", condition = "factor.numpy22", then = "numpy>=2.2,<2.3" },
{ replace = "if", condition = "factor.numpy23", then = "numpy>=2.3,<2.4" },
{ replace = "if", condition = "factor.numpy24", then = "numpy>=2.4,<2.5" },
# --- jax (needs numpy) ---
# env_list uses jax05 and jax09; intermediate versions available for manual testing
{ replace = "if", condition = "factor.jax05", then = "jax[cpu]>=0.5,<0.6" },
{ replace = "if", condition = "factor.jax06", then = "jax[cpu]>=0.6,<0.7" },
{ replace = "if", condition = "factor.jax07", then = "jax[cpu]>=0.7,<0.8" },
{ replace = "if", condition = "factor.jax08", then = "jax[cpu]>=0.8,<0.9" },
{ replace = "if", condition = "factor.jax09", then = "jax[cpu]>=0.9,<0.10" },
# jax/torch/optree all need numpy at runtime — any non-numpy backend factor
{ replace = "if", condition = """factor.jax05 or factor.jax06 or factor.jax07 \
or factor.jax08 or factor.jax09 \
or factor.torch26 or factor.torch27 or factor.torch28 \
or factor.torch29 or factor.torch210 \
or factor.optree014 or factor.optree015 or factor.optree016 \
or factor.optree017 or factor.optree018 or factor.optree019""", then = "numpy>=2.2" },
# --- torch ---
# env_list uses torch26 and torch210; intermediate versions available for manual testing
{ replace = "if", condition = "factor.torch26", then = "torch>=2.6,<2.7" },
{ replace = "if", condition = "factor.torch27", then = "torch>=2.7,<2.8" },
{ replace = "if", condition = "factor.torch28", then = "torch>=2.8,<2.9" },
{ replace = "if", condition = "factor.torch29", then = "torch>=2.9,<2.10" },
{ replace = "if", condition = "factor.torch210", then = "torch>=2.10,<2.11" },
# --- optree ---
# env_list uses optree014 and optree019; intermediate versions available for manual testing
{ replace = "if", condition = "factor.optree014", then = "optree>=0.14,<0.15" },
{ replace = "if", condition = "factor.optree015", then = "optree>=0.15,<0.16" },
{ replace = "if", condition = "factor.optree016", then = "optree>=0.16,<0.17" },
{ replace = "if", condition = "factor.optree017", then = "optree>=0.17,<0.18" },
{ replace = "if", condition = "factor.optree018", then = "optree>=0.18,<0.19" },
{ replace = "if", condition = "factor.optree019", then = "optree>=0.19,<0.20" },
# --- CPU runtime and type checking (all CPU backends) ---
{ replace = "if", condition = "factor.type or factor.cpu", then = "numpy>=2.2" },
{ replace = "if", condition = "factor.type or factor.cpu", then = "jax[cpu]>=0.5" },
{ replace = "if", condition = "factor.type or factor.cpu", then = "torch>=2.6" },
{ replace = "if", condition = "factor.type or factor.cpu", then = "optree>=0.14" },
# Checker floors; the locked dev environment exercises current versions.
{ replace = "if", condition = "factor.pyright1408", then = "pyright==1.1.408" },
{ replace = "if", condition = "factor.mypy119", then = "mypy>=1.19,<1.20" },
{ replace = "if", condition = "factor.ty", then = "ty==0.0.79" },
{ replace = "if", condition = "factor.pyrefly", then = "pyrefly==1.2.0" },
]
commands = [["pytest", "tests/", "-n", "auto", { replace = "posargs", default = [], extend = true }]]
commands_pre = [
["python", "tools/validate_tox_env.py", "{env_name}"],
["python", "tools/validate_runtime.py", "{env_name}"],
]
# ---------------------------------------------------------------------------
# Locked dev — latest everything from uv.lock
# ---------------------------------------------------------------------------
[env.dev]
runner = "uv-venv-lock-runner"
dependency_groups = ["dev", "optional", "static", "test"]
commands_pre = [["python", "tools/validate_runtime.py", "dev"]]
commands = [
[
"pytest",
"tests/",
"-n",
"auto",
"--cov=bearshape",
"--cov-branch",
"--cov-report=term-missing:skip-covered",
"--cov-fail-under=90",
{ replace = "posargs", default = [], extend = true },
],
]