Skip to content

Add CI: ruff, typos, build, Python 3.12+ compatibility - #46

Merged
neuromechanist merged 3 commits into
mainfrom
45-add-ci-ruff-typos-build-python-312+-compatibility
Jul 6, 2026
Merged

Add CI: ruff, typos, build, Python 3.12+ compatibility#46
neuromechanist merged 3 commits into
mainfrom
45-add-ci-ruff-typos-build-python-312+-compatibility

Conversation

@neuromechanist

Copy link
Copy Markdown
Member

Closes #45.

Adds the first CI for the repo (none existed), covering the checks the project rules (.rules/ci_cd.md) call for.

Jobs (.github/workflows/ci.yml)

  • lint - ruff check . + ruff format --check . (repo-wide).
  • typos - crate-ci/typos with _typos.toml. Allowlists the AMICA/Fortran domain abbreviations nd (data-sample count), numer (numerator), thr (threshold); excludes the read-only *.f90 reference and generated data/output (pyAMICA/sample_data/, pytorch_debug_test/).
  • test - pytest -m "not slow" on Python 3.12. The slow tests invoke the macOS-only Fortran reference binary (pyAMICA/sample_data/amica15mac), which cannot execute on the Linux runner; MPS-specific tests self-skip without MPS hardware.
  • build - uv build sdist+wheel, install the wheel into a clean env, and import pyAMICA, on Python 3.12 and 3.13 (per requires-python >=3.12).

Prerequisite fix

First commit makes the repo ruff-clean: the staged-only pre-commit hook had left legacy modules with 2 ruff check errors (unused scipy.linalg import, unused batch_size) and 5 unformatted files.

Local validation

  • ruff check . / ruff format --check .: clean.
  • typos: 0 errors with the config.
  • uv build + clean-env import pyAMICA: OK.
  • pytest -m "not slow": 37 passed, 1 xfailed (5 slow deselected).

The staged-only pre-commit hook had left legacy modules with 2 ruff-check
errors (unused scipy.linalg import, unused batch_size) and 5 unformatted
files. Fix them so a repo-wide ruff gate is green.
GitHub Actions (.github/workflows/ci.yml):
- lint: ruff check + ruff format --check (repo-wide)
- typos: crate-ci/typos with _typos.toml (allowlists domain terms nd/numer/
  thr; excludes the read-only *.f90 reference and generated data/output)
- test: pytest -m 'not slow' on 3.12 (slow tests need the macOS-only Fortran
  binary, which can't run on the Linux runner)
- build: uv build sdist+wheel, install into a clean env and import, matrix
  Python 3.12 + 3.13 (per requires-python >=3.12)

Closes #45.
@neuromechanist neuromechanist linked an issue Jul 6, 2026 that may be closed by this pull request
The lint job's 'uv run ruff' failed in CI ('Failed to spawn: ruff')
because ruff was never a declared dependency; a clean 'uv sync' didn't
install it (it was only on PATH locally). Pin it in the dev group + lock.
@neuromechanist
neuromechanist merged commit 4b25fab into main Jul 6, 2026
5 checks passed
@neuromechanist
neuromechanist deleted the 45-add-ci-ruff-typos-build-python-312+-compatibility branch July 6, 2026 17:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add CI: ruff, typos, build, Python 3.12+ compatibility

1 participant