From dbe62a6e6cece7cddb1373afe643fe5636af48a3 Mon Sep 17 00:00:00 2001 From: vam-google Date: Wed, 16 Oct 2019 13:26:59 -0700 Subject: [PATCH] Switch to `py2and3_test` rule from py_test --- bazel/test/python_test_repo/.bazelrc | 3 --- bazel/test/python_test_repo/BUILD | 13 ++++++++----- 2 files changed, 8 insertions(+), 8 deletions(-) delete mode 100644 bazel/test/python_test_repo/.bazelrc diff --git a/bazel/test/python_test_repo/.bazelrc b/bazel/test/python_test_repo/.bazelrc deleted file mode 100644 index 301d14a93d1..00000000000 --- a/bazel/test/python_test_repo/.bazelrc +++ /dev/null @@ -1,3 +0,0 @@ -build:python3 --python_path=python3 -build:python3 --python_version=PY3 -build:python3 --action_env=PYTHON_BIN_PATH=python3 \ No newline at end of file diff --git a/bazel/test/python_test_repo/BUILD b/bazel/test/python_test_repo/BUILD index 0127e34e276..4e58fea5afd 100644 --- a/bazel/test/python_test_repo/BUILD +++ b/bazel/test/python_test_repo/BUILD @@ -14,7 +14,12 @@ # See the License for the specific language governing permissions and # limitations under the License. -load("@com_github_grpc_grpc//bazel:python_rules.bzl", "py_proto_library", "py_grpc_library") +load( + "@com_github_grpc_grpc//bazel:python_rules.bzl", + "py_proto_library", + "py_grpc_library", + "py2and3_test", +) package(default_testonly = 1) @@ -48,7 +53,7 @@ py_proto_library( deps = ["@com_google_protobuf//:timestamp_proto"], ) -py_test( +py2and3_test( name = "import_test", main = "helloworld.py", srcs = ["helloworld.py"], @@ -58,7 +63,6 @@ py_test( ":duration_py_pb2", ":timestamp_py_pb2", ], - python_version = "PY3", ) # Test compatibility of py_proto_library and py_grpc_library rules with @@ -86,7 +90,7 @@ py_grpc_library( deps = [":helloworld_moved_py_pb2"], ) -py_test( +py2and3_test( name = "import_moved_test", main = "helloworld_moved.py", srcs = ["helloworld_moved.py"], @@ -96,5 +100,4 @@ py_test( ":duration_py_pb2", ":timestamp_py_pb2", ], - python_version = "PY3", ) \ No newline at end of file