Modernize cancellation example

pull/19822/head
Richard Belleville 5 years ago
parent e1980a7a5a
commit 66114201b4
  1. 24
      examples/python/cancellation/BUILD.bazel

@ -15,7 +15,7 @@
# limitations under the License.
load("@grpc_python_dependencies//:requirements.bzl", "requirement")
load("//bazel:python_rules.bzl", "py_proto_library")
load("//bazel:python_rules.bzl", "py_proto_library", "py_grpc_library")
package(default_testonly = 1)
@ -25,9 +25,14 @@ proto_library(
)
py_proto_library(
name = "hash_name_proto_pb2",
deps = [":hash_name_proto"],
well_known_protos = False,
name = "hash_name_py_pb2",
srcs = [":hash_name_proto"],
)
py_grpc_library(
name = "hash_name_py_pb2_grpc",
srcs = [":hash_name_proto"],
deps = [":hash_name_py_pb2"],
)
py_binary(
@ -35,8 +40,9 @@ py_binary(
srcs = ["client.py"],
deps = [
"//src/python/grpcio/grpc:grpcio",
":hash_name_proto_pb2",
requirement("six"),
":hash_name_py_pb2",
":hash_name_py_pb2_grpc",
"//external:six"
],
srcs_version = "PY2AND3",
)
@ -46,7 +52,7 @@ py_library(
srcs = ["search.py"],
srcs_version = "PY2AND3",
deps = [
":hash_name_proto_pb2",
":hash_name_py_pb2",
],
)
@ -55,10 +61,10 @@ py_binary(
srcs = ["server.py"],
deps = [
"//src/python/grpcio/grpc:grpcio",
":hash_name_proto_pb2",
":hash_name_py_pb2",
":search",
] + select({
"//conditions:default": [requirement("futures")],
"//conditions:default": ["@futures//:futures"],
"//:python3": [],
}),
srcs_version = "PY2AND3",

Loading…
Cancel
Save