Use bazel imports instead of sys.path

pull/21458/head
Richard Belleville 4 years ago
parent 4040a36238
commit 828edcc67a
  1. 2
      examples/python/auth/BUILD.bazel
  2. 1
      examples/python/auth/test/_auth_example_test.py
  3. 2
      examples/python/errors/BUILD.bazel
  4. 1
      examples/python/errors/test/_error_handling_example_test.py
  5. 1
      examples/python/wait_for_ready/BUILD.bazel
  6. 1
      examples/python/wait_for_ready/test/_wait_for_ready_example_test.py

@ -42,6 +42,7 @@ py_binary(
"//src/python/grpcio/grpc:grpcio", "//src/python/grpcio/grpc:grpcio",
"//tools/distrib/python/grpcio_tools:grpc_tools", "//tools/distrib/python/grpcio_tools:grpc_tools",
], ],
imports = ["."],
) )
py_binary( py_binary(
@ -57,6 +58,7 @@ py_binary(
"//src/python/grpcio/grpc:grpcio", "//src/python/grpcio/grpc:grpcio",
"//tools/distrib/python/grpcio_tools:grpc_tools", "//tools/distrib/python/grpcio_tools:grpc_tools",
], ],
imports = ["."],
) )
py_test( py_test(

@ -23,7 +23,6 @@ import sys
import grpc import grpc
sys.path.insert(0, os.path.join(os.path.dirname(__file__), ".."))
from examples.python.auth import _credentials from examples.python.auth import _credentials
from examples.python.auth import customized_auth_client from examples.python.auth import customized_auth_client
from examples.python.auth import customized_auth_server from examples.python.auth import customized_auth_server

@ -27,6 +27,7 @@ py_library(
"//tools/distrib/python/grpcio_tools:grpc_tools", "//tools/distrib/python/grpcio_tools:grpc_tools",
requirement("googleapis-common-protos"), requirement("googleapis-common-protos"),
], ],
imports = ["."],
) )
py_library( py_library(
@ -44,6 +45,7 @@ py_library(
"//conditions:default": [requirement("futures")], "//conditions:default": [requirement("futures")],
"//:python3": [], "//:python3": [],
}), }),
imports = ["."],
) )
py_test( py_test(

@ -28,7 +28,6 @@ import unittest
import grpc import grpc
sys.path.insert(0, os.path.join(os.path.dirname(__file__), ".."))
services = grpc.services("helloworld.proto") services = grpc.services("helloworld.proto")
from examples.python.errors import client as error_handling_client from examples.python.errors import client as error_handling_client

@ -25,6 +25,7 @@ py_library(
"//src/python/grpcio/grpc:grpcio", "//src/python/grpcio/grpc:grpcio",
"//tools/distrib/python/grpcio_tools:grpc_tools", "//tools/distrib/python/grpcio_tools:grpc_tools",
], ],
imports = ["."],
) )
py_test( py_test(

@ -18,7 +18,6 @@ import logging
import os import os
import sys import sys
sys.path.insert(0, os.path.join(os.path.dirname(__file__), ".."))
from examples.python.wait_for_ready import wait_for_ready_example from examples.python.wait_for_ready import wait_for_ready_example

Loading…
Cancel
Save