From 42aa73d28eb331ecfdc74a44468e675dcdb557de Mon Sep 17 00:00:00 2001 From: Tim Swast Date: Wed, 18 Nov 2020 09:40:41 -0600 Subject: [PATCH] deps: require `six>=1.12.0` and `google-api-core>=1.21.0` * `six>=1.12.0` is to support legacy App Engine standard runtimes * `google-api-core>=1.21.0` is needed for `DuplicateCredentialArgs` exception --- google/cloud/_http.py | 5 ++++- noxfile.py | 17 +++++++++++++++-- setup.py | 7 ++++++- testing/constraints-2.7.txt | 2 ++ testing/constraints-3.5.txt | 2 ++ testing/constraints-3.6.txt | 0 testing/constraints-3.7.txt | 0 testing/constraints-3.8.txt | 0 8 files changed, 29 insertions(+), 4 deletions(-) create mode 100644 testing/constraints-2.7.txt create mode 100644 testing/constraints-3.5.txt create mode 100644 testing/constraints-3.6.txt create mode 100644 testing/constraints-3.7.txt create mode 100644 testing/constraints-3.8.txt diff --git a/google/cloud/_http.py b/google/cloud/_http.py index 8062622..fbc228e 100644 --- a/google/cloud/_http.py +++ b/google/cloud/_http.py @@ -15,11 +15,14 @@ """Shared implementation of connections to API servers.""" import collections +try: + import collections.abc as collections_abc +except ImportError: + import collections as collections_abc import json import platform import warnings -from six.moves import collections_abc from six.moves.urllib.parse import urlencode from google.api_core.client_info import ClientInfo diff --git a/noxfile.py b/noxfile.py index 0a415ac..f663bf1 100644 --- a/noxfile.py +++ b/noxfile.py @@ -20,6 +20,7 @@ DEFAULT_PYTHON_VERSION = "3.7" +CURRENT_DIRECTORY = os.path.abspath(os.path.dirname(__file__)) def default(session): @@ -29,10 +30,22 @@ def default(session): Python corresponding to the ``nox`` binary the ``PATH`` can run the tests. """ + constraints_path = os.path.join( + CURRENT_DIRECTORY, + "testing", + "constraints-{}.txt".format(session.python) + ) # Install all test dependencies, then install local packages in-place. - session.install("mock", "pytest", "pytest-cov", "grpcio >= 1.0.2") - session.install("-e", ".") + session.install( + "mock", + "pytest", + "pytest-cov", + "grpcio >= 1.0.2", + "-c", + constraints_path + ) + session.install("-e", ".", "-c", constraints_path) # Run py.test against the unit tests. session.run( diff --git a/setup.py b/setup.py index 8db7c0f..b816383 100644 --- a/setup.py +++ b/setup.py @@ -27,7 +27,12 @@ # 'Development Status :: 4 - Beta' # 'Development Status :: 5 - Production/Stable' release_status = "Development Status :: 5 - Production/Stable" -dependencies = ["google-api-core >= 1.19.0, < 2.0.0dev"] +dependencies = [ + "google-api-core >= 1.21.0, < 2.0.0dev", + # Support six==1.12.0 due to App Engine standard runtime. + # https://github.com/googleapis/python-cloud-core/issues/45 + "six >=1.12.0", +] extras = {"grpc": "grpcio >= 1.8.2, < 2.0dev"} diff --git a/testing/constraints-2.7.txt b/testing/constraints-2.7.txt new file mode 100644 index 0000000..8679811 --- /dev/null +++ b/testing/constraints-2.7.txt @@ -0,0 +1,2 @@ +google-api-core==1.21.0 +six==1.12.0 diff --git a/testing/constraints-3.5.txt b/testing/constraints-3.5.txt new file mode 100644 index 0000000..8679811 --- /dev/null +++ b/testing/constraints-3.5.txt @@ -0,0 +1,2 @@ +google-api-core==1.21.0 +six==1.12.0 diff --git a/testing/constraints-3.6.txt b/testing/constraints-3.6.txt new file mode 100644 index 0000000..e69de29 diff --git a/testing/constraints-3.7.txt b/testing/constraints-3.7.txt new file mode 100644 index 0000000..e69de29 diff --git a/testing/constraints-3.8.txt b/testing/constraints-3.8.txt new file mode 100644 index 0000000..e69de29