From 8ce740cfe0dea62ab7eeffdfa218b012af6fc9aa Mon Sep 17 00:00:00 2001 From: Richard Belleville Date: Wed, 21 Aug 2019 14:24:06 -0700 Subject: [PATCH] Switch py_proto_library from using src to deps to conform with google3 --- bazel/python_rules.bzl | 8 ++++---- bazel/test/python_test_repo/BUILD | 6 +++--- src/proto/grpc/testing/BUILD | 6 +++--- src/proto/grpc/testing/proto2/BUILD.bazel | 4 ++-- src/python/grpcio_channelz/grpc_channelz/v1/BUILD.bazel | 2 +- .../grpcio_health_checking/grpc_health/v1/BUILD.bazel | 2 +- .../grpcio_reflection/grpc_reflection/v1alpha/BUILD.bazel | 2 +- 7 files changed, 15 insertions(+), 15 deletions(-) diff --git a/bazel/python_rules.bzl b/bazel/python_rules.bzl index 0f00d53b6fb..12f51f8b172 100644 --- a/bazel/python_rules.bzl +++ b/bazel/python_rules.bzl @@ -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 ) diff --git a/bazel/test/python_test_repo/BUILD b/bazel/test/python_test_repo/BUILD index 0df3700ec93..8aba6a78528 100644 --- a/bazel/test/python_test_repo/BUILD +++ b/bazel/test/python_test_repo/BUILD @@ -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( diff --git a/src/proto/grpc/testing/BUILD b/src/proto/grpc/testing/BUILD index 8bea8ed7ca0..bc481606500 100644 --- a/src/proto/grpc/testing/BUILD +++ b/src/proto/grpc/testing/BUILD @@ -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( diff --git a/src/proto/grpc/testing/proto2/BUILD.bazel b/src/proto/grpc/testing/proto2/BUILD.bazel index 668d0a484ea..8acb233302a 100644 --- a/src/proto/grpc/testing/proto2/BUILD.bazel +++ b/src/proto/grpc/testing/proto2/BUILD.bazel @@ -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"], ) diff --git a/src/python/grpcio_channelz/grpc_channelz/v1/BUILD.bazel b/src/python/grpcio_channelz/grpc_channelz/v1/BUILD.bazel index c0a7e3d3026..5f4e512e9f4 100644 --- a/src/python/grpcio_channelz/grpc_channelz/v1/BUILD.bazel +++ b/src/python/grpcio_channelz/grpc_channelz/v1/BUILD.bazel @@ -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( diff --git a/src/python/grpcio_health_checking/grpc_health/v1/BUILD.bazel b/src/python/grpcio_health_checking/grpc_health/v1/BUILD.bazel index 0ee176f0506..62a44df7707 100644 --- a/src/python/grpcio_health_checking/grpc_health/v1/BUILD.bazel +++ b/src/python/grpcio_health_checking/grpc_health/v1/BUILD.bazel @@ -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( diff --git a/src/python/grpcio_reflection/grpc_reflection/v1alpha/BUILD.bazel b/src/python/grpcio_reflection/grpc_reflection/v1alpha/BUILD.bazel index 49bc517caf1..10077fd9568 100644 --- a/src/python/grpcio_reflection/grpc_reflection/v1alpha/BUILD.bazel +++ b/src/python/grpcio_reflection/grpc_reflection/v1alpha/BUILD.bazel @@ -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(