From 2e4023761b4631ce47796c0b2484bf63e2eaeb0e6c647d9e62e410021edf0df0 Mon Sep 17 00:00:00 2001 From: Matej Cepl Date: Fri, 26 Feb 2021 21:47:01 +0000 Subject: [PATCH] Accepting request 875490 from home:jayvdb:branches:devel:languages:python - Add pr_122.patch to fix builds OBS-URL: https://build.opensuse.org/request/show/875490 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-apns2?expand=0&rev=5 --- pr_122.patch | 37 +++++++++++++++++++++++++++++++++++++ python-apns2.changes | 5 +++++ python-apns2.spec | 2 ++ 3 files changed, 44 insertions(+) create mode 100644 pr_122.patch diff --git a/pr_122.patch b/pr_122.patch new file mode 100644 index 0000000..6a12048 --- /dev/null +++ b/pr_122.patch @@ -0,0 +1,37 @@ +From 62793cb0eff591bb091d349177a7028bf6f0f6bc Mon Sep 17 00:00:00 2001 +From: Joffrey MANDER +Date: Tue, 29 Dec 2020 10:41:56 +0100 +Subject: [PATCH 1/2] apns2.credentials: since version 2.0.0 pyJWT encode + method return str + +--- + apns2/credentials.py | 2 +- + setup.py | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/apns2/credentials.py b/apns2/credentials.py +index 655893f..028093e 100644 +--- a/apns2/credentials.py ++++ b/apns2/credentials.py +@@ -87,7 +87,7 @@ def _get_or_create_topic_token(self) -> str: + } + jwt_token = jwt.encode(token_dict, self.__auth_key, + algorithm=self.__encryption_algorithm, +- headers=headers).decode('ascii') ++ headers=headers) + + # Cache JWT token for later use. One JWT token per connection. + # https://developer.apple.com/documentation/usernotifications/setting_up_a_remote_notification_server/establishing_a_token-based_connection_to_apns +diff --git a/setup.py b/setup.py +index 2d8fafb..5837572 100755 +--- a/setup.py ++++ b/setup.py +@@ -8,7 +8,7 @@ + packages=['apns2'], + install_requires=[ + 'hyper>=0.7', +- 'PyJWT>=1.4.0,<2.0.0', ++ 'PyJWT>=2.0.0', + 'cryptography>=1.7.2', + ], + extras_require={ diff --git a/python-apns2.changes b/python-apns2.changes index fb986db..8195d58 100644 --- a/python-apns2.changes +++ b/python-apns2.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Fri Feb 26 15:42:17 UTC 2021 - John Vandenberg + +- Add pr_122.patch to fix builds + ------------------------------------------------------------------- Fri Feb 26 14:26:56 UTC 2021 - Matej Cepl diff --git a/python-apns2.spec b/python-apns2.spec index 44c4ce4..af9fcd9 100644 --- a/python-apns2.spec +++ b/python-apns2.spec @@ -26,6 +26,8 @@ License: MIT Group: Development/Languages/Python URL: https://github.com/Pr0Ger/PyAPNs2 Source0: https://files.pythonhosted.org/packages/source/a/apns2/apns2-%{version}.tar.gz +# Subset of https://github.com/Pr0Ger/PyAPNs2/pull/122.patch +Patch0: pr_122.patch BuildRequires: %{python_module setuptools} BuildRequires: fdupes BuildRequires: python-rpm-macros