Skip to content

Commit 5c819b2

Browse files
committed
fix(bzlmod): pass extra_pip_args when building sdists in experimental mode
1 parent 387c2f6 commit 5c819b2

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

examples/bzlmod/MODULE.bazel.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

python/private/pypi/extension.bzl

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -275,8 +275,13 @@ def _create_whl_repos(module_ctx, pip_attr, whl_map, whl_overrides, group_map, s
275275
if pip_attr.auth_patterns:
276276
whl_library_args["auth_patterns"] = pip_attr.auth_patterns
277277

278-
# pip is not used to download wheels and the python `whl_library` helpers are only extracting things
279-
whl_library_args.pop("extra_pip_args", None)
278+
if distribution.filename.endswith(".whl"):
279+
# pip is not used to download wheels and the python `whl_library` helpers are only extracting things
280+
whl_library_args.pop("extra_pip_args", None)
281+
else:
282+
# For sdists, they will be built by `pip`, so we still
283+
# need to pass the extra args there.
284+
pass
280285

281286
# This is no-op because pip is not used to download the wheel.
282287
whl_library_args.pop("download_only", None)

0 commit comments

Comments
 (0)