Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,28 @@ BEGIN_UNRELEASED_TEMPLATE
END_UNRELEASED_TEMPLATE
-->

{#v0-0-0}
## Unreleased

[0.0.0]: https://github.com/bazel-contrib/rules_python/releases/tag/0.0.0

{#v0-0-0-changed}
### Changed
* Nothing changed.

{#v0-0-0-fixed}
### Fixed
* (rules) PyInfo provider is now advertised by py_test, py_binary, and py_library;
this allows aspects using required_providers to function correctly.
([#2506](https://github.com/bazel-contrib/rules_python/issues/2506)).

{#v0-0-0-added}
### Added
* Nothing added.

{#v0-0-0-removed}
### Removed
* Nothing removed.

{#1-4-0}
## [1.4.0] - 2025-04-19
Expand Down
4 changes: 3 additions & 1 deletion python/private/py_executable.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -1854,6 +1854,8 @@ def create_base_executable_rule():
"""
return create_executable_rule_builder().build()

_MaybeBuiltinPyInfo = [BuiltinPyInfo] if BuiltinPyInfo != None else []

# NOTE: Exported publicly
def create_executable_rule_builder(implementation, **kwargs):
"""Create a rule builder for an executable Python program.
Expand All @@ -1877,7 +1879,7 @@ def create_executable_rule_builder(implementation, **kwargs):
attrs = EXECUTABLE_ATTRS,
exec_groups = dict(REQUIRED_EXEC_GROUP_BUILDERS), # Mutable copy
fragments = ["py", "bazel_py"],
provides = [PyExecutableInfo],
provides = [PyExecutableInfo, PyInfo] + _MaybeBuiltinPyInfo,
toolchains = [
ruleb.ToolchainType(TOOLCHAIN_TYPE),
ruleb.ToolchainType(EXEC_TOOLS_TOOLCHAIN_TYPE, mandatory = False),
Expand Down
5 changes: 5 additions & 0 deletions python/private/py_library.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@ load(
load(":flags.bzl", "AddSrcsToRunfilesFlag", "PrecompileFlag", "VenvsSitePackages")
load(":precompile.bzl", "maybe_precompile")
load(":py_cc_link_params_info.bzl", "PyCcLinkParamsInfo")
load(":py_info.bzl", "PyInfo")
load(":py_internal.bzl", "py_internal")
load(":reexports.bzl", "BuiltinPyInfo")
load(":rule_builders.bzl", "ruleb")
load(
":toolchain_types.bzl",
Expand Down Expand Up @@ -299,6 +301,8 @@ def _repo_relative_short_path(short_path):
else:
return short_path

_MaybeBuiltinPyInfo = [BuiltinPyInfo] if BuiltinPyInfo != None else []

# NOTE: Exported publicaly
def create_py_library_rule_builder():
"""Create a rule builder for a py_library.
Expand All @@ -319,6 +323,7 @@ def create_py_library_rule_builder():
exec_groups = dict(REQUIRED_EXEC_GROUP_BUILDERS),
attrs = LIBRARY_ATTRS,
fragments = ["py"],
provides = [PyCcLinkParamsInfo, PyInfo] + _MaybeBuiltinPyInfo,
toolchains = [
ruleb.ToolchainType(TOOLCHAIN_TYPE, mandatory = False),
ruleb.ToolchainType(EXEC_TOOLS_TOOLCHAIN_TYPE, mandatory = False),
Expand Down