rules_python icon indicating copy to clipboard operation
rules_python copied to clipboard

Have Gazelle generate `py_proto_library` targets

Open dougthor42 opened this issue 5 months ago • 0 comments

🚀 feature request

Relevant Rules

gazelle

Description

As far as I know, there is no gazelle support for making py_proto_library targets.

Describe the solution you'd like

gazelle_binary(
    name = "gazelle_multilang",
    languages = [
        "@rules_python_gazelle_plugin//python",
        "@rules_python_gazelle_plugin//python_proto",  // or something
        "@bazel_gazelle//language/proto",
    ],
    visibility = ["//visibility:public"],
)

Thoughts, notes, addendums, provisios, questions, etc.

  • #1703 mentions things a bit
  • Should this be part of rules_python_gazelle_plugin? Or part of bazel-contrib/bazel-gazelle? Or maybe protocolbuffers/protobuf given that the py_proto_library target is now maintained by them?
  • Separate "language" (as the above example) or just a directive such as # gazelle:python_proto_generation True?
  • Would we require people to also have gazelle generate the proto_library targets (like the example does) or no?
    • If yes, how do we ensure that the proto_library targets are made first?

As https://github.com/bazel-contrib/rules_python/issues/1703#issuecomment-1904913817 says: we'd basically just look at what bazel-gazelle does and copy that here, modulo some name changes.

Describe alternatives you've considered

Bespoke, artisanal, hand-crafted py_proto_library targets.

dougthor42 avatar Jun 16 '25 17:06 dougthor42

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

google-cla[bot] avatar Jun 12 '25 18:06 google-cla[bot]