Switch py_proto_library from using src to deps to conform with google3

pull/20027/head
Richard Belleville 6 years ago
parent eacdf28ada
commit 8ce740cfe0
  1. 8
      bazel/python_rules.bzl
  2. 6
      bazel/test/python_test_repo/BUILD
  3. 6
      src/proto/grpc/testing/BUILD
  4. 4
      src/proto/grpc/testing/proto2/BUILD.bazel
  5. 2
      src/python/grpcio_channelz/grpc_channelz/v1/BUILD.bazel
  6. 2
      src/python/grpcio_health_checking/grpc_health/v1/BUILD.bazel
  7. 2
      src/python/grpcio_reflection/grpc_reflection/v1alpha/BUILD.bazel

@ -61,22 +61,22 @@ _generate_pb2_src = rule(
def py_proto_library( def py_proto_library(
name, name,
srcs, deps,
**kwargs): **kwargs):
"""Generate python code for a protobuf. """Generate python code for a protobuf.
Args: Args:
name: The name of the target. 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) codegen_target = "_{}_codegen".format(name)
if len(srcs) != 1: if len(deps) != 1:
fail("Can only compile a single proto at a time.") fail("Can only compile a single proto at a time.")
_generate_pb2_src( _generate_pb2_src(
name = codegen_target, name = codegen_target,
deps = srcs, deps = deps,
**kwargs **kwargs
) )

@ -29,7 +29,7 @@ proto_library(
py_proto_library( py_proto_library(
name = "helloworld_py_pb2", name = "helloworld_py_pb2",
srcs = [":helloworld_proto"], deps = [":helloworld_proto"],
) )
py_grpc_library( py_grpc_library(
@ -40,12 +40,12 @@ py_grpc_library(
py_proto_library( py_proto_library(
name = "duration_py_pb2", name = "duration_py_pb2",
srcs = ["@com_google_protobuf//:duration_proto"], deps = ["@com_google_protobuf//:duration_proto"],
) )
py_proto_library( py_proto_library(
name = "timestamp_py_pb2", name = "timestamp_py_pb2",
srcs = ["@com_google_protobuf//:timestamp_proto"], deps = ["@com_google_protobuf//:timestamp_proto"],
) )
py_test( py_test(

@ -75,7 +75,7 @@ proto_library(
py_proto_library( py_proto_library(
name = "empty_py_pb2", name = "empty_py_pb2",
srcs = [":empty_proto_descriptor"], deps = [":empty_proto_descriptor"],
) )
py_grpc_library( py_grpc_library(
@ -97,7 +97,7 @@ proto_library(
py_proto_library( py_proto_library(
name = "py_messages_proto", name = "py_messages_proto",
srcs = [":messages_proto_descriptor"], deps = [":messages_proto_descriptor"],
) )
py_grpc_library( py_grpc_library(
@ -206,7 +206,7 @@ proto_library(
py_proto_library( py_proto_library(
name = "py_test_proto", name = "py_test_proto",
srcs = [":test_proto_descriptor"], deps = [":test_proto_descriptor"],
) )
py_grpc_library( py_grpc_library(

@ -10,7 +10,7 @@ proto_library(
py_proto_library( py_proto_library(
name = "empty2_proto", name = "empty2_proto",
srcs = [":empty2_proto_descriptor"], deps = [":empty2_proto_descriptor"],
) )
proto_library( proto_library(
@ -23,6 +23,6 @@ proto_library(
py_proto_library( py_proto_library(
name = "empty2_extensions_proto", 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( py_proto_library(
name = "channelz_py_pb2", name = "channelz_py_pb2",
srcs = ["//src/proto/grpc/channelz:channelz_proto_descriptors"], deps = ["//src/proto/grpc/channelz:channelz_proto_descriptors"],
) )
py_grpc_library( py_grpc_library(

@ -3,7 +3,7 @@ package(default_visibility = ["//visibility:public"])
py_proto_library( py_proto_library(
name = "health_py_pb2", 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( py_grpc_library(

@ -5,7 +5,7 @@ package(default_visibility = ["//visibility:public"])
py_proto_library( py_proto_library(
name = "reflection_py_pb2", 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( py_grpc_library(

Loading…
Cancel
Save