Skip to content

Commit 7f1d59e

Browse files
authored
fix(bzlmod): use same target in requirement('foo') and all_requirements (#1973)
We have at least one instance in our pre-bzlmod workspace like: ``` deps = list(all_requirements) deps.remove(requirement('foo')) ``` But when using bzlmod, the generated `all_requirements` list contains targets like `@@rules_python~~pip~my_deps//sqlalchemy:sqlalchemy`, whereas `requirement('sqlalchemy')` will return `@@rules_python~~pip~my_deps//sqlalchemy:pkg`. So this operation now fails. This change makes `all_requirements` also use the `:pkg` targets to match `requirement`.
1 parent 8205468 commit 7f1d59e

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ A brief description of the categories of changes:
2828
* `protobuf`/`com_google_protobuf` dependency bumped to `v24.4`
2929

3030
### Fixed
31-
* Nothing yet
31+
* (bzlmod): Targets in `all_requirements` now use the same form as targets returned by the `requirement` macro.
3232

3333
### Removed
3434
* Nothing yet

python/private/bzlmod/pip_repository.bzl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ def _pip_repository_impl(rctx):
5555
for p in bzl_packages
5656
]),
5757
"%%ALL_REQUIREMENTS%%": render.list([
58-
macro_tmpl.format(p, p)
58+
macro_tmpl.format(p, "pkg")
5959
for p in bzl_packages
6060
]),
6161
"%%ALL_WHL_REQUIREMENTS_BY_PACKAGE%%": render.dict({

0 commit comments

Comments
 (0)