diff --git a/CHANGELOG.md b/CHANGELOG.md index 4c6a08db2c..f067b4f698 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -71,6 +71,7 @@ Unreleased changes template. Other changes: * (python_repository) Start honoring the `strip_prefix` field for `zstd` archives. +* (pypi) {bzl:obj}`pip_parse.extra_hub_aliases` now works in WORKSPACE files. {#v0-0-0-fixed} ### Fixed diff --git a/examples/bzlmod/MODULE.bazel.lock b/examples/bzlmod/MODULE.bazel.lock index 9cad5952d7..18538d929a 100644 --- a/examples/bzlmod/MODULE.bazel.lock +++ b/examples/bzlmod/MODULE.bazel.lock @@ -1562,7 +1562,7 @@ }, "@@rules_python~//python/extensions:pip.bzl%pip": { "general": { - "bzlTransitiveDigest": "i5dWUNj1rZ4NKXmzLiGceV+1gAsDWtpJED1w1tdB7WY=", + "bzlTransitiveDigest": "c3HURsyNEdAN0fRo5BXiCkhhZSPfl1zNBcQOQbpgJ64=", "usagesDigest": "VmrNvB/4EhzsYieLDka9584M+pYKPpjNLl3Wcb5rx/c=", "recordedFileInputs": { "@@//requirements_lock_3_10.txt": "5e7083982a7e60f34998579a0ae83b520d46ab8f2552cc51337217f024e6def5", @@ -7035,7 +7035,7 @@ }, "@@rules_python~//python/private/pypi:pip.bzl%pip_internal": { "general": { - "bzlTransitiveDigest": "ltVKFX5LXgwSpZtjuyF02xZspYIWHEFmpxmzvnyMbQ8=", + "bzlTransitiveDigest": "H9pnwH6wHRp4Xy2CN6NSo0mDMHFDvpqspLNW6Xbqnhc=", "usagesDigest": "/lZXl/ZgP+u5PE8WkeWTyYBsvX9XQWFn1antj5qrBzQ=", "recordedFileInputs": { "@@rules_python~//tools/publish/requirements_linux.txt": "8175b4c8df50ae2f22d1706961884beeb54e7da27bd2447018314a175981997d", diff --git a/python/private/pypi/attrs.bzl b/python/private/pypi/attrs.bzl index c6132cb6c1..c9b7ea66a9 100644 --- a/python/private/pypi/attrs.bzl +++ b/python/private/pypi/attrs.bzl @@ -141,6 +141,16 @@ Special values: `host` (for generating deps for the host platform only) and NOTE: this is not for cross-compiling Python wheels but rather for parsing the `whl` METADATA correctly. """, ), + "extra_hub_aliases": attr.string_list_dict( + doc = """\ +Extra aliases to make for specific wheels in the hub repo. This is useful when +paired with the {attr}`whl_modifications`. + +:::{versionadded} 0.38.0 +::: +""", + mandatory = False, + ), "extra_pip_args": attr.string_list( doc = """Extra arguments to pass on to pip. Must not contain spaces. diff --git a/python/private/pypi/extension.bzl b/python/private/pypi/extension.bzl index ea2bafdb77..3df7b52e8a 100644 --- a/python/private/pypi/extension.bzl +++ b/python/private/pypi/extension.bzl @@ -750,16 +750,6 @@ The indexes must support Simple API as described here: https://packaging.python.org/en/latest/specifications/simple-repository-api/ """, ), - "extra_hub_aliases": attr.string_list_dict( - doc = """\ -Extra aliases to make for specific wheels in the hub repo. This is useful when -paired with the {attr}`whl_modifications`. - -:::{versionadded} 0.38.0 -::: -""", - mandatory = False, - ), "hub_name": attr.string( mandatory = True, doc = """ diff --git a/python/private/pypi/pip_repository.bzl b/python/private/pypi/pip_repository.bzl index 90cda77465..597b37f52c 100644 --- a/python/private/pypi/pip_repository.bzl +++ b/python/private/pypi/pip_repository.bzl @@ -177,6 +177,7 @@ def _pip_repository_impl(rctx): pkg: [whl_alias(repo = rctx.attr.name + "_" + pkg)] for pkg in bzl_packages or [] }, + extra_hub_aliases = rctx.attr.extra_hub_aliases, ) for path, contents in aliases.items(): rctx.file(path, contents)