Merge pull request #20027 from gnossen/py_proto_library_deps

Switch py_proto_library from using src to deps to conform with google3
pull/19462/head
Richard Belleville 6 years ago committed by GitHub
commit 4e317f0b34
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 8
      bazel/python_rules.bzl
  2. 6
      bazel/test/python_test_repo/BUILD
  3. 2
      examples/BUILD
  4. 2
      examples/python/cancellation/BUILD.bazel
  5. 2
      examples/python/multiprocessing/BUILD
  6. 6
      src/proto/grpc/testing/BUILD
  7. 4
      src/proto/grpc/testing/proto2/BUILD.bazel
  8. 2
      src/python/grpcio_channelz/grpc_channelz/v1/BUILD.bazel
  9. 2
      src/python/grpcio_health_checking/grpc_health/v1/BUILD.bazel
  10. 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(

@ -67,7 +67,7 @@ proto_library(
py_proto_library( py_proto_library(
name = "helloworld_py_pb2", name = "helloworld_py_pb2",
srcs = [":protos/helloworld_proto"], deps = [":protos/helloworld_proto"],
) )
py_grpc_library( py_grpc_library(

@ -26,7 +26,7 @@ proto_library(
py_proto_library( py_proto_library(
name = "hash_name_py_pb2", name = "hash_name_py_pb2",
srcs = [":hash_name_proto"], deps = [":hash_name_proto"],
) )
py_grpc_library( py_grpc_library(

@ -23,7 +23,7 @@ proto_library(
py_proto_library( py_proto_library(
name = "prime_proto_pb2", name = "prime_proto_pb2",
srcs = [":prime_proto"], deps = [":prime_proto"],
) )
py_grpc_library( py_grpc_library(

@ -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