Skip to content

Commit f902694

Browse files
committed
refactor: move group_map to builder
1 parent c8e5304 commit f902694

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

python/private/pypi/extension.bzl

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -538,12 +538,6 @@ You cannot use both the additive_build_content and additive_build_content_file a
538538
intersection[pkg] = None
539539
exposed_packages[hub_name] = intersection
540540

541-
# TODO @aignas 2024-04-05: how do we support different requirement
542-
# cycles for different abis/oses? For now we will need the users to
543-
# assume the same groups across all versions/platforms until we start
544-
# using an alternative cycle resolution strategy.
545-
hub_group_map[hub_name] = pip_attr.experimental_requirement_cycles
546-
547541
for hub in pip_hub_map.values():
548542
hub_whl_map.setdefault(hub.name, {})
549543
for key, settings in hub.whl_map.items():
@@ -558,6 +552,8 @@ You cannot use both the additive_build_content and additive_build_content_file a
558552
# replicate whl_libraries.update(out.whl_libraries)
559553
whl_libraries[whl_name] = lib
560554

555+
hub_group_map[hub.name] = hub.group_map
556+
561557
return struct(
562558
# We sort so that the lock-file remains the same no matter the order of how the
563559
# args are manipulated in the code going before.

python/private/pypi/hub_builder.bzl

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ def hub_builder(
4747
exposed_packages = {},
4848
extra_aliases = {},
4949
whl_libraries = {},
50+
group_map = {},
5051
_evaluate_markers_fn = evaluate_markers_fn,
5152
_logger = logger,
5253
_minor_mapping = minor_mapping,
@@ -93,6 +94,13 @@ def _add(self, *, pip_attr):
9394
_set_index_urls(self, pip_attr)
9495
self._pip_attrs[python_version] = pip_attr
9596

97+
# TODO @aignas 2024-04-05: how do we support different requirement
98+
# cycles for different abis/oses? For now we will need the users to
99+
# assume the same groups across all versions/platforms until we start
100+
# using an alternative cycle resolution strategy.
101+
self.group_map.clear()
102+
self.group_map.update(pip_attr.experimental_requirement_cycles)
103+
96104
def _set_index_urls(self, pip_attr):
97105
if not pip_attr.experimental_index_url:
98106
if pip_attr.experimental_extra_index_urls:

0 commit comments

Comments
 (0)