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