Conform to protobuf's usage of six
This commit is contained in:
parent
b67a7ef020
commit
69f990673f
|
|
@ -4,18 +4,12 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
|
|||
load("@com_github_grpc_grpc//third_party/py:python_configure.bzl", "python_configure")
|
||||
|
||||
def grpc_python_deps():
|
||||
native.bind(
|
||||
name = "six",
|
||||
actual = "@six_archive//:six",
|
||||
)
|
||||
|
||||
# protobuf binds to the name "six", so we can't use it here.
|
||||
# See https://github.com/bazelbuild/bazel/issues/1952 for why bind is
|
||||
# horrible.
|
||||
if "six_archive" not in native.existing_rules():
|
||||
if "six" not in native.existing_rules():
|
||||
http_archive(
|
||||
name = "six_archive",
|
||||
strip_prefix = "six-1.12.0",
|
||||
name = "six",
|
||||
build_file = "@com_github_grpc_grpc//third_party:six.BUILD",
|
||||
sha256 = "d16a0141ec1a18405cd4ce8b4613101da75da0e9a7aec5bdd4fa804d0e0eba73",
|
||||
urls = ["https://files.pythonhosted.org/packages/dd/bf/4138e7bfb757de47d1f4b6994648ec67a51efe58fa907c1e11e350cddfca/six-1.12.0.tar.gz"],
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ py_binary(
|
|||
deps = [
|
||||
":hash_name_py_pb2",
|
||||
":hash_name_py_pb2_grpc",
|
||||
"//external:six",
|
||||
"@six//:six",
|
||||
"//src/python/grpcio/grpc:grpcio",
|
||||
],
|
||||
)
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ py_library(
|
|||
"//src/python/grpcio/grpc/_cython:cygrpc",
|
||||
"//src/python/grpcio/grpc/experimental",
|
||||
"//src/python/grpcio/grpc/framework",
|
||||
"@six_archive//:six",
|
||||
"@six//:six",
|
||||
] + select({
|
||||
"//conditions:default": ["@enum34//:enum34"],
|
||||
"//:python3": [],
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ py_library(
|
|||
name = "callable_util",
|
||||
srcs = ["callable_util.py"],
|
||||
deps = [
|
||||
"//external:six",
|
||||
"@six//:six",
|
||||
] + select({
|
||||
"//conditions:default": ["@enum34//:enum34"],
|
||||
"//:python3": [],
|
||||
|
|
@ -33,7 +33,7 @@ py_library(
|
|||
name = "future",
|
||||
srcs = ["future.py"],
|
||||
deps = [
|
||||
"//external:six",
|
||||
"@six//:six",
|
||||
],
|
||||
)
|
||||
|
||||
|
|
@ -58,6 +58,6 @@ py_library(
|
|||
name = "stream",
|
||||
srcs = ["stream.py"],
|
||||
deps = [
|
||||
"//external:six",
|
||||
"@six//:six",
|
||||
],
|
||||
)
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ py_library(
|
|||
srcs = ["base.py"],
|
||||
deps = [
|
||||
"//src/python/grpcio/grpc/framework/foundation:abandonment",
|
||||
"//external:six",
|
||||
"@six//:six",
|
||||
] + select({
|
||||
"//conditions:default": ["@enum34//:enum34"],
|
||||
"//:python3": [],
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ py_library(
|
|||
deps = [
|
||||
"//src/python/grpcio/grpc/framework/foundation",
|
||||
"//src/python/grpcio/grpc/framework/common",
|
||||
"//external:six",
|
||||
"@six//:six",
|
||||
] + select({
|
||||
"//conditions:default": ["@enum34//:enum34"],
|
||||
"//:python3": [],
|
||||
|
|
|
|||
|
|
@ -102,7 +102,7 @@ py_library(
|
|||
":resources",
|
||||
":test_common",
|
||||
":thread_pool",
|
||||
"//external:six",
|
||||
"@six//:six",
|
||||
"//src/python/grpcio/grpc:grpcio",
|
||||
"//src/python/grpcio_tests/tests/testing",
|
||||
"//src/python/grpcio_tests/tests/unit/framework/common",
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ py_binary(
|
|||
srcs = ["server.py"],
|
||||
python_version = "PY3",
|
||||
deps = [
|
||||
"//external:six",
|
||||
"@six//:six",
|
||||
"//src/proto/grpc/testing:benchmark_service_py_pb2",
|
||||
"//src/proto/grpc/testing:benchmark_service_py_pb2_grpc",
|
||||
"//src/proto/grpc/testing:py_messages_proto",
|
||||
|
|
|
|||
|
|
@ -58,7 +58,7 @@ py_library(
|
|||
":_constants",
|
||||
":_test_base",
|
||||
":_test_server",
|
||||
"//external:six",
|
||||
"@six//:six",
|
||||
"//src/proto/grpc/testing:benchmark_service_py_pb2",
|
||||
"//src/proto/grpc/testing:benchmark_service_py_pb2_grpc",
|
||||
"//src/proto/grpc/testing:py_messages_proto",
|
||||
|
|
|
|||
|
|
@ -1,6 +1,14 @@
|
|||
genrule(
|
||||
name = "copy_six",
|
||||
srcs = ["six-1.12.0/six.py"],
|
||||
outs = ["__init__.py"],
|
||||
cmd = "cp $< $(@)",
|
||||
)
|
||||
|
||||
py_library(
|
||||
name = "six",
|
||||
srcs = ["six.py"],
|
||||
srcs = ["__init__.py"],
|
||||
srcs_version = "PY2AND3",
|
||||
visibility = ["//visibility:public"],
|
||||
)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue