Skip to content
Merged
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
15 changes: 13 additions & 2 deletions python/private/pypi/whl_library.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -548,7 +548,12 @@ def _whl_library_impl(rctx):
paths.extend(path.readdir())

rctx.file("BUILD.bazel", build_file_contents)
return

if enable_pipstar and enable_pipstar_extract:
if hasattr(rctx, "repo_metadata"):
return rctx.repo_metadata(reproducible = True)

return None

def _generate_entry_point_contents(
module,
Expand Down Expand Up @@ -690,7 +695,13 @@ whl_library = repository_rule(
attrs = whl_library_attrs,
doc = """
Download and extracts a single wheel based into a bazel repo based on the requirement string passed in.
Instantiated from pip_repository and inherits config options from there.""",
Instantiated from pip_repository and inherits config options from there.

:::{versionchanged} 1.9.0
The `whl_library` is marked as reproducible if using starlark to extract and parse the
wheel contents without building an `sdist` first.
:::
Comment on lines +700 to +703
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

For consistency with other documentation blocks in the repository (e.g., in python/private/pypi/attrs.bzl), please use four colons (::::) for the versionchanged directive instead of three.

Suggested change
:::{versionchanged} 1.9.0
The `whl_library` is marked as reproducible if using starlark to extract and parse the
wheel contents without building an `sdist` first.
:::
::::{versionchanged} 1.9.0
The `whl_library` is marked as reproducible if using starlark to extract and parse the
wheel contents without building an `sdist` first.
::::

""",
implementation = _whl_library_impl,
environ = [
"RULES_PYTHON_PIP_ISOLATED",
Expand Down