Skip to content

Conversation

@ryoppippi
Copy link
Member

@ryoppippi ryoppippi commented Dec 18, 2025

Summary

  • Replace mypy with ty (Astral's new type checker) for faster type checking
  • Update justfile command from just mypy to just ty
  • Update CI workflow and flake.nix pre-commit hooks
  • Add ty ignore comments for optional dependencies (langgraph, mcp) and upstream type issues

Test plan

  • Run just ty locally - all checks pass
  • Verify CI workflow uses correct command
  • CI passes on this PR

Summary 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

    • Switched dev command to just ty; CI now runs ty; Nix pre-commit hook uses ty check.
    • Added targeted ty ignores for optional deps (langgraph, mcp), bm25s tokenize arg, and dynamic args_schema; removed unused TYPE_CHECKING in langgraph.
    • Updated docs and workflow references from mypy to ty.
  • Dependencies

    • Added ty>=0.0.3 to dev; removed mypy and types-requests.
    • Updated uv.lock to reflect the new tooling.

Written for commit dd8c61b. Summary will update automatically on new commits.

- 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
Copilot AI review requested due to automatic review settings December 18, 2025 20:09
@ryoppippi
Copy link
Member Author

when we merge typo pr, ci passes

Copy link

@cubic-dev-ai cubic-dev-ai bot left a 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

Copy link
Contributor

Copilot AI left a 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 mypy to just ty across 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.

@willleeney
Copy link

why's the flake one failing, is that intentional?

@ryoppippi
Copy link
Member Author

@willleeney thanks. i think if we resolve conflicts it must works
i'll do it!

Resolved conflict in pyproject.toml:
- Keep coverage configuration from main
- Remove mypy configuration (replaced by ty in this branch)
@ryoppippi ryoppippi requested a review from willleeney December 21, 2025 15:34
@ryoppippi ryoppippi enabled auto-merge (squash) December 21, 2025 15:34
@ryoppippi ryoppippi disabled auto-merge December 21, 2025 15:34
Copy link
Contributor

@glebedel glebedel left a comment

Choose a reason for hiding this comment

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

LGTM

@ryoppippi ryoppippi merged commit 2278a9f into main Dec 22, 2025
14 checks passed
@ryoppippi ryoppippi deleted the refactor/replace-mypy-with-ty branch December 22, 2025 10:07
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.

4 participants