Skip to content

Commit

Permalink
fix: Don't fail in override from a non-root module (#2566)
Browse files Browse the repository at this point in the history
This patch enable calls to pypi override from a non-root module without
failing. The call will instead be silently ignored.

Fixes #2550

---------

Co-authored-by: Ignas Anikevicius <[email protected]>
  • Loading branch information
mailto-jonas and aignas authored Jan 21, 2025
1 parent f219112 commit 50a9a2e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ Unreleased changes template.

{#v0-0-0-changed}
### Changed
* Nothing changed.
* (pypi) {obj}`pip.override` will now be ignored instead of raising an error,
fixes [#2550](https://github.com/bazelbuild/rules_python/issues/2550).

{#v0-0-0-fixed}
### Fixed
Expand Down
4 changes: 3 additions & 1 deletion python/private/pypi/extension.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,9 @@ You cannot use both the additive_build_content and additive_build_content_file a
for module in module_ctx.modules:
for attr in module.tags.override:
if not module.is_root:
fail("overrides are only supported in root modules")
# Overrides are only supported in root modules. Silently
# ignore the override:
continue

if not attr.file.endswith(".whl"):
fail("Only whl overrides are supported at this time")
Expand Down

0 comments on commit 50a9a2e

Please sign in to comment.