Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion prqlc/bindings/prqlc-python/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ For development, we use `uv` for fast dependency management:
uv run pytest

# Run type checking
uv run mypy
uv run ty check

# Or use the task runner
task test
Expand Down
6 changes: 3 additions & 3 deletions prqlc/bindings/prqlc-python/noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def _install_prqlc(session: Session) -> None:
"prqlc",
)
# Install dev dependencies separately since we're using dependency-groups
session.install("pytest>=7", "mypy==1.18.1")
session.install("pytest>=7", "ty>=0.0.27")


@nox.session(python=VERSIONS) # type: ignore[misc]
Expand All @@ -42,6 +42,6 @@ def tests(session: Session) -> None:

@nox.session(python=VERSIONS) # type: ignore[misc]
def typing(session: Session) -> None:
"""Check types with mypy"""
"""Check types with ty"""
_install_prqlc(session)
session.run("mypy")
session.run("ty", "check")
23 changes: 9 additions & 14 deletions prqlc/bindings/prqlc-python/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,17 @@ python-source = "python"
[dependency-groups]
dev = [
"pytest >= 7",
"mypy == 1.18.1",
"ty>=0.0.27",
]

[tool.ty.src]
# noxfile.py is build infrastructure, not part of the package
exclude = ["noxfile.py"]

[tool.ty.rules]
# prqlc.debug is a native PyO3 submodule, not a Python subpackage
possibly-missing-submodule = "ignore"

[tool.ruff]
fix = true
ignore = [
Expand All @@ -41,16 +49,3 @@ ignore = [
# No lambdas — too strict
"E731",
]

[tool.mypy]
files = "."
show_error_codes = true
strict = true
warn_unused_ignores = true

[[tool.mypy.overrides]]
ignore_missing_imports = true
module = [
"pytest.*",
"nox.*",
]
2 changes: 1 addition & 1 deletion prqlc/bindings/prqlc-python/python/prqlc/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# ruff: noqa: F403, F405
#
# This is the default module init provided automatically by Maturin.
from .prqlc import *
from .prqlc import * # ty: ignore[unresolved-import]
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

does this prevent all type checking?!

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

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.


__doc__ = prqlc.__doc__
if hasattr(prqlc, "__all__"):
Expand Down
Loading
Loading