mirror of https://github.com/grpc/grpc.git
Revert "Merge pull request #17644 from lidizheng/bzl-py3"
This reverts commitpull/17865/heada25828ad78
, reversing changes made to5176fd80fc
.
parent
6d3580421d
commit
7da0aacef2
17 changed files with 36 additions and 117 deletions
@ -1,8 +0,0 @@ |
||||
py_library( |
||||
name = "bazel_namespace_package_hack", |
||||
srcs = ["bazel_namespace_package_hack.py"], |
||||
visibility = [ |
||||
"//src/python/grpcio_tests/tests/status:__subpackages__", |
||||
"//src/python/grpcio_tests/tests/interop:__subpackages__", |
||||
], |
||||
) |
@ -1,32 +0,0 @@ |
||||
# Copyright 2019 The gRPC Authors |
||||
# |
||||
# Licensed under the Apache License, Version 2.0 (the "License"); |
||||
# you may not use this file except in compliance with the License. |
||||
# You may obtain a copy of the License at |
||||
# |
||||
# http://www.apache.org/licenses/LICENSE-2.0 |
||||
# |
||||
# Unless required by applicable law or agreed to in writing, software |
||||
# distributed under the License is distributed on an "AS IS" BASIS, |
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
||||
# See the License for the specific language governing permissions and |
||||
# limitations under the License. |
||||
|
||||
import os |
||||
import site |
||||
import sys |
||||
|
||||
|
||||
# TODO(https://github.com/bazelbuild/bazel/issues/6844) Bazel failed to |
||||
# interpret namespace packages correctly. This monkey patch will force the |
||||
# Python process to parse the .pth file in the sys.path to resolve namespace |
||||
# package in the right place. |
||||
# 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.""" |
||||
for item in sys.path: |
||||
if os.path.exists(item): |
||||
# The only difference between sys.path and site-directory is |
||||
# whether the .pth file will be parsed or not. A site-directory |
||||
# will always exist in sys.path, but not another way around. |
||||
site.addsitedir(item) |
Loading…
Reference in new issue