Skip to content

feat: Migrate type checking from mypy to ty - #5

Merged
awinml merged 2 commits into
mainfrom
migrate_ty
May 26, 2026
Merged

feat: Migrate type checking from mypy to ty#5
awinml merged 2 commits into
mainfrom
migrate_ty

Conversation

@awinml

@awinml awinml commented May 26, 2026

Copy link
Copy Markdown
Member

Summary

Migrate the project type checker from mypy to ty and apply the source updates required for ty compatibility.

Changes

  • Replaced mypy with ty in pyproject.toml
  • Removed [tool.mypy] configuration
  • Added [tool.ty] configuration and overrides
  • Updated Makefile so make lint-typing runs uv run ty check src/ tests
  • Replaced the pre-commit mypy hook with a local ty hook
  • Updated pre-commit CI skip config from mypy to ty
  • Updated RAG pipeline files for ty compatibility:
    • removed explicit Dataset annotations from load_dataset(...) calls
    • removed now-unused Dataset imports
  • Updated type-ignore comments for ty compatibility
  • Removed stale cached-decorator # type: ignore comments where ty no longer requires them
  • Updated contributor documentation to reference ty

Checklist

  • Code follows project style (make lint-check)
  • Type annotations pass (make lint-typing)
  • No typos (make lint-typos)
  • No new security issues (make security-bandit)
  • Dependency vulnerabilities checked (make security-audit)
  • Pre-commit hooks pass (uv run pre-commit run --all-files)

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request replaces mypy with ty as the project's type checker, updates configuration files, and expands the CONTRIBUTING.md documentation with development commands and contribution guidelines. The reviewer feedback highlights three main areas for improvement: first, the configuration in pyproject.toml broadly ignores core type-checking rules, which significantly reduces the utility of static analysis; second, the documentation incorrectly describes ty as Astral's Rust-based type checker (which is actually redknot); and third, a dictionary lookup in fixed_schema_enricher.py can be simplified using .get() to avoid a double lookup and eliminate an inline type ignore.

Comment thread pyproject.toml
Comment thread CONTRIBUTING.md
Comment thread src/rag_pipelines/utils/metadata_enricher/fixed_schema_enricher.py Outdated
@awinml
awinml merged commit 8bc2790 into main May 26, 2026
5 checks passed
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