Remove enum and future (#31381)

* [Python][Remove enum34] Remove enum34

* [Python][Remove futures] Remove futures

* Remove empty deps from .bazel files
pull/31394/head
Xuan Wang 2 years ago committed by GitHub
parent 216fb9b77c
commit 149f5615ba
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 18
      bazel/grpc_python_deps.bzl
  2. 7
      examples/python/cancellation/BUILD.bazel
  3. 9
      examples/python/errors/BUILD.bazel
  4. 7
      examples/python/multiprocessing/BUILD
  5. 2
      requirements.bazel.txt
  6. 6
      setup.py
  7. 15
      src/python/grpcio/grpc/BUILD.bazel
  8. 8
      src/python/grpcio/grpc/framework/common/BUILD.bazel
  9. 10
      src/python/grpcio/grpc/framework/foundation/BUILD.bazel
  10. 9
      src/python/grpcio/grpc/framework/interfaces/base/BUILD.bazel
  11. 7
      src/python/grpcio/grpc/framework/interfaces/face/BUILD.bazel
  12. 3
      src/python/grpcio_tests/setup.py
  13. 9
      src/python/grpcio_tests/tests/interop/BUILD.bazel
  14. 1
      tools/distrib/format_bazel.sh

@ -19,24 +19,6 @@ load("@com_github_grpc_grpc//third_party/py:python_configure.bzl", "python_confi
# buildifier: disable=unnamed-macro
def grpc_python_deps():
"""Loads dependencies for gRPC Python."""
if "enum34" not in native.existing_rules():
http_archive(
name = "enum34",
build_file = "@com_github_grpc_grpc//third_party:enum34.BUILD",
strip_prefix = "enum34-1.1.6",
sha256 = "8ad8c4783bf61ded74527bffb48ed9b54166685e4230386a9ed9b1279e2df5b1",
urls = ["https://files.pythonhosted.org/packages/bf/3e/31d502c25302814a7c2f1d3959d2a3b3f78e509002ba91aea64993936876/enum34-1.1.6.tar.gz"],
)
if "futures" not in native.existing_rules():
http_archive(
name = "futures",
build_file = "@com_github_grpc_grpc//third_party:futures.BUILD",
strip_prefix = "futures-3.3.0",
sha256 = "7e033af76a5e35f58e56da7a91e687706faf4e7bdfb2cbc3f2cca6b9bcda9794",
urls = ["https://files.pythonhosted.org/packages/47/04/5fc6c74ad114032cd2c544c575bffc17582295e9cd6a851d6026ab4b2c00/futures-3.3.0.tar.gz"],
)
if "io_bazel_rules_python" not in native.existing_rules():
http_archive(
name = "io_bazel_rules_python",

@ -62,13 +62,10 @@ py_binary(
python_version = "PY3",
srcs_version = "PY2AND3",
deps = [
"//src/python/grpcio/grpc:grpcio",
":hash_name_py_pb2",
":search",
] + select({
"//conditions:default": ["@futures//:futures"],
"//:python3": [],
}),
"//src/python/grpcio/grpc:grpcio",
],
)
py_test(

@ -32,14 +32,11 @@ py_library(
testonly = 1,
srcs = ["server.py"],
deps = [
"//src/python/grpcio/grpc:grpcio",
"//src/python/grpcio_status/grpc_status:grpc_status",
"//examples/protos:helloworld_py_pb2",
"//examples/protos:helloworld_py_pb2_grpc",
] + select({
"//conditions:default": [requirement("futures")],
"//:python3": [],
}),
"//src/python/grpcio/grpc:grpcio",
"//src/python/grpcio_status/grpc_status",
],
)
py_test(

@ -55,13 +55,10 @@ py_binary(
python_version = "PY3",
srcs_version = "PY3",
deps = [
"//src/python/grpcio/grpc:grpcio",
":prime_proto_pb2",
":prime_proto_pb2_grpc",
] + select({
"//conditions:default": ["@futures//:futures"],
"//:python3": [],
}),
"//src/python/grpcio/grpc:grpcio",
],
)
py_test(

@ -1,10 +1,8 @@
# GRPC Python setup requirements
coverage==4.5.4
cython==0.29.21
enum34==1.1.10
protobuf>=3.5.0.post1, < 4.0dev
wheel==0.36.2
futures==3.1.1
google-auth==1.24.0
oauth2client==4.1.0
requests==2.25.1

@ -481,10 +481,8 @@ PACKAGE_DIRECTORIES = {
'': PYTHON_STEM,
}
INSTALL_REQUIRES = (
"futures>=2.2.0; python_version<'3.2'",
"enum34>=1.0.4; python_version<'3.4'",
)
INSTALL_REQUIRES = ()
EXTRAS_REQUIRES = {
'protobuf': 'grpcio-tools>={version}'.format(version=grpc_version.VERSION),
}

@ -97,21 +97,18 @@ py_library(
],
imports = ["../"],
deps = [
":_runtime_protos",
":_simple_stubs",
":aio",
":utilities",
":auth",
":plugin_wrapping",
":channel",
":compression",
":interceptor",
":plugin_wrapping",
":server",
":compression",
":_simple_stubs",
":_runtime_protos",
":utilities",
"//src/python/grpcio/grpc/_cython:cygrpc",
"//src/python/grpcio/grpc/experimental",
"//src/python/grpcio/grpc/framework",
] + select({
"//conditions:default": ["@enum34//:enum34"],
"//:python3": [],
}),
],
)

@ -25,17 +25,9 @@ py_library(
py_library(
name = "cardinality",
srcs = ["cardinality.py"],
deps = select({
"//conditions:default": ["@enum34//:enum34"],
"//:python3": [],
}),
)
py_library(
name = "style",
srcs = ["style.py"],
deps = select({
"//conditions:default": ["@enum34//:enum34"],
"//:python3": [],
}),
)

@ -34,25 +34,16 @@ py_library(
py_library(
name = "callable_util",
srcs = ["callable_util.py"],
deps = select({
"//conditions:default": ["@enum34//:enum34"],
"//:python3": [],
}),
)
py_library(
name = "future",
srcs = ["future.py"],
deps = [],
)
py_library(
name = "logging_pool",
srcs = ["logging_pool.py"],
deps = select({
"//conditions:default": ["@futures//:futures"],
"//:python3": [],
}),
)
py_library(
@ -66,5 +57,4 @@ py_library(
py_library(
name = "stream",
srcs = ["stream.py"],
deps = [],
)

@ -27,17 +27,10 @@ py_library(
srcs = ["base.py"],
deps = [
"//src/python/grpcio/grpc/framework/foundation:abandonment",
] + select({
"//conditions:default": ["@enum34//:enum34"],
"//:python3": [],
}),
],
)
py_library(
name = "utilities",
srcs = ["utilities.py"],
deps = select({
"//conditions:default": ["@enum34//:enum34"],
"//:python3": [],
}),
)

@ -26,12 +26,9 @@ py_library(
name = "face_lib",
srcs = ["face.py"],
deps = [
"//src/python/grpcio/grpc/framework/foundation",
"//src/python/grpcio/grpc/framework/common",
] + select({
"//conditions:default": ["@enum34//:enum34"],
"//:python3": [],
}),
"//src/python/grpcio/grpc/framework/foundation",
],
)
py_library(

@ -45,9 +45,6 @@ INSTALL_REQUIRES = (
'oauth2client>=1.4.7', 'protobuf>=4.21.6', 'google-auth>=1.17.2',
'requests>=2.14.2')
if not PY3:
INSTALL_REQUIRES += ('futures>=2.2.0', 'enum34>=1.0.4')
COMMAND_CLASS = {
# Run `preprocess` *before* doing any packaging!
'preprocess': commands.GatherProto,

@ -49,22 +49,19 @@ py_library(
srcs = ["methods.py"],
imports = ["../../"],
deps = [
"//src/python/grpcio/grpc:grpcio",
"//src/python/grpcio_tests/tests:bazel_namespace_package_hack",
"//src/proto/grpc/testing:empty_py_pb2",
"//src/proto/grpc/testing:py_messages_proto",
"//src/proto/grpc/testing:py_test_proto",
"//src/proto/grpc/testing:test_py_pb2_grpc",
"//src/python/grpcio/grpc:grpcio",
"//src/python/grpcio_tests/tests:bazel_namespace_package_hack",
requirement("google-auth"),
requirement("requests"),
requirement("urllib3"),
requirement("chardet"),
requirement("certifi"),
requirement("idna"),
] + select({
"//conditions:default": [requirement("enum34")],
"//:python3": [],
}),
],
)
py_library(

@ -22,7 +22,6 @@ CONFIG_PATH="$(dirname ${0})/bazel_style.cfg"
python -m virtualenv ${VIRTUAL_ENV}
PYTHON=${VIRTUAL_ENV}/bin/python
"$PYTHON" -m pip install --upgrade pip==19.3.1
"$PYTHON" -m pip install --upgrade futures
"$PYTHON" -m pip install yapf==0.30.0
pushd "$(dirname "${0}")/../.."

Loading…
Cancel
Save