Copilot commented on code in PR #50168:
URL: https://github.com/apache/arrow/pull/50168#discussion_r3411695551
##########
ci/scripts/python_wheel_validate_contents.py:
##########
@@ -54,38 +54,43 @@ def validate_wheel(path):
info.filename.split("/")[-1] == filename for info in
wheel_zip.filelist
), f"{filename} is missing from the wheel."
- assert any(
- info.filename == "pyarrow/py.typed" for info in wheel_zip.filelist
- ), "pyarrow/py.typed is missing from the wheel."
-
- source_root = Path(__file__).resolve().parents[2]
- stubs_dir = source_root / "python" / "pyarrow-stubs" / "pyarrow"
- assert stubs_dir.exists(), f"Stub source directory not found:
{stubs_dir}"
-
- expected_stub_files = {
- f"pyarrow/{stub_file.relative_to(stubs_dir).as_posix()}"
- for stub_file in stubs_dir.rglob("*.pyi")
- }
-
- wheel_stub_files = {
- info.filename
- for info in wheel_zip.filelist
- if info.filename.startswith("pyarrow/") and
info.filename.endswith(".pyi")
- }
-
- assert wheel_stub_files == expected_stub_files, (
- "Wheel .pyi files differ from python/pyarrow-stubs/pyarrow.\n"
- f"Missing in wheel: {sorted(expected_stub_files -
wheel_stub_files)}\n"
- f"Unexpected in wheel: {sorted(wheel_stub_files -
expected_stub_files)}"
- )
-
- wheel_docstring_count = sum(
- _count_docstrings(wheel_zip.read(wsf).decode("utf-8"))
- for wsf in wheel_stub_files
- )
-
- print(f"Found {wheel_docstring_count} docstring(s) in wheel stubs.")
- assert wheel_docstring_count, "No docstrings found in wheel stub
files."
+ # TODO(GH-48970): Uncomment when stubfiles are complete
+ # assert any(
+ # info.filename == "pyarrow/py.typed" for info in
wheel_zip.filelist
+ # ), "pyarrow/py.typed is missing from the wheel."
+
+ # TODO(GH-49831): Re-enable when incomplete stubs are shipped in wheels
+ # again. For now, wheels intentionally omit pyarrow-stubs because some
+ # type checkers consume .pyi files even without py.typed.
+ #
Review Comment:
Wheel validation no longer checks the *intended* behavior for this PR (that
wheels must omit `pyarrow/py.typed` and any `.pyi` files). With the assertions
commented out, CI will silently accept wheels that accidentally re-include
these files, defeating the purpose of the change. Consider asserting their
absence until stubs are ready to ship again.
##########
python/CMakeLists.txt:
##########
@@ -1041,32 +1041,36 @@ endif()
#
# Type stubs with docstring injection
#
+# TODO(GH-49831): Temporarily do not install pyarrow-stubs into wheels.
+# The stubs are incomplete, and some type checkers consume .pyi files even
+# without the py.typed marker. Re-enable this when the stubs are complete.
+#
Review Comment:
Commenting out the stub install block also removes the only check that
enforced `PYARROW_REQUIRE_STUB_DOCSTRINGS`. As a result, setting this option
will be silently ignored instead of failing the build when stub docstring
injection can’t run.
##########
python/pyproject.toml:
##########
@@ -88,6 +88,12 @@ metadata.version.provider =
"scikit_build_core.metadata.setuptools_scm"
sdist.include = ["pyarrow/_generated_version.py", "cmake_modules/",
"pyarrow-stubs/"]
wheel.packages = ["pyarrow"]
wheel.install-dir = "pyarrow"
+# TODO(GH-48970): Remove this when stubfiles are complete
+# Withhold the PEP 561 marker until the type stubs are complete. The .pyi files
+# are also temporarily omitted from wheels, so type checkers don't rely on the
+# incomplete stubs and break downstream users (GH-49831). py.typed is kept
+# in-tree for CI type-checking.
+wheel.exclude = ["pyarrow/py.typed"]
Review Comment:
PR description says the change is to exclude only `pyarrow/py.typed` from
wheels, but this PR also disables installing/shipping the `.pyi` stubs (CMake
install block commented out, and wheel-content validation for stubs removed).
Please update the PR description (and/or the TODO comments) to accurately
reflect that wheels are now intentionally omitting both `py.typed` and `.pyi`
files.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]