Another attempt to fix this problem cleanly

pull/17881/head
Lidi Zheng 6 years ago
parent e9c67f23f3
commit 61bea3891b
  1. 3
      src/python/grpcio_tests/tests/bazel_namespace_package_hack.py
  2. 9
      src/python/grpcio_tests/tests/interop/methods.py
  3. 9
      src/python/grpcio_tests/tests/status/_grpc_status_test.py
  4. 1
      tools/bazel.rc

@ -24,9 +24,6 @@ import sys
# Analysis in depth: https://github.com/bazelbuild/rules_python/issues/55
def sys_path_to_site_dir_hack():
"""Add valid sys.path item to site directory to parse the .pth files."""
# GRPC_BAZEL_BUILD is explicitly set by tools/bazel.rc.
if 'GRPC_BAZEL_BUILD' not in os.environ:
return
for item in sys.path:
if os.path.exists(item):
# The only difference between sys.path and site-directory is

@ -13,8 +13,13 @@
# limitations under the License.
"""Implementations of interoperability test methods."""
from tests import bazel_namespace_package_hack
bazel_namespace_package_hack.sys_path_to_site_dir_hack()
# NOTE(lidiz) This module only exists in Bazel BUILD file, for more details
# please refer to comments in the "bazel_namespace_package_hack" module.
try:
from tests import bazel_namespace_package_hack
bazel_namespace_package_hack.sys_path_to_site_dir_hack()
except ImportError:
pass
import enum
import json

@ -13,8 +13,13 @@
# limitations under the License.
"""Tests of grpc_status."""
from tests import bazel_namespace_package_hack
bazel_namespace_package_hack.sys_path_to_site_dir_hack()
# NOTE(lidiz) This module only exists in Bazel BUILD file, for more details
# please refer to comments in the "bazel_namespace_package_hack" module.
try:
from tests import bazel_namespace_package_hack
bazel_namespace_package_hack.sys_path_to_site_dir_hack()
except ImportError:
pass
import unittest

@ -5,7 +5,6 @@
build --client_env=CC=clang
build --copt=-DGRPC_BAZEL_BUILD
build --action_env=GRPC_BAZEL_BUILD=1
build:opt --compilation_mode=opt
build:opt --copt=-Wframe-larger-than=16384

Loading…
Cancel
Save