Skip to content

Commit d3bf4f9

Browse files
committed
python: apply bazel_namespace_package_hack in _run_time_type_check_main.py and tests_aio
1 parent 4c10700 commit d3bf4f9

4 files changed

Lines changed: 13 additions & 0 deletions

File tree

bazel/_run_time_type_check_main.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,13 @@
2323

2424
from typeguard import install_import_hook
2525

26+
try:
27+
from tests import bazel_namespace_package_hack
28+
29+
bazel_namespace_package_hack.sys_path_to_site_dir_hack()
30+
except Exception:
31+
pass
32+
2633

2734
# AIO
2835
install_import_hook('grpc.aio')

src/python/grpcio_tests/tests/BUILD.bazel

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,6 @@ py_library(
2020
"//examples/python/errors:__subpackages__",
2121
"//src/python/grpcio_tests/tests/interop:__subpackages__",
2222
"//src/python/grpcio_tests/tests/status:__subpackages__",
23+
"//src/python/grpcio_tests/tests_aio:__subpackages__",
2324
],
2425
)

src/python/grpcio_tests/tests_aio/unit/BUILD.bazel

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ py_library(
4545
"//src/proto/grpc/testing:py_messages_proto",
4646
"//src/proto/grpc/testing:test_py_pb2_grpc",
4747
"//src/python/grpcio/grpc:grpcio",
48+
"//src/python/grpcio_tests/tests:bazel_namespace_package_hack",
4849
"//src/python/grpcio_tests/tests/unit:resources",
4950
],
5051
)

src/python/grpcio_tests/tests_aio/unit/_test_server.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@
2020
import grpc
2121
from grpc.experimental import aio
2222

23+
from tests import bazel_namespace_package_hack
24+
25+
bazel_namespace_package_hack.sys_path_to_site_dir_hack()
26+
2327
from src.proto.grpc.testing import empty_pb2
2428
from src.proto.grpc.testing import messages_pb2
2529
from src.proto.grpc.testing import test_pb2_grpc

0 commit comments

Comments
 (0)