From fd0d0f77df323df537996e73f78842df34991fc2 Mon Sep 17 00:00:00 2001 From: Richard Belleville Date: Wed, 15 Jul 2020 13:03:16 -0700 Subject: [PATCH] Fix Bazel warning --- src/python/grpcio_tests/tests/unit/BUILD.bazel | 2 +- .../{grpc_tools/BUILD => BUILD.bazel} | 16 ++++++---------- .../grpcio_tools/grpc_tools/test/BUILD.bazel | 2 +- 3 files changed, 8 insertions(+), 12 deletions(-) rename tools/distrib/python/grpcio_tools/{grpc_tools/BUILD => BUILD.bazel} (76%) diff --git a/src/python/grpcio_tests/tests/unit/BUILD.bazel b/src/python/grpcio_tests/tests/unit/BUILD.bazel index e74fcf9bab1..f81aeebc634 100644 --- a/src/python/grpcio_tests/tests/unit/BUILD.bazel +++ b/src/python/grpcio_tests/tests/unit/BUILD.bazel @@ -125,6 +125,6 @@ py2and3_test( "@six", "//src/python/grpcio/grpc:grpcio", "//src/python/grpcio_tests/tests/testing", - "//tools/distrib/python/grpcio_tools/grpc_tools", + "//tools/distrib/python/grpcio_tools:grpc_tools", ], ) diff --git a/tools/distrib/python/grpcio_tools/grpc_tools/BUILD b/tools/distrib/python/grpcio_tools/BUILD.bazel similarity index 76% rename from tools/distrib/python/grpcio_tools/grpc_tools/BUILD rename to tools/distrib/python/grpcio_tools/BUILD.bazel index 4e31cc29abc..3de849c1111 100644 --- a/tools/distrib/python/grpcio_tools/grpc_tools/BUILD +++ b/tools/distrib/python/grpcio_tools/BUILD.bazel @@ -12,38 +12,34 @@ # See the License for the specific language governing permissions and # limitations under the License. -package(default_visibility = ["//src/python:__subpackages__"]) +package(default_visibility = ["//src/python:__subpackages__", "//tools/distrib/python/grpcio_tools:__subpackages__"]) load("//bazel:cython_library.bzl", "pyx_library") -NON_BAZEL_ROOT = "../" - cc_library( name = "protoc_lib", - srcs = ["main.cc"], - hdrs = ["main.h"], + srcs = ["grpc_tools/main.cc"], + hdrs = ["grpc_tools/main.h"], deps = [ "@com_google_protobuf//:protoc_lib", "//src/compiler:grpc_plugin_support", ], - includes = [NON_BAZEL_ROOT], + includes = ["."], ) pyx_library( name = "cyprotoc", - srcs = ["_protoc_compiler.pyx"], + srcs = ["grpc_tools/_protoc_compiler.pyx"], deps = [":protoc_lib"], - includes = [NON_BAZEL_ROOT], ) py_library( name = "grpc_tools", - srcs = ["__init__.py", "protoc.py"], + srcs = ["grpc_tools/__init__.py", "grpc_tools/protoc.py"], deps = [ ":cyprotoc", "@com_google_protobuf//:protobuf_python", "//src/python/grpcio/grpc:grpcio", ], srcs_version = "PY2AND3", - imports = [NON_BAZEL_ROOT], ) diff --git a/tools/distrib/python/grpcio_tools/grpc_tools/test/BUILD.bazel b/tools/distrib/python/grpcio_tools/grpc_tools/test/BUILD.bazel index 037add24278..96090f4d0ff 100644 --- a/tools/distrib/python/grpcio_tools/grpc_tools/test/BUILD.bazel +++ b/tools/distrib/python/grpcio_tools/grpc_tools/test/BUILD.bazel @@ -27,7 +27,7 @@ py_test( name = "protoc_test", srcs = ["protoc_test.py"], deps = [ - "//tools/distrib/python/grpcio_tools/grpc_tools:grpc_tools", + "//tools/distrib/python/grpcio_tools:grpc_tools", ":complicated_py_pb2", ], data = [