Merge pull request #20027 from gnossen/py_proto_library_deps
Switch py_proto_library from using src to deps to conform with google3
This commit is contained in:
commit
4e317f0b34
|
|
@ -61,22 +61,22 @@ _generate_pb2_src = rule(
|
|||
|
||||
def py_proto_library(
|
||||
name,
|
||||
srcs,
|
||||
deps,
|
||||
**kwargs):
|
||||
"""Generate python code for a protobuf.
|
||||
|
||||
Args:
|
||||
name: The name of the target.
|
||||
srcs: A list of proto_library dependencies. Must contain a single element.
|
||||
deps: A list of proto_library dependencies. Must contain a single element.
|
||||
"""
|
||||
codegen_target = "_{}_codegen".format(name)
|
||||
if len(srcs) != 1:
|
||||
if len(deps) != 1:
|
||||
fail("Can only compile a single proto at a time.")
|
||||
|
||||
|
||||
_generate_pb2_src(
|
||||
name = codegen_target,
|
||||
deps = srcs,
|
||||
deps = deps,
|
||||
**kwargs
|
||||
)
|
||||
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ proto_library(
|
|||
|
||||
py_proto_library(
|
||||
name = "helloworld_py_pb2",
|
||||
srcs = [":helloworld_proto"],
|
||||
deps = [":helloworld_proto"],
|
||||
)
|
||||
|
||||
py_grpc_library(
|
||||
|
|
@ -40,12 +40,12 @@ py_grpc_library(
|
|||
|
||||
py_proto_library(
|
||||
name = "duration_py_pb2",
|
||||
srcs = ["@com_google_protobuf//:duration_proto"],
|
||||
deps = ["@com_google_protobuf//:duration_proto"],
|
||||
)
|
||||
|
||||
py_proto_library(
|
||||
name = "timestamp_py_pb2",
|
||||
srcs = ["@com_google_protobuf//:timestamp_proto"],
|
||||
deps = ["@com_google_protobuf//:timestamp_proto"],
|
||||
)
|
||||
|
||||
py_test(
|
||||
|
|
|
|||
|
|
@ -67,7 +67,7 @@ proto_library(
|
|||
|
||||
py_proto_library(
|
||||
name = "helloworld_py_pb2",
|
||||
srcs = [":protos/helloworld_proto"],
|
||||
deps = [":protos/helloworld_proto"],
|
||||
)
|
||||
|
||||
py_grpc_library(
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ proto_library(
|
|||
|
||||
py_proto_library(
|
||||
name = "hash_name_py_pb2",
|
||||
srcs = [":hash_name_proto"],
|
||||
deps = [":hash_name_proto"],
|
||||
)
|
||||
|
||||
py_grpc_library(
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ proto_library(
|
|||
|
||||
py_proto_library(
|
||||
name = "prime_proto_pb2",
|
||||
srcs = [":prime_proto"],
|
||||
deps = [":prime_proto"],
|
||||
)
|
||||
|
||||
py_grpc_library(
|
||||
|
|
|
|||
|
|
@ -75,7 +75,7 @@ proto_library(
|
|||
|
||||
py_proto_library(
|
||||
name = "empty_py_pb2",
|
||||
srcs = [":empty_proto_descriptor"],
|
||||
deps = [":empty_proto_descriptor"],
|
||||
)
|
||||
|
||||
py_grpc_library(
|
||||
|
|
@ -97,7 +97,7 @@ proto_library(
|
|||
|
||||
py_proto_library(
|
||||
name = "py_messages_proto",
|
||||
srcs = [":messages_proto_descriptor"],
|
||||
deps = [":messages_proto_descriptor"],
|
||||
)
|
||||
|
||||
py_grpc_library(
|
||||
|
|
@ -206,7 +206,7 @@ proto_library(
|
|||
|
||||
py_proto_library(
|
||||
name = "py_test_proto",
|
||||
srcs = [":test_proto_descriptor"],
|
||||
deps = [":test_proto_descriptor"],
|
||||
)
|
||||
|
||||
py_grpc_library(
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ proto_library(
|
|||
|
||||
py_proto_library(
|
||||
name = "empty2_proto",
|
||||
srcs = [":empty2_proto_descriptor"],
|
||||
deps = [":empty2_proto_descriptor"],
|
||||
)
|
||||
|
||||
proto_library(
|
||||
|
|
@ -23,6 +23,6 @@ proto_library(
|
|||
|
||||
py_proto_library(
|
||||
name = "empty2_extensions_proto",
|
||||
srcs = [":empty2_extensions_proto_descriptor"],
|
||||
deps = [":empty2_extensions_proto_descriptor"],
|
||||
)
|
||||
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ package(default_visibility = ["//visibility:public"])
|
|||
|
||||
py_proto_library(
|
||||
name = "channelz_py_pb2",
|
||||
srcs = ["//src/proto/grpc/channelz:channelz_proto_descriptors"],
|
||||
deps = ["//src/proto/grpc/channelz:channelz_proto_descriptors"],
|
||||
)
|
||||
|
||||
py_grpc_library(
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ package(default_visibility = ["//visibility:public"])
|
|||
|
||||
py_proto_library(
|
||||
name = "health_py_pb2",
|
||||
srcs = ["//src/proto/grpc/health/v1:health_proto_descriptor",],
|
||||
deps = ["//src/proto/grpc/health/v1:health_proto_descriptor",],
|
||||
)
|
||||
|
||||
py_grpc_library(
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ package(default_visibility = ["//visibility:public"])
|
|||
|
||||
py_proto_library(
|
||||
name = "reflection_py_pb2",
|
||||
srcs = ["//src/proto/grpc/reflection/v1alpha:reflection_proto_descriptor",],
|
||||
deps = ["//src/proto/grpc/reflection/v1alpha:reflection_proto_descriptor",],
|
||||
)
|
||||
|
||||
py_grpc_library(
|
||||
|
|
|
|||
Loading…
Reference in New Issue