From 2e78e516ad8cb45cff705581625f85e5033b4e5b Mon Sep 17 00:00:00 2001 From: Naresh Date: Thu, 11 Oct 2018 09:14:58 +0000 Subject: Bazel rules for Python grpcio_reflection --- .../grpc_reflection/v1alpha/BUILD.bazel | 34 ++++++++++++++++++++++ .../grpcio_tests/tests/reflection/BUILD.bazel | 21 +++++++++++++ 2 files changed, 55 insertions(+) create mode 100644 src/python/grpcio_reflection/grpc_reflection/v1alpha/BUILD.bazel create mode 100644 src/python/grpcio_tests/tests/reflection/BUILD.bazel (limited to 'src/python') diff --git a/src/python/grpcio_reflection/grpc_reflection/v1alpha/BUILD.bazel b/src/python/grpcio_reflection/grpc_reflection/v1alpha/BUILD.bazel new file mode 100644 index 0000000000..3a2ba26371 --- /dev/null +++ b/src/python/grpcio_reflection/grpc_reflection/v1alpha/BUILD.bazel @@ -0,0 +1,34 @@ +load("@grpc_python_dependencies//:requirements.bzl", "requirement") +load("@org_pubref_rules_protobuf//python:rules.bzl", "py_proto_library") + +package(default_visibility = ["//visibility:public"]) + +genrule( + name = "mv_reflection_proto", + srcs = [ + "//src/proto/grpc/reflection/v1alpha:reflection_proto_file", + ], + outs = ["reflection.proto",], + cmd = "cp $< $@", +) + +py_proto_library( + name = "py_reflection_proto", + protos = [":mv_reflection_proto",], + with_grpc = True, + deps = [ + requirement('protobuf'), + ], +) + +py_library( + name = "grpc_reflection", + srcs = ["reflection.py",], + deps = [ + ":py_reflection_proto", + "//src/python/grpcio/grpc:grpcio", + requirement('protobuf'), + ], + imports=["../../",], +) + diff --git a/src/python/grpcio_tests/tests/reflection/BUILD.bazel b/src/python/grpcio_tests/tests/reflection/BUILD.bazel new file mode 100644 index 0000000000..c0efb0b7ce --- /dev/null +++ b/src/python/grpcio_tests/tests/reflection/BUILD.bazel @@ -0,0 +1,21 @@ +load("@grpc_python_dependencies//:requirements.bzl", "requirement") + +package(default_visibility = ["//visibility:public"]) + +py_test( + name="_reflection_servicer_test", + size="small", + timeout="moderate", + srcs=["_reflection_servicer_test.py",], + main="_reflection_servicer_test.py", + deps=[ + "//src/python/grpcio/grpc:grpcio", + "//src/python/grpcio_reflection/grpc_reflection/v1alpha:grpc_reflection", + "//src/python/grpcio_tests/tests/unit:test_common", + "//src/proto/grpc/testing:py_empty_proto", + "//src/proto/grpc/testing/proto2:empty2_extensions_proto", + requirement('protobuf'), + ], + imports=["../../",], +) + -- cgit v1.2.3