Skip to content

Commit

Permalink
fix(bzlmod): pass only non-default values to whl_library (#2002)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
aignas authored Jun 22, 2024
1 parent d003204 commit 0fd7b64
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ A brief description of the categories of changes:
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.
Expand Down
6 changes: 5 additions & 1 deletion python/private/bzlmod/pip.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,11 @@ def _create_whl_repos(module_ctx, pip_attr, whl_map, whl_overrides, group_map, s
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
Expand Down

0 comments on commit 0fd7b64

Please sign in to comment.