Skip to content

Commit

Permalink
refactor: allow py_library to accept additional fragments (bazelbuild…
Browse files Browse the repository at this point in the history
…#2170)

This allows the Google fork to pass additional fragment names.
  • Loading branch information
rickeylev authored Aug 31, 2024
1 parent e15fc16 commit 4f2dd2f
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions python/private/common/py_library.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -127,14 +127,16 @@ def create_py_library_rule(*, attrs = {}, **kwargs):

# Within Google, the doc attribute is overridden
kwargs.setdefault("doc", _DEFAULT_PY_LIBRARY_DOC)

# TODO: b/253818097 - fragments=py is only necessary so that
# RequiredConfigFragmentsTest passes
fragments = kwargs.pop("fragments", None) or []
return rule(
attrs = dicts.add(LIBRARY_ATTRS, attrs),
toolchains = [
config_common.toolchain_type(TOOLCHAIN_TYPE, mandatory = False),
config_common.toolchain_type(EXEC_TOOLS_TOOLCHAIN_TYPE, mandatory = False),
],
# TODO(b/253818097): fragments=py is only necessary so that
# RequiredConfigFragmentsTest passes
fragments = ["py"],
fragments = fragments + ["py"],
**kwargs
)

0 comments on commit 4f2dd2f

Please sign in to comment.