googleapis / googleapis/rules_gapic

bazel(python): no py_(proto | grpc)_library targets to depend on when dependency has a GAPIC

Open
#46 3 comments 0 reactions 1 assignee Assigned to @atulep View on GitHub
priority: p3 type: bug
Dominant language
Starlark
Stars
9
Forks
11
PR merge metrics
No merged PRs in 30d

Description

When a proto depends on a proto in another package, there is a chance that the python target dependencies of the dependent target will be generated with the wrong _dependency_ targets when the dependency is a GAPIC. This is because when a package is a GAPIC, the only python targets generated are the `py_gapic_library` and `py_gapic_assembly_pkg` targets - there are no `py_proto_library` or `py_grpc_library` targets generated. However, a dependent package is generated with `py_proto_library` and `py_grpc_library` targets as the dependencies. It really should be depending on the `py_gapic_assembly_pkg` target instead, which contains not only GAPIC code but also the protobuf & grpc code.

I think a good solution would be for the non-GAPIC packages to be genreated with a `py_gapic_assembly_pkg` target with just the grpc & protobuf targets as the packaged sources. This way, we can change build_gen to always generate a dependency on this single target rather than having to determine which targets a dependency has to use.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.