Skip to content

Commit 727ab43

Browse files
authored
fix(pypi): Fix use_hub_alias_dependencies with WORKSPACE (#2504)
The code path pip_parse follows when using a WORKSPACE file with use_hub_alias_dependencies enabled forgets to pass requirement cycles along to alias creation, leading to the _groups package never being created and aliases skipping them. Requirement cycles are just ignored entirely. In this patch we attempt to fix that so grouping works more or less the same way as it does under bzlmod with that flag enabled.
1 parent 15cc0b3 commit 727ab43

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

Diff for: CHANGELOG.md

+3
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,9 @@ Unreleased changes template.
6767
Fixes [#2450](https://github.com/bazelbuild/rules_python/issues/2450).
6868
* (gazelle) Gazelle will now correctly parse Python3.12 files that use [PEP 695 Type
6969
Parameter Syntax][pep-695]. (#2396)
70+
* (pypi) Using {bzl:obj}`pip_parse.experimental_requirement_cycles` and
71+
{bzl:obj}`pip_parse.use_hub_alias_dependencies` together now works when
72+
using WORKSPACE files.
7073

7174
[pep-695]: https://peps.python.org/pep-0695/
7275

Diff for: python/private/pypi/pip_repository.bzl

+1
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,7 @@ def _pip_repository_impl(rctx):
178178
for pkg in bzl_packages or []
179179
},
180180
extra_hub_aliases = rctx.attr.extra_hub_aliases,
181+
requirement_cycles = requirement_cycles,
181182
)
182183
for path, contents in aliases.items():
183184
rctx.file(path, contents)

0 commit comments

Comments
 (0)