feat: Switch type checker from mypy to ty#125
Open
fujikosu wants to merge 2 commits intofeat/migrate-to-uv-from-pipfrom
Open
feat: Switch type checker from mypy to ty#125fujikosu wants to merge 2 commits intofeat/migrate-to-uv-from-pipfrom
fujikosu wants to merge 2 commits intofeat/migrate-to-uv-from-pipfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Migrates the repository’s developer type-checking experience from mypy to Astral’s ty, aligning the devcontainers and documentation with ty’s VS Code extension + language server workflow.
Changes:
- Replace the mypy VS Code extension with
astral-sh.tyand configure devcontainers to disable the Python extension language server (python.languageServer: "None"). - Swap
mypy==1.20.0forty==0.0.29in devcontainerpyproject.tomlfiles and regenerate correspondinguv.lockfiles. - Update ignore rules and documentation to reference
tycache/files and planned future CI integration.
Reviewed changes
Copilot reviewed 10 out of 14 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
src/sample_pytorch_gpu_project/.devcontainer/uv.lock |
Removes mypy (and related deps) and adds ty to dev dependencies lock. |
src/sample_pytorch_gpu_project/.devcontainer/pyproject.toml |
Replaces mypy with ty in the dev dependency group. |
src/sample_pytorch_gpu_project/.devcontainer/devcontainer.json |
Switches VS Code extension to astral-sh.ty and sets python.languageServer to None with ty.importStrategy. |
src/sample_pytorch_gpu_project/.amlignore |
Replaces .mypy_cache ignore with .ty_cache. |
src/sample_cpu_project/.devcontainer/uv.lock |
Removes mypy (and related deps) and adds ty to dev dependencies lock. |
src/sample_cpu_project/.devcontainer/pyproject.toml |
Replaces mypy with ty in the dev dependency group. |
src/sample_cpu_project/.devcontainer/devcontainer.json |
Switches VS Code extension to astral-sh.ty and sets python.languageServer to None with ty.importStrategy. |
src/.amlignore |
Replaces .mypy_cache ignore with .ty_cache. |
README.md |
Documents ty rationale and adds roadmap note for future CI/pre-commit integration once stable. |
notebooks/.devcontainer/uv.lock |
Removes mypy (and related deps) and adds ty to dev dependencies lock. |
notebooks/.devcontainer/pyproject.toml |
Replaces mypy with ty in the dev dependency group. |
notebooks/.devcontainer/devcontainer.json |
Switches VS Code extension to astral-sh.ty and sets python.languageServer to None with ty.importStrategy. |
.gitignore |
Replaces mypy ignores with .ty_cache/. |
.dockerignore |
Replaces .mypy_cache ignore with .ty_cache. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Purpose
Migrate the type checking tooling from mypy to ty, an extremely fast Python type checker by Astral (creators of ruff and uv). ty is integrated as a VS Code extension for real-time editor feedback, replacing the mypy VS Code extension.
Key decisions:
astral-sh.tyreplacesms-python.mypy-type-checker)python.languageServer: "None"), which is ty's default recommended setupChanges
Type checker migration (mypy → ty)
ms-python.mypy-type-checkerextension withastral-sh.tyin all 3 devcontainer.json filesmypy-type-checker.importStrategysetting withty.importStrategyandpython.languageServer: "None"mypy==1.20.0withty==0.0.29in all devcontainer pyproject.toml filesuv.lockfiles to remove mypy and add ty.gitignore,.dockerignore,.amlignore:.mypy_cache→.ty_cacheREADME updates
Does this introduce a breaking change?
Author pre-publish checklist
Pull Request Type