-
Notifications
You must be signed in to change notification settings - Fork 0
Replace mypy with ty #46
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
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 the mypy type checker with ty across the development toolchain and CI/CD pipeline.
Key changes:
- Swaps mypy (v1.18.2+) for ty (v0.0.7) as the project's type checker
- Updates all type checker ignore comments from
type: ignoretoty: ignoresyntax in test files - Removes the justfile "clean" recipe (appears unrelated to the main purpose)
Reviewed changes
Copilot reviewed 7 out of 8 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| uv.lock | Removes mypy and its dependencies (librt, mypy-extensions, pathspec), adds ty v0.0.7 with platform-specific wheels |
| pyproject.toml | Replaces mypy dependency and configuration with ty; removes strict type checking flags (warn_return_any, disallow_untyped_defs, etc.) |
| justfile | Updates typecheck command from mypy . to ty check; removes "clean" recipe and its help text |
| docs/contributing.md | Updates documentation references from mypy to ty |
| alphaflow/tests/test_csv_data_feed.py | Converts type: ignore comments to ty: ignore[deprecated] syntax for CSVDataFeed usage |
| alphaflow/data_feeds/init.py | Adds ty: ignore[deprecated] comment to CSVDataFeed import |
| CHANGELOG.md | Documents the mypy-to-ty migration in the Unreleased section |
| .github/workflows/ci.yml | Updates CI workflow to run ty check instead of mypy . |
| "pytest-httpx>=0.35.0", | ||
| "ruff>=0.14.0", | ||
| "rust-just>=1.45.0", | ||
| "ty>=0.0.7", |
Copilot
AI
Dec 26, 2025
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.
This PR replaces mypy with ty, a package at version 0.0.7 which suggests it's in very early experimental stages. The extremely low version number (0.0.x) typically indicates pre-alpha software that may not be production-ready. Consider whether it's appropriate to replace a mature, well-established type checker like mypy with such an early-stage tool. If ty is genuinely intended for production use, it would be helpful to document why this change is being made and what advantages ty provides over mypy, especially given the stability risks.
| "D203", # one-blank-line-before-class (conflicts with D211) | ||
| "D213", # multi-line-summary-second-line (conflicts with D212) | ||
| ] | ||
|
|
Copilot
AI
Dec 26, 2025
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.
The ty configuration section only includes the source directory but removes all the strict type checking flags that were configured for mypy (warn_return_any, disallow_untyped_defs, warn_redundant_casts, strict_equality, etc.). This represents a significant reduction in type checking strictness. If ty supports similar configuration options, they should be added to maintain the same level of type safety that the project previously had.
| [tool.ty] | |
| strict = true | |
| warn_return_any = true | |
| disallow_untyped_defs = true | |
| warn_redundant_casts = true | |
| strict_equality = true |
| check: lint typecheck test | ||
|
|
Copilot
AI
Dec 26, 2025
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.
The PR description mentions "Replace mypy with ty" but the diff shows that the "clean" recipe has also been removed from the justfile. This appears to be an unrelated change that should either be mentioned in the PR description or restored. The clean recipe was useful for removing cache files and build artifacts (.mypy_cache/, .ruff_cache/, etc.).
| @echo "just check - Run all checks (lint + typecheck + test)" | ||
| @echo "just clean - Remove cache files and build artifacts" | ||
| @echo "just install - Install dependencies" | ||
| @echo "just docs - Serve documentation locally" |
Copilot
AI
Dec 26, 2025
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.
The help text was also updated to remove the "just clean" command description. Since the clean recipe has been removed, this change is consistent, but if the clean recipe removal was unintentional, this line should be restored as well.
No description provided.