10000 refactor: remove unused target_platforms hub_repository attr (#2912) · benjaminp/rules_python@67c5cf0 · GitHub
[go: up one dir, main page]

Skip to content

Commit 67c5cf0

Browse files
authored
refactor: remove unused target_platforms hub_repository attr (bazel-contrib#2912)
The target_platforms attribute is unused. The attribute gets used, but the values it computes are never used.
1 parent 9abd323 commit 67c5cf0

File tree

2 files changed

+0
-17
lines changed

2 files changed

+0
-17
lines changed

python/private/pypi/extension.bzl

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -275,12 +275,6 @@ def _create_whl_repos(
275275
},
276276
extra_aliases = extra_aliases,
277277
whl_libraries = whl_libraries,
278-
target_platforms = {
279-
plat: None
280-
for reqs in requirements_by_platform.values()
281-
for req in reqs
282-
for plat in req.target_platforms
283-
},
284278
)
285279

286280
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 @@ You cannot use both the additive_build_content and additive_build_content_file a
453447
hub_group_map = {}
454448
exposed_packages = {}
455449
extra_aliases = {}
456-
target_platforms = {}
457450
whl_libraries = {}
458451

459452
for mod in module_ctx.modules:
@@ -536,7 +529,6 @@ You cannot use both the additive_build_content and additive_build_content_file a
536529
for whl_name, aliases in out.extra_aliases.items():
537530
extra_aliases[hub_name].setdefault(whl_name, {}).update(aliases)
538531
exposed_packages.setdefault(hub_name, {}).update(out.exposed_packages)
539-
target_platforms.setdefault(hub_name, {}).update(out.target_platforms)
540532
whl_libraries.update(out.whl_libraries)
541533

542534
# TODO @aignas 2024-04-05: how do we support different requirement
@@ -574,10 +566,6 @@ You cannot use both the additive_build_content and additive_build_content_file a
574566
}
575567
for hub_name, extra_whl_aliases in extra_aliases.items()
576568
},
577-
target_platforms = {
578-
hub_name: sorted(p)
579-
for hub_name, p in target_platforms.items()
580-
},
581569
whl_libraries = {
582570
k: dict(sorted(args.items()))
583571
for k, args in sorted(whl_libraries.items())
@@ -669,7 +657,6 @@ def _pip_impl(module_ctx):
669657
},
670658
packages = mods.exposed_packages.get(hub_name, []),
671659
groups = mods.hub_group_map.get(hub_name),
672-
target_platforms = mods.target_platforms.get(hub_name, []),
673660
)
674661

675662
if bazel_features.external_deps.extension_metadata_has_reproducible:

python/private/pypi/hub_repository.bzl

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,10 +87,6 @@ The list of packages that will be exposed via all_*requirements macros. Defaults
8787
mandatory = True,
8888
doc = "The apparent name of the repo. This is needed because in bzlmod, the name attribute becomes the canonical name.",
8989
),
90-
"target_platforms": attr.string_list(
91-
mandatory = True,
92-
doc = "All of the target platforms for the hub repo",
93-
),
9490
"whl_map": attr.string_dict(
9591
mandatory = True,
9692
doc = """\

0 commit comments

Comments
 (0)
0