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