Skip to content

feat: integrate ty type checker and replace pre-commit with prek#25

Open
GeorgePearse wants to merge 1 commit intomainfrom
feat/integrate-ty-and-prek
Open

feat: integrate ty type checker and replace pre-commit with prek#25
GeorgePearse wants to merge 1 commit intomainfrom
feat/integrate-ty-and-prek

Conversation

@GeorgePearse
Copy link
Copy Markdown
Owner

Summary

Replace pre-commit with prek and integrate ty (Astral's Python type checker) into the monorepo.

Changes

  • Replace pre-commit with prek: Swapped pre-commit==4.0.1 for prek==0.3.3 in dev dependencies. prek is a Rust-based drop-in replacement that reads the same .pre-commit-config.yaml and runs significantly faster.
  • Add ty type checker hook: Added a local ty check hook in .pre-commit-config.yaml that runs on all Python file changes.
  • Configure ty: Added [tool.ty.src] and [tool.ty.environment] sections in pyproject.toml, targeting the genesis/ package with Python 3.12, excluding tests/, results/, and examples/.

Testing

  • Verified prek install succeeds and hooks are registered
  • Verified ty check and prek run ty --all-files both execute correctly
  • Pre-existing type errors are flagged (expected for a codebase without prior type checking)

- Replace pre-commit with prek (Rust-based drop-in replacement) in dev deps
- Add ty (Astral's fast Python type checker) as a local pre-commit hook
- Configure ty in pyproject.toml: target genesis/ package, Python 3.12

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
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.

1 participant