Skip to content

Commit cdcc00a

Browse files
committed
Add CI pipeline, nox multi-version testing, pre-commit hooks, ruff formatting
- Add GitHub Actions CI with 3×4 matrix (Python 3.12/3.13/3.14 × numpy-only/torch/jax/all) - Add noxfile.py with uv backend for local multi-version testing - Add uv-pre-commit hook (uv-lock) and local pytest pre-push hook - Broaden version constraints: requires-python >=3.12, numpy >=2.2.0, torch >=2.6.0, jax >=0.5.0 - Split optional deps into separate torch/jax dependency groups, add nox to dev - Fix ruff lint errors (unused imports) and reformat all code with ruff - Suppress pyright reportMissingImports for optional jax/torch imports - Reorganize tests into per-backend files (test_numpy, test_jax, test_torch)
1 parent 2acc8bc commit cdcc00a

29 files changed

+4095
-1986
lines changed

.github/workflows/ci.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
8+
concurrency:
9+
group: ${{ github.workflow }}-${{ github.ref }}
10+
cancel-in-progress: true
11+
12+
jobs:
13+
lint:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v4
17+
- 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/
21+
22+
typecheck:
23+
runs-on: ubuntu-latest
24+
steps:
25+
- uses: actions/checkout@v4
26+
- uses: astral-sh/setup-uv@v5
27+
- run: uv sync --group dev
28+
- run: uv run pyright src/
29+
30+
test:
31+
runs-on: ubuntu-latest
32+
strategy:
33+
fail-fast: false
34+
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 }})
38+
steps:
39+
- uses: actions/checkout@v4
40+
- 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

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,7 @@ wheels/
88

99
# Virtual environments
1010
.venv
11+
.lsp_mcp.port
12+
.claude/
13+
!.claude/skills/
14+
!.claude/commands/

.pre-commit-config.yaml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
default_install_hook_types: [pre-commit, pre-push, commit-msg]
2+
3+
repos:
4+
- repo: https://github.com/pre-commit/pre-commit-hooks
5+
rev: v6.0.0
6+
hooks:
7+
- id: trailing-whitespace
8+
- id: end-of-file-fixer
9+
- id: check-docstring-first
10+
- id: check-yaml
11+
- id: check-executables-have-shebangs
12+
- id: check-toml
13+
- id: debug-statements
14+
15+
- repo: https://github.com/astral-sh/uv-pre-commit
16+
rev: 0.10.7
17+
hooks:
18+
- id: uv-lock
19+
20+
- repo: https://github.com/tsvikas/sync-with-uv
21+
rev: v0.5.0
22+
hooks:
23+
- id: sync-with-uv
24+
25+
- repo: https://github.com/astral-sh/ruff-pre-commit
26+
rev: v0.15.4 # overwritten by `sync-with-uv` hook
27+
hooks:
28+
- id: ruff-check
29+
args: [--fix, --output-format=concise]
30+
- id: ruff-format
31+
args: [--output-format=concise]
32+
33+
- repo: https://github.com/codespell-project/codespell
34+
rev: v2.4.1 # overwritten by `sync-with-uv` hook
35+
hooks:
36+
- id: codespell
37+
stages: [pre-commit, commit-msg]
38+
39+
- repo: https://github.com/RobertCraigie/pyright-python
40+
rev: v1.1.351 # overwritten by `sync-with-uv` hook
41+
hooks:
42+
- id: pyright
43+
stages: [pre-push]
44+
pass_filenames: false
45+
46+
- repo: local
47+
hooks:
48+
- id: pytest
49+
name: pytest
50+
entry: uv run pytest tests/ -x -q
51+
language: system
52+
pass_filenames: false
53+
always_run: true
54+
stages: [pre-push]

0 commit comments

Comments
 (0)