-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtox.toml
More file actions
129 lines (118 loc) · 5.82 KB
/
Copy pathtox.toml
File metadata and controls
129 lines (118 loc) · 5.82 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
118
119
120
121
122
123
124
125
126
127
128
129
requires = ["tox>=4.40", "tox-uv>=1.33"]
env_list = [
"dev",
# 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-bt020-numpy22",
"py310-bt020-jax05",
"py310-bt020-torch26",
"py310-bt020-optree014",
"py310-bt022-numpy22",
"py310-bt022-jax05",
"py310-bt022-torch26",
"py310-bt022-optree014",
"py313-bt020-numpy24",
"py313-bt020-jax09",
"py313-bt020-torch210",
"py313-bt020-optree019",
"py313-bt022-numpy24",
"py313-bt022-jax09",
"py313-bt022-torch210",
"py313-bt022-optree019",
# Typecheck: latest Python + latest beartype only (type stubs are version-independent)
{ product = [
["py313"],
["bt022"],
["type"],
["pyright1408", "mypy119", "ty"],
] },
]
# ---------------------------------------------------------------------------
# Base — shared by all factor-based environments
# ---------------------------------------------------------------------------
[env_run_base]
runner = "uv-venv-runner"
description = "{env_name}"
deps = [
"pytest>=9.0.2",
"pytest-xdist>=3.5.0",
# --- beartype ---
# env_list uses bt020 and bt022; intermediate versions available for manual testing
# e.g. `tox run -e py310-bt021-numpy23`
{ replace = "if", condition = "factor.bt020", then = "beartype>=0.20,<0.21" },
{ replace = "if", condition = "factor.bt021", then = "beartype>=0.21,<0.22" },
{ replace = "if", condition = "factor.bt022", then = "beartype>=0.22,<0.23" },
# --- 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" },
# --- type factor (installs all backends for type checking) ---
{ replace = "if", condition = "factor.type", then = "numpy>=2.2" },
{ replace = "if", condition = "factor.type", then = "jax[cpu]>=0.5" },
{ replace = "if", condition = "factor.type", then = "torch>=2.6" },
{ replace = "if", condition = "factor.type", then = "optree>=0.14" },
# --- typechecker versions ---
# env_list uses pyright1408, mypy119, ty; older versions available for manual testing
{ replace = "if", condition = "factor.pyright1392", then = "pyright==1.1.392" },
{ replace = "if", condition = "factor.pyright1400", then = "pyright==1.1.400" },
{ replace = "if", condition = "factor.pyright1408", then = "pyright==1.1.408" },
{ replace = "if", condition = "factor.mypy115", then = "mypy>=1.15,<1.16" },
{ replace = "if", condition = "factor.mypy116", then = "mypy>=1.16,<1.17" },
{ replace = "if", condition = "factor.mypy117", then = "mypy>=1.17,<1.18" },
{ replace = "if", condition = "factor.mypy118", then = "mypy>=1.18,<1.19" },
{ replace = "if", condition = "factor.mypy119", then = "mypy>=1.19,<1.20" },
{ replace = "if", condition = "factor.ty", then = "ty" },
]
commands = [["pytest", "tests/", "-n", "auto", { replace = "posargs", default = [], extend = true }]]
commands_pre = [["python", "tools/validate_tox_env.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 = []
commands = [
[
"pytest",
"tests/",
"-n",
"auto",
"--cov=bearshape",
"--cov-branch",
"--cov-report=term-missing:skip-covered",
"--cov-fail-under=90",
{ replace = "posargs", default = [], extend = true },
],
]