-
Notifications
You must be signed in to change notification settings - Fork 0
refactor(dev): replace mypy with ty for type checking #60
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
- Remove mypy and types-requests from dev dependencies - Update justfile to use ty check command - Update CI workflow to run ty instead of mypy - Update flake.nix pre-commit hook to use ty - Update documentation references in CLAUDE.md, README.md and rules
- Add ty: ignore[unresolved-import] for langgraph and mcp imports (these are optional dependencies not always installed) - Add ty: ignore[invalid-argument-type] for bm25s.tokenize stemmer=None (upstream type stub incorrectly requires callable) - Add ty: ignore[invalid-assignment] for dynamic schema_class - Remove unused TYPE_CHECKING import block in langgraph integration
|
when we merge typo pr, ci passes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No issues found across 12 files
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR replaces mypy with ty (Astral's new type checker) to provide faster type checking for the project. The migration is comprehensive and includes updating all configuration files, CI workflows, documentation, and adding appropriate ty ignore comments for optional dependencies and upstream type issues.
Key changes:
- Replaced mypy dependency with ty (version 0.0.3) in uv.lock and pyproject.toml
- Updated command from
just mypytojust tyacross all configuration files - Added ty ignore comments for optional dependencies (mcp, langgraph) and upstream type issues (bm25s)
Reviewed changes
Copilot reviewed 11 out of 12 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| uv.lock | Removed mypy, mypy-extensions, pathspec, and types-requests packages; added ty package with all platform-specific wheels |
| pyproject.toml | Replaced mypy dependency with ty in dev dependencies; removed mypy configuration section |
| stackone_ai/toolset.py | Added ty ignore comments for unresolved MCP imports (optional dependency) |
| stackone_ai/models.py | Added ty ignore comment for args_schema assignment in LangChain tool conversion |
| stackone_ai/meta_tools.py | Added ty ignore comments for bm25s.tokenize calls (upstream type issues) |
| stackone_ai/integrations/langgraph.py | Removed TYPE_CHECKING block; added ty ignore comments for langgraph imports (optional dependency) |
| justfile | Renamed command from mypy to ty with updated invocation |
| flake.nix | Updated pre-commit hook configuration from mypy to ty |
| .github/workflows/ci.yaml | Updated CI workflow step from "Run Mypy" to "Run Ty" |
| README.md | Updated documentation reference from mypy to ty in git hooks |
| CLAUDE.md | Updated all references from mypy to ty; corrected spelling from British to American English (organisation→organization, behaviour→behavior) |
| .claude/rules/development-workflow.md | Updated all references from mypy to ty; corrected spelling from British to American English |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
why's the flake one failing, is that intentional? |
|
@willleeney thanks. i think if we resolve conflicts it must works |
Resolved conflict in pyproject.toml: - Keep coverage configuration from main - Remove mypy configuration (replaced by ty in this branch)
glebedel
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Summary
just mypytojust tyTest plan
just tylocally - all checks passSummary by cubic
Replaced mypy with Astral’s ty for faster, simpler type checking. Updates commands, CI, pre-commit hooks, and code to work with ty.
Refactors
just ty; CI now runs ty; Nix pre-commit hook usesty check.Dependencies
Written for commit dd8c61b. Summary will update automatically on new commits.