Skip to content

Commit 4d1bf7d

Browse files
committed
Migrate tox.ini to tox.toml, add type checker compat matrix, streamline CI
- Replace tox.ini with modern tox.toml format using labels for env grouping - Add type checker version compat envs: pyright (1.1.392+), mypy (1.15+), ty - CI: run only default locked env (py312) on push; full compat + typecheck matrix triggers on version tags (v*) - All tox envs use pytest-xdist (-n=auto via pytest.toml) for parallel tests
1 parent cb339f2 commit 4d1bf7d

File tree

3 files changed

+341
-184
lines changed

3 files changed

+341
-184
lines changed

.github/workflows/ci.yml

Lines changed: 72 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,18 @@ name: CI
33
on:
44
push:
55
branches: [main]
6+
tags: ["v*"]
67
pull_request:
78

89
concurrency:
910
group: ${{ github.workflow }}-${{ github.ref }}
1011
cancel-in-progress: true
1112

1213
jobs:
14+
# -----------------------------------------------------------------------
15+
# Lint — always run
16+
# -----------------------------------------------------------------------
17+
1318
ruff:
1419
runs-on: ubuntu-latest
1520
steps:
@@ -27,6 +32,10 @@ jobs:
2732
- uses: actions/checkout@v6
2833
- uses: codespell-project/actions-codespell@v2
2934

35+
# -----------------------------------------------------------------------
36+
# Typecheck — always run
37+
# -----------------------------------------------------------------------
38+
3039
typecheck:
3140
runs-on: ubuntu-latest
3241
steps:
@@ -41,83 +50,97 @@ jobs:
4150
- uses: astral-sh/setup-uv@v7
4251
- run: uv run pytest tests/test_typecheck.py -v
4352

53+
# -----------------------------------------------------------------------
54+
# Test — always run (single locked env, default Python)
55+
# -----------------------------------------------------------------------
56+
4457
test:
4558
needs: [ruff, codespell, typecheck]
4659
runs-on: ubuntu-latest
47-
strategy:
48-
fail-fast: false
49-
matrix:
50-
python: ["3.12", "3.13", "3.14"]
51-
name: test (py${{ matrix.python }})
5260
steps:
5361
- uses: actions/checkout@v6
5462
- uses: astral-sh/setup-uv@v7
55-
- run: uv run tox -e "py${{ matrix.python }}"
56-
env:
57-
TOX_PYTHON: python${{ matrix.python }}
63+
- run: uv run tox run
5864

59-
numpy-compat:
60-
needs: [ruff, codespell, typecheck]
61-
runs-on: ubuntu-latest
62-
strategy:
63-
fail-fast: false
64-
matrix:
65-
version: ["numpy22", "numpy23", "numpy24"]
66-
name: ${{ matrix.version }}
67-
steps:
68-
- uses: actions/checkout@v6
69-
- uses: astral-sh/setup-uv@v7
70-
- run: uv run tox -e "${{ matrix.version }}"
65+
# -----------------------------------------------------------------------
66+
# Full matrix — only on version tags (v*)
67+
# -----------------------------------------------------------------------
7168

72-
jax-compat:
73-
needs: [ruff, codespell, typecheck]
74-
runs-on: ubuntu-latest
75-
strategy:
76-
fail-fast: false
77-
matrix:
78-
version: ["jax05", "jax06", "jax07", "jax08", "jax09"]
79-
name: ${{ matrix.version }}
80-
steps:
81-
- uses: actions/checkout@v6
82-
- uses: astral-sh/setup-uv@v7
83-
- run: uv run tox -e "${{ matrix.version }}"
84-
85-
torch-compat:
86-
needs: [ruff, codespell, typecheck]
69+
test-matrix:
70+
if: startsWith(github.ref, 'refs/tags/v')
71+
needs: [test]
8772
runs-on: ubuntu-latest
8873
strategy:
8974
fail-fast: false
9075
matrix:
91-
version: ["torch26", "torch27", "torch28", "torch29", "torch210"]
92-
name: ${{ matrix.version }}
76+
env: ["py313", "py314"]
77+
name: ${{ matrix.env }}
9378
steps:
9479
- uses: actions/checkout@v6
9580
- uses: astral-sh/setup-uv@v7
96-
- run: uv run tox -e "${{ matrix.version }}"
81+
- run: uv run tox run -e "${{ matrix.env }}"
9782

98-
beartype-compat:
99-
needs: [ruff, codespell, typecheck]
83+
compat:
84+
if: startsWith(github.ref, 'refs/tags/v')
85+
needs: [test]
10086
runs-on: ubuntu-latest
10187
strategy:
10288
fail-fast: false
10389
matrix:
104-
version: ["bt020", "bt021", "bt022"]
105-
suffix: ["", "-jax", "-torch"]
106-
name: ${{ matrix.version }}${{ matrix.suffix }}
90+
env:
91+
- numpy22
92+
- numpy23
93+
- numpy24
94+
- jax05
95+
- jax06
96+
- jax07
97+
- jax08
98+
- jax09
99+
- torch26
100+
- torch27
101+
- torch28
102+
- torch29
103+
- torch210
104+
- bt020
105+
- bt021
106+
- bt022
107+
- bt020-jax
108+
- bt021-jax
109+
- bt022-jax
110+
- bt020-torch
111+
- bt021-torch
112+
- bt022-torch
113+
- optree014
114+
- optree015
115+
- optree016
116+
- optree017
117+
- optree018
118+
- optree019
119+
name: ${{ matrix.env }}
107120
steps:
108121
- uses: actions/checkout@v6
109122
- uses: astral-sh/setup-uv@v7
110-
- run: uv run tox -e "${{ matrix.version }}${{ matrix.suffix }}"
123+
- run: uv run tox run -e "${{ matrix.env }}"
111124

112-
optree-compat:
113-
needs: [ruff, codespell, typecheck]
125+
typecheck-matrix:
126+
if: startsWith(github.ref, 'refs/tags/v')
127+
needs: [test]
114128
runs-on: ubuntu-latest
115129
strategy:
116130
fail-fast: false
117131
matrix:
118-
version: ["optree014", "optree015", "optree016", "optree017", "optree018", "optree019"]
119-
name: ${{ matrix.version }}
132+
env:
133+
- pyright1392
134+
- pyright1400
135+
- pyright1408
136+
- mypy115
137+
- mypy116
138+
- mypy117
139+
- mypy118
140+
- mypy119
141+
- ty
142+
name: ${{ matrix.env }}
120143
steps:
121144
- uses: actions/checkout@v6
122145
- uses: astral-sh/setup-uv@v7
123-
- run: uv run tox -e "${{ matrix.version }}"
146+
- run: uv run tox run -e "${{ matrix.env }}"

tox.ini

Lines changed: 0 additions & 135 deletions
This file was deleted.

0 commit comments

Comments
 (0)