chore: switch from mypy to ty for Python type checking#5761
Conversation
Bumps [mypy](https://github.com/python/mypy) from 1.18.1 to 1.19.1. - [Changelog](https://github.com/python/mypy/blob/master/CHANGELOG.md) - [Commits](python/mypy@v1.18.1...v1.19.1) --- updated-dependencies: - dependency-name: mypy dependency-version: 1.19.1 dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com>
|
@prql-bot can you switch from mypy to ty? |
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
Done — switched from mypy to ty across |
- Exclude noxfile.py from ty checking (build infrastructure) - Add ty: ignore for .prqlc native extension import - Add explicit import of prqlc.debug submodule in tests Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The explicit `import prqlc.debug` breaks pytest because it's a native PyO3 submodule, not a Python subpackage. Suppress the warning in ty config instead. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Rule severity is configured as `rule-name = "level"`, not as a list. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
| # | ||
| # This is the default module init provided automatically by Maturin. | ||
| from .prqlc import * | ||
| from .prqlc import * # ty: ignore[unresolved-import] |
There was a problem hiding this comment.
does this prevent all type checking?!
There was a problem hiding this comment.
No — ty: ignore[unresolved-import] only suppresses the unresolved-import diagnostic on that single line. All other type checking remains active. The .prqlc module is a native PyO3 extension that only exists after Maturin builds it, so ty can't resolve the import statically — same reason the old mypy config had ignore_missing_imports = true for similar cases.
The pyproject.toml config also sets possibly-missing-submodule = "ignore" for prqlc.debug (another native submodule), but everything else is checked normally.
That said, if you'd prefer a different approach — like a stub file or removing the ignore — happy to adjust.
Summary
uv.lockRequested in #5761 (comment)