fix(bzlmod): pass only non-default values to whl_library (#2002)
Before this change `isolated`, `quiet` and `timeout` would get dropped
if they were specified to some non-default value. This fixes it.
Work towards #260.
diff --git a/CHANGELOG.md b/CHANGELOG.md
index af6e527..b259e51 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -39,6 +39,8 @@
other toolchains support.
* (providers) {obj}`PyRuntimeInfo` doesn't require passing the
`interpreter_version_info` arg.
+* (bzlmod) Correctly pass `isolated`, `quiet` and `timeout` values to `whl_library`
+ and drop the defaults from the lock file.
### Removed
* (pip): Removes the `entrypoint` macro that was replaced by `py_console_script_binary` in 0.26.0.
diff --git a/python/private/bzlmod/pip.bzl b/python/private/bzlmod/pip.bzl
index 122debd..2ded3a4 100644
--- a/python/private/bzlmod/pip.bzl
+++ b/python/private/bzlmod/pip.bzl
@@ -239,7 +239,11 @@
quiet = (pip_attr.quiet, True),
timeout = (pip_attr.timeout, 600),
)
- whl_library_args.update({k: v for k, (v, default) in maybe_args_with_default.items() if v == default})
+ whl_library_args.update({
+ k: v
+ for k, (v, default) in maybe_args_with_default.items()
+ if v != default
+ })
if get_index_urls:
# TODO @aignas 2024-05-26: move to a separate function