diff --git a/bazel/python_rules.bzl b/bazel/python_rules.bzl index 0f00d53b6fb3421819f90a39b0e02be6080d1735..12f51f8b172e318646c41d3b7c7dc242ced5ca8c 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 0df3700ec939e2ccd24fa3ce3cee4446d75d2044..8aba6a78528a1ffb6b73943f98d98ef63b4cb029 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/examples/BUILD b/examples/BUILD index 6f801963c6eba5705f94cd6e27b8b8d9189b876b..1455d25dc765e8a4088a8feac67e8e705f923d09 100644 --- a/examples/BUILD +++ b/examples/BUILD @@ -67,7 +67,7 @@ proto_library( py_proto_library( name = "helloworld_py_pb2", - srcs = [":protos/helloworld_proto"], + deps = [":protos/helloworld_proto"], ) py_grpc_library( diff --git a/examples/python/cancellation/BUILD.bazel b/examples/python/cancellation/BUILD.bazel index 41b394a07a264d45dcb6bc773d40ec307d0f8260..17b1b20168ef25a594e1d8de3624724ddbd017ac 100644 --- a/examples/python/cancellation/BUILD.bazel +++ b/examples/python/cancellation/BUILD.bazel @@ -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( diff --git a/examples/python/multiprocessing/BUILD b/examples/python/multiprocessing/BUILD index 257523f14bba17a9196d2f6ee6cc2169410e7a9d..490aea0c1e66aca48b28115a50a1c252d7f89cad 100644 --- a/examples/python/multiprocessing/BUILD +++ b/examples/python/multiprocessing/BUILD @@ -23,7 +23,7 @@ proto_library( py_proto_library( name = "prime_proto_pb2", - srcs = [":prime_proto"], + deps = [":prime_proto"], ) py_grpc_library( diff --git a/src/proto/grpc/testing/BUILD b/src/proto/grpc/testing/BUILD index 8bea8ed7ca09a8dfe49cc67cb469ae3dff03cb13..bc4816065001cd32650d4efe307504ab804b65ae 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 668d0a484eac8f316491b1e52c39cda1d26ec165..8acb233302aca515c51f95ed7e29b67dc7cdea68 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 c0a7e3d3026cb9f744a127f3c020dbd5bdea7820..5f4e512e9f445d3c3f42d47db6b5affde69c3ddc 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 0ee176f0506c0798b80862985bb19ab39c18430e..62a44df77078e00b2837946097135aa46e56caa3 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 49bc517caf101c58366c8a85ed6c7c2e99b93ded..10077fd956808912f5d4ffba31222eddf0fd48cd 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(