Skip to content

/BUILD and /protobuf.bzl have unnecessarily hard dependencies on rules_python #8100

@jmillikin-stripe

Description

@jmillikin-stripe

The files /BUILD and /protobuf.bzl both load from @rules_python at the top level, which defeats Bazel's lazy fetching of dependencies. This forces projects that depend on Protobuf, but not Python, to need the @rules_python dependency declared.

For /BUILD, I recommend moving the py_library targets into a new file python/BUILD and setting up aliases at the old locations. See PR #7190 for a similar change applied to the Java targets.

For /protobuf.bzl, the py_proto_library() symbol should be moved into an equivalent file under python/. Doing this as a breaking change would be easiest since py_proto_library() is unfortunately a macro, but it may also be possible to replace it with a rule and thereby maintain the existing API.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bazelinactiveDenotes the issue/PR has not seen activity in the last 90 days.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions