From c5a3395b8781e14c4566cf0e476b234d6a1c1224 Mon Sep 17 00:00:00 2001 From: Jay Lee Date: Fri, 17 Jan 2020 11:18:47 -0800 Subject: [PATCH 1/3] fix: make collections import compatible across Python versions (#419) * Use collections.abc, fixes #418 * Python 2.7 compat fix * Fix check --- google/auth/jwt.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/google/auth/jwt.py b/google/auth/jwt.py index a30c575b2..361c4567a 100644 --- a/google/auth/jwt.py +++ b/google/auth/jwt.py @@ -40,7 +40,10 @@ """ -import collections +try: + from collections.abc import Mapping +except ImportError: # Python 2.7 compatibility + from collections import Mapping import copy import datetime import json @@ -215,7 +218,7 @@ def decode(token, certs=None, verify=True, audience=None): # If certs is specified as a dictionary of key IDs to certificates, then # use the certificate identified by the key ID in the token header. - if isinstance(certs, collections.Mapping): + if isinstance(certs, Mapping): key_id = header.get("kid") if key_id: if key_id not in certs: From 0ca0ee55dc7f8e24728c2773f57c31aa7939207a Mon Sep 17 00:00:00 2001 From: Bu Sun Kim <8822365+busunkim96@users.noreply.github.com> Date: Sat, 18 Jan 2020 00:38:49 -0800 Subject: [PATCH 2/3] chore: add no cover for py2 collections import (#426) --- google/auth/jwt.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/google/auth/jwt.py b/google/auth/jwt.py index 361c4567a..06e767968 100644 --- a/google/auth/jwt.py +++ b/google/auth/jwt.py @@ -42,7 +42,8 @@ try: from collections.abc import Mapping -except ImportError: # Python 2.7 compatibility +# Python 2.7 compatibility +except ImportError: # pragma: NO COVER from collections import Mapping import copy import datetime From af23e6926d8519f30a481ffeb7910ccd0f45dc48 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Tue, 21 Jan 2020 14:02:12 -0800 Subject: [PATCH 3/3] chore: release 1.10.2 (#425) --- CHANGELOG.md | 7 +++++++ setup.py | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 70032efcb..bc1d040d1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,13 @@ [1]: https://pypi.org/project/google-auth/#history +### [1.10.2](https://www.github.com/googleapis/google-auth-library-python/compare/v1.10.1...v1.10.2) (2020-01-18) + + +### Bug Fixes + +* make collections import compatible across Python versions ([#419](https://www.github.com/googleapis/google-auth-library-python/issues/419)) ([c5a3395](https://www.github.com/googleapis/google-auth-library-python/commit/c5a3395b8781e14c4566cf0e476b234d6a1c1224)), closes [#418](https://www.github.com/googleapis/google-auth-library-python/issues/418) + ### [1.10.1](https://www.github.com/googleapis/google-auth-library-python/compare/v1.10.0...v1.10.1) (2020-01-10) diff --git a/setup.py b/setup.py index 1b5eac4bc..708a5d164 100644 --- a/setup.py +++ b/setup.py @@ -30,7 +30,7 @@ with io.open("README.rst", "r") as fh: long_description = fh.read() -version = "1.10.1" +version = "1.10.2" setup( name="google-auth",