Skip to content

chore: migrate type checker from mypy to ty#106

Merged
pesap merged 1 commit intomainfrom
chore/migrate-mypy-to-ty
Mar 16, 2026
Merged

chore: migrate type checker from mypy to ty#106
pesap merged 1 commit intomainfrom
chore/migrate-mypy-to-ty

Conversation

@pesap
Copy link
Collaborator

@pesap pesap commented Mar 16, 2026

Summary

  • Replace mypy with ty (Astral's Rust-based type checker) in dev dependencies
  • Replace [tool.mypy] configuration with [tool.ty] sections in pyproject.toml
  • Update pre-commit hook to run ty check instead of mypy
  • Add a dedicated ty CI job with --output-format github for inline PR annotations
  • Gate pytest and benchmarks jobs on both prek and ty passing

Why

ty is significantly faster than mypy (10-100x, written in Rust) and is actively maintained by Astral (the same team behind ruff and uv). The codebase passes clean under ty with zero changes to source code.

Notes

  • ty is still beta (0.0.x), so the minimum version is pinned at >=0.0.23
  • ty respects # type: ignore comments by default, so existing type suppression continues to work
  • .ty_cache/ added to .gitignore; mypy entries kept for stale cache cleanup

Replace mypy with ty (Astral's Rust-based type checker) across dev
dependencies, pre-commit hooks, and CI. Add a dedicated ty CI job with
GitHub-formatted annotations for inline PR feedback.
@pesap pesap merged commit ac2c8cd into main Mar 16, 2026
28 checks passed
@pesap pesap deleted the chore/migrate-mypy-to-ty branch March 16, 2026 02:36
@codecov-commenter
Copy link

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.63%. Comparing base (67ca845) to head (3c65987).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #106   +/-   ##
=======================================
  Coverage   95.63%   95.63%           
=======================================
  Files           8        8           
  Lines        1719     1719           
=======================================
  Hits         1644     1644           
  Misses         75       75           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants