Skip to content

Commit bcaf379

Browse files
committed
Replace nox with tox + tox-uv for multi-version testing
Use uv-venv-lock-runner with PEP 735 dependency groups for factor-based backend selection (torch/jax/all). Factor prefix syntax in tox.ini cleanly maps env names like 3.12-torch to the right groups.
1 parent 69c1976 commit bcaf379

File tree

6 files changed

+140
-147
lines changed

6 files changed

+140
-147
lines changed

.github/workflows/ci.yml

Lines changed: 6 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -15,38 +15,24 @@ jobs:
1515
steps:
1616
- uses: actions/checkout@v4
1717
- uses: astral-sh/setup-uv@v5
18-
- run: uv sync --group dev
19-
- run: uv run ruff check src/ tests/
20-
- run: uv run ruff format --check src/ tests/
18+
- run: uv run tox -e lint
2119

2220
typecheck:
2321
runs-on: ubuntu-latest
2422
steps:
2523
- uses: actions/checkout@v4
2624
- uses: astral-sh/setup-uv@v5
27-
- run: uv sync --group dev
28-
- run: uv run pyright src/
25+
- run: uv run tox -e typecheck
2926

3027
test:
3128
runs-on: ubuntu-latest
3229
strategy:
3330
fail-fast: false
3431
matrix:
35-
python-version: ["3.12", "3.13", "3.14"]
36-
backend: ["numpy-only", "torch", "jax", "all"]
37-
name: test (py${{ matrix.python-version }}, ${{ matrix.backend }})
32+
python: ["3.12", "3.13", "3.14"]
33+
suffix: ["", "-torch", "-jax", "-all"]
34+
name: test (py${{ matrix.python }}${{ matrix.suffix }})
3835
steps:
3936
- uses: actions/checkout@v4
4037
- uses: astral-sh/setup-uv@v5
41-
with:
42-
python-version: ${{ matrix.python-version }}
43-
- name: Install core + dev deps
44-
run: uv sync --group dev
45-
- name: Install torch
46-
if: matrix.backend == 'torch' || matrix.backend == 'all'
47-
run: uv sync --group dev --group torch
48-
- name: Install jax
49-
if: matrix.backend == 'jax' || matrix.backend == 'all'
50-
run: uv sync --group dev --group jax
51-
- name: Run tests
52-
run: uv run pytest tests/ -v
38+
- run: uv run tox -e "${{ matrix.python }}${{ matrix.suffix }}"

noxfile.py

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

pyproject.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ dev = [
1515
"pyright>=1.1.408",
1616
"pytest>=9.0.2",
1717
"pre-commit>=4.5.1",
18-
"nox>=2025.5.1",
18+
"tox>=4.19",
19+
"tox-uv>=1",
1920
"ipykernel>=7.1.0",
2021
"matplotlib>=3.10.8",
2122
]

ruff.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ select = [
2525
"E113",
2626
"E115",
2727
"E117",
28+
"E225",
29+
"E227",
30+
"E228",
2831
]
2932

3033
[format]

tox.ini

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
[tox]
2+
requires =
3+
tox-uv>=1
4+
env_list =
5+
3.12, 3.13, 3.14
6+
3.12-torch, 3.13-torch, 3.14-torch
7+
3.12-jax, 3.13-jax, 3.14-jax
8+
3.12-all, 3.13-all, 3.14-all
9+
lint
10+
typecheck
11+
12+
[testenv]
13+
runner = uv-venv-lock-runner
14+
description = Run tests under {base_python}
15+
dependency_groups =
16+
dev
17+
torch: torch
18+
jax: jax
19+
all: torch
20+
all: jax
21+
commands =
22+
pytest {posargs:tests/} -v
23+
24+
[testenv:lint]
25+
description = Run ruff linter and formatter checks
26+
skip_install = true
27+
dependency_groups = dev
28+
commands =
29+
ruff check src/ tests/
30+
ruff format --check src/ tests/
31+
32+
[testenv:typecheck]
33+
description = Run pyright type checker
34+
dependency_groups = dev
35+
commands =
36+
pyright src/

0 commit comments

Comments
 (0)