[Remove Six] Remove dependency on six (#31340)

* [Python][Remove Six] Remove Six from requirements
pull/31381/head
Xuan Wang 2 years ago committed by GitHub
parent 7a2c28c7b9
commit 7aca6d4007
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 12
      bazel/grpc_python_deps.bzl
  2. 1
      examples/python/cancellation/BUILD.bazel
  3. 1
      requirements.bazel.txt
  4. 1
      requirements.txt
  5. 5
      setup.py
  6. 1
      src/python/grpcio/grpc/BUILD.bazel
  7. 12
      src/python/grpcio/grpc/framework/foundation/BUILD.bazel
  8. 1
      src/python/grpcio/grpc/framework/interfaces/base/BUILD.bazel
  9. 1
      src/python/grpcio/grpc/framework/interfaces/face/BUILD.bazel
  10. 4
      src/python/grpcio_tests/setup.py
  11. 1
      src/python/grpcio_tests/tests/csds/BUILD.bazel
  12. 2
      src/python/grpcio_tests/tests/unit/BUILD.bazel
  13. 1
      src/python/grpcio_tests/tests_aio/unit/BUILD.bazel
  14. 1
      src/python/grpcio_tests/tests_py3_only/unit/BUILD.bazel
  15. 2
      tools/internal_ci/helper_scripts/prepare_build_linux_rc
  16. 2
      tools/internal_ci/helper_scripts/prepare_build_macos_rc
  17. 2
      tools/internal_ci/helper_scripts/prepare_build_windows.bat

@ -19,18 +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."""
# 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" not in native.existing_rules():
http_archive(
name = "six",
build_file = "@com_github_grpc_grpc//third_party:six.BUILD",
sha256 = "1e61c37477a1626458e36f7b1d82aa5c9b094fa4802892072e49de9c60c4c926",
urls = ["https://files.pythonhosted.org/packages/71/39/171f1c67cd00715f190ba0b100d606d440a28c93c7714febeca8b79af85e/six-1.16.0.tar.gz"],
)
if "enum34" not in native.existing_rules():
http_archive(
name = "enum34",

@ -44,7 +44,6 @@ py_binary(
":hash_name_py_pb2",
":hash_name_py_pb2_grpc",
"//src/python/grpcio/grpc:grpcio",
"@six",
],
)

@ -3,7 +3,6 @@ coverage==4.5.4
cython==0.29.21
enum34==1.1.10
protobuf>=3.5.0.post1, < 4.0dev
six==1.16.0
wheel==0.36.2
futures==3.1.1
google-auth==1.24.0

@ -2,5 +2,4 @@
coverage>=4.0
cython>=0.29.8
protobuf>=4.21.3,<5.0dev
six>=1.10
wheel>=0.29

@ -482,7 +482,6 @@ PACKAGE_DIRECTORIES = {
}
INSTALL_REQUIRES = (
"six>=1.5.2",
"futures>=2.2.0; python_version<'3.2'",
"enum34>=1.0.4; python_version<'3.4'",
)
@ -491,9 +490,7 @@ EXTRAS_REQUIRES = {
}
SETUP_REQUIRES = INSTALL_REQUIRES + (
'Sphinx~=1.8.1',
'six>=1.10',
) if ENABLE_DOCUMENTATION_BUILD else ()
'Sphinx~=1.8.1',) if ENABLE_DOCUMENTATION_BUILD else ()
try:
import Cython

@ -110,7 +110,6 @@ py_library(
"//src/python/grpcio/grpc/_cython:cygrpc",
"//src/python/grpcio/grpc/experimental",
"//src/python/grpcio/grpc/framework",
"@six//:six",
] + select({
"//conditions:default": ["@enum34//:enum34"],
"//:python3": [],

@ -34,9 +34,7 @@ py_library(
py_library(
name = "callable_util",
srcs = ["callable_util.py"],
deps = [
"@six//:six",
] + select({
deps = select({
"//conditions:default": ["@enum34//:enum34"],
"//:python3": [],
}),
@ -45,9 +43,7 @@ py_library(
py_library(
name = "future",
srcs = ["future.py"],
deps = [
"@six",
],
deps = [],
)
py_library(
@ -70,7 +66,5 @@ py_library(
py_library(
name = "stream",
srcs = ["stream.py"],
deps = [
"@six",
],
deps = [],
)

@ -27,7 +27,6 @@ py_library(
srcs = ["base.py"],
deps = [
"//src/python/grpcio/grpc/framework/foundation:abandonment",
"@six//:six",
] + select({
"//conditions:default": ["@enum34//:enum34"],
"//:python3": [],

@ -28,7 +28,6 @@ py_library(
deps = [
"//src/python/grpcio/grpc/framework/foundation",
"//src/python/grpcio/grpc/framework/common",
"@six//:six",
] + select({
"//conditions:default": ["@enum34//:enum34"],
"//:python3": [],

@ -42,8 +42,8 @@ INSTALL_REQUIRES = (
'grpcio-status>={version}'.format(version=grpc_version.VERSION),
'grpcio-tools>={version}'.format(version=grpc_version.VERSION),
'grpcio-health-checking>={version}'.format(version=grpc_version.VERSION),
'oauth2client>=1.4.7', 'protobuf>=4.21.6', 'six>=1.10',
'google-auth>=1.17.2', 'requests>=2.14.2')
'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')

@ -21,6 +21,5 @@ py_test(
deps = [
"//src/python/grpcio/grpc:grpcio",
"//src/python/grpcio_csds/grpc_csds",
"@six",
],
)

@ -131,7 +131,6 @@ py_library(
"//src/python/grpcio/grpc:grpcio",
"//src/python/grpcio_tests/tests/testing",
"//src/python/grpcio_tests/tests/unit/framework/common",
"@six",
],
)
for test_file_name in GRPCIO_TESTS_UNIT
@ -152,6 +151,5 @@ internal_py_grpc_test(
"//src/python/grpcio/grpc:grpcio",
"//src/python/grpcio_tests/tests/testing",
"//tools/distrib/python/grpcio_tools:grpc_tools",
"@six",
],
)

@ -79,7 +79,6 @@ _FLAKY_TESTS = [
"//src/python/grpcio/grpc:grpcio",
"//src/python/grpcio_tests/tests/unit:resources",
"//src/python/grpcio_tests/tests/unit/framework/common",
"@six",
],
)
for test_file_name in GRPC_ASYNC_TESTS

@ -34,7 +34,6 @@ GRPCIO_PY3_ONLY_TESTS_UNIT = glob([
"//src/python/grpcio_tests/tests/unit:resources",
"//src/python/grpcio_tests/tests/unit:test_common",
"//src/python/grpcio_tests/tests/unit/framework/common",
"@six",
],
)
for test_file_name in GRPCIO_PY3_ONLY_TESTS_UNIT

@ -41,8 +41,6 @@ export DOCKERHUB_ORGANIZATION=grpctesting
git submodule update --init
python3 -m pip install six
# check whether /tmpfs is mounted correctly
(mount | grep -q 'on /tmpfs ') || (mount; echo 'BAD KOKORO WORKER WARNING: it seems that /tmpfs volume with scratch disk is not mounted in the kokoro worker. This can result in unexpected "out of disk space" errors.')

@ -48,7 +48,7 @@ export HOMEBREW_NO_AUTO_UPDATE=1
brew config
# Add GCP credentials for BQ access
pip install --user google-api-python-client oauth2client six==1.16.0
pip install --user google-api-python-client oauth2client
export GOOGLE_APPLICATION_CREDENTIALS=${KOKORO_GFILE_DIR}/GrpcTesting-d0eeee2db331.json
DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)"

@ -85,7 +85,7 @@ If "%PREPARE_BUILD_INSTALL_DEPS_PYTHON%" == "true" (
)
@rem Needed for uploading test results to bigquery
python -m pip install google-api-python-client oauth2client six==1.16.0 || goto :error
python -m pip install google-api-python-client oauth2client || goto :error
git submodule update --init || goto :error

Loading…
Cancel
Save