bazel - py_proto_library

287 views
Skip to first unread message

Mihir G

unread,
Mar 15, 2021, 11:54:47 PM3/15/21
to Protocol Buffers
Hi
I have a proto like this:

syntax = "proto3";
package foobar;

import "google/api/annotations.proto";

message ProductId {
string id = 1;
}

message ProductDetails {
string name = 1;
string imageUrl = 2;
}

service ProductInfo {
rpc getProductDetails(ProductId) returns (ProductDetails) {
option (google.api.http) = {
post: "/product/details"
};
}
}

I am using py_proto_library to generate code for this proto. Note, I am referring to annotations.proto in my proto file.

I want the py_proto_library target to only compile my proto and generate code for it. The compiled versions of annotations.proto are available via googleapis-common-protos which is installed in my python environment. At runtime, I want to the generated code to refer to the files googleapis-common-protos for dependencies like annotation.proto

How can I achieve this?

Regards
Mihir





Reply all
Reply to author
Forward
0 new messages