big-xylophone-43403
07/05/2023, 7:07 PMbig-xylophone-43403
07/05/2023, 7:08 PMbig-xylophone-43403
07/05/2023, 7:08 PMbig-xylophone-43403
07/05/2023, 7:09 PMbig-xylophone-43403
07/05/2023, 7:09 PMsyntax = "proto3";
package sample.pacakge.v1;
import "com/shared/protos/v1/options.proto"; # lives in a archive
message SampleMessage {
option (com.shared.protos.v1.kafka_message) = "sample-topic";
string name = 1;
string def = 2;
}
big-xylophone-43403
07/05/2023, 7:11 PMprotobuf_sources
target to include the downloaded protos files in its input digestbig-xylophone-43403
07/05/2023, 7:11 PMgenerate_python_from_protobuf
rule?big-xylophone-43403
07/05/2023, 7:14 PMshell_command
target to download shared protos and make it a dependency of protobuf_sources
. But that did not work. Downloaded file are available in a python_tests
context, but not in a protobuf_sources
onebig-xylophone-43403
07/05/2023, 7:19 PMprotobuf_remote_sources(
name="deps",
remote_packages=["shared-protos", "other-shared-protos"]
)
protobuf_sources(
sources=["**/*.proto"],
dependencies=[":deps"]
)
big-xylophone-43403
07/05/2023, 7:21 PMclass ProtoRemoteSourcesField(MultipleSourcesField):
alias = "_sources"
use_source_roots = False
expected_num_files = 0
class GenerateProtobufFilesRequest(GenerateSourcesRequest):
input = ProtoRemoteSourcesField
output = ProtobufSourceField
@rule(desc="Downloading proto files from PyPi packages")
async def get_protobuf_remote_dependencies(
request: GenerateProtobufFilesRequest,
) -> GeneratedSources:
big-xylophone-43403
07/05/2023, 7:23 PMbig-xylophone-43403
07/05/2023, 7:23 PMbig-xylophone-43403
07/12/2023, 6:13 PMgorgeous-winter-99296
07/12/2023, 8:01 PMbig-xylophone-43403
07/13/2023, 2:30 PM