refactor(dev): replace mypy with ty for type checking#60
Merged
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
Contributor
Author
|
when we merge typo pr, ci passes |
Contributor
There was a problem hiding this comment.
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? |
Contributor
Author
|
@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)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.