-
-
Notifications
You must be signed in to change notification settings - Fork 0
🔧 Enable ty for type checking
#142
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
📝 WalkthroughSummary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings. WalkthroughEnabled Astral's Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~5-10 minutes
Possibly related PRs
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 inconclusive)
✅ Passed checks (2 passed)
✨ Finishing touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
ty for type checking
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.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
⛔ Files ignored due to path filters (1)
uv.lockis excluded by!**/*.lock
📒 Files selected for processing (3)
.github/workflows/ci.yml(1 hunks).pre-commit-config.yaml(2 hunks)pyproject.toml(2 hunks)
🧰 Additional context used
🧠 Learnings (3)
📓 Common learnings
Learnt from: burgholzer
Repo: munich-quantum-toolkit/core PR: 1337
File: pyproject.toml:351-351
Timestamp: 2025-11-28T14:33:15.199Z
Learning: In the munich-quantum-toolkit/core repository, the dev dependency "ty==0.0.1a27" is intentionally pinned to an exact pre-release version. This dependency is used by the `ty-check` pre-commit hook (via `uv run --only-dev ty check`), and the exact pin ensures all developers run the same version, preventing unexpected issues from updates since ty is in alpha and changing rapidly.
📚 Learning: 2025-11-28T14:33:15.199Z
Learnt from: burgholzer
Repo: munich-quantum-toolkit/core PR: 1337
File: pyproject.toml:351-351
Timestamp: 2025-11-28T14:33:15.199Z
Learning: In the munich-quantum-toolkit/core repository, the dev dependency "ty==0.0.1a27" is intentionally pinned to an exact pre-release version. This dependency is used by the `ty-check` pre-commit hook (via `uv run --only-dev ty check`), and the exact pin ensures all developers run the same version, preventing unexpected issues from updates since ty is in alpha and changing rapidly.
Applied to files:
pyproject.toml.pre-commit-config.yaml.github/workflows/ci.yml
📚 Learning: 2025-10-11T13:21:15.212Z
Learnt from: denialhaag
Repo: munich-quantum-toolkit/ddsim PR: 674
File: .github/workflows/cd.yml:56-56
Timestamp: 2025-10-11T13:21:15.212Z
Learning: In the ddsim repository, modifying .github/workflows/cd.yml intentionally triggers CD workflow testing in CI through a change-detection mechanism in ci.yml. The change-detection job outputs a run-cd flag that controls whether build-sdist and build-wheel jobs execute in CI, allowing testing of the CD workflow (including wheel building and testing) before actual releases.
Applied to files:
.github/workflows/ci.yml
🔇 Additional comments (4)
pyproject.toml (1)
68-71: Configuration aligns with strict type checking.The
[tool.ty.terminal]configuration witherror-on-warning = truecorrectly enforces strict typing by treating warnings as errors. This is consistent with the strict mypy configuration already in place..pre-commit-config.yaml (2)
14-14: Appropriate addition to CI skip list.Adding
ty-checkto the pre-commit CI skip list aligns with the pattern used formypy. Type-checking hooks should skip in CI and run via the dedicated workflow instead, preventing interference with other hooks.
75-84: Verify hook implementation against the established pattern.The
ty-checkhook implementation usesuv sync --no-install-project --inexactfollowed byuv run --no-sync ty check. However, retrieved learnings frommunich-quantum-toolkit/corePR 1337 show a simpler approach:uv run --only-dev ty check.Two specific concerns:
- The
--inexactflag is unusual for lock-file-based workflows; typically you want--exactfor reproducibility.- The manual
uv syncbeforeuv runadds complexity that may be unnecessary ifuv run --only-devis sufficient.Please verify this implementation is correct or consider aligning with the simpler pattern from the related PR.
.github/workflows/ci.yml (1)
43-44: No issues found. Theenable-ty: trueflag is properly supported by the pinned reusable workflow version (v1.17.3 at commit dbcd4474154dda0794838207274a3bccd4550de0). The reusable-python-linter workflow defines this as a valid boolean input and correctly runsty checkwhen enabled.
Description
This PR experimentally enables
tyfor type checking.Checklist:
I have added appropriate tests that cover the new/changed functionality.I have updated the documentation to reflect these changes.I have added entries to the changelog for any noteworthy additions, changes, fixes, or removals.I have added migration instructions to the upgrade guide (if needed).