refactor: remove unused target_platforms hub_repository attr (#2912)
The target_platforms attribute is unused. The attribute gets used, but
the values it
computes are never used.
diff --git a/python/private/pypi/extension.bzl b/python/private/pypi/extension.bzl
index 3896f29..d3a15df 100644
--- a/python/private/pypi/extension.bzl
+++ b/python/private/pypi/extension.bzl
@@ -275,12 +275,6 @@
},
extra_aliases = extra_aliases,
whl_libraries = whl_libraries,
- target_platforms = {
- plat: None
- for reqs in requirements_by_platform.values()
- for req in reqs
- for plat in req.target_platforms
- },
)
def _whl_repos(*, requirement, whl_library_args, download_only, netrc, auth_patterns, multiple_requirements_for_whl = False, python_version, enable_pipstar = False):
@@ -453,7 +447,6 @@
hub_group_map = {}
exposed_packages = {}
extra_aliases = {}
- target_platforms = {}
whl_libraries = {}
for mod in module_ctx.modules:
@@ -536,7 +529,6 @@
for whl_name, aliases in out.extra_aliases.items():
extra_aliases[hub_name].setdefault(whl_name, {}).update(aliases)
exposed_packages.setdefault(hub_name, {}).update(out.exposed_packages)
- target_platforms.setdefault(hub_name, {}).update(out.target_platforms)
whl_libraries.update(out.whl_libraries)
# TODO @aignas 2024-04-05: how do we support different requirement
@@ -574,10 +566,6 @@
}
for hub_name, extra_whl_aliases in extra_aliases.items()
},
- target_platforms = {
- hub_name: sorted(p)
- for hub_name, p in target_platforms.items()
- },
whl_libraries = {
k: dict(sorted(args.items()))
for k, args in sorted(whl_libraries.items())
@@ -669,7 +657,6 @@
},
packages = mods.exposed_packages.get(hub_name, []),
groups = mods.hub_group_map.get(hub_name),
- target_platforms = mods.target_platforms.get(hub_name, []),
)
if bazel_features.external_deps.extension_metadata_has_reproducible:
diff --git a/python/private/pypi/hub_repository.bzl b/python/private/pypi/hub_repository.bzl
index 0a1e772..0dbc6c2 100644
--- a/python/private/pypi/hub_repository.bzl
+++ b/python/private/pypi/hub_repository.bzl
@@ -87,10 +87,6 @@
mandatory = True,
doc = "The apparent name of the repo. This is needed because in bzlmod, the name attribute becomes the canonical name.",
),
- "target_platforms": attr.string_list(
- mandatory = True,
- doc = "All of the target platforms for the hub repo",
- ),
"whl_map": attr.string_dict(
mandatory = True,
doc = """\