diff --git a/python/private/pypi/whl_library.bzl b/python/private/pypi/whl_library.bzl index db2b6bc770..4a72e5e259 100644 --- a/python/private/pypi/whl_library.bzl +++ b/python/private/pypi/whl_library.bzl @@ -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, @@ -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} VERSION_NEXT_FEATURE +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",