From fa51789c3edad3833938db0094b8f2fbe1f1945f470f378454343f1e1cfe1d19 Mon Sep 17 00:00:00 2001 From: Steve Kowalik Date: Wed, 28 Jun 2023 06:44:25 +0000 Subject: [PATCH] - Add patch no-more-six.patch: * Do not require six. - Do not use greedy globs in %files. OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-pywebpush?expand=0&rev=6 --- no-more-six.patch | 40 ++++++++++++++++++++++++++++++++++++++++ python-pywebpush.changes | 7 +++++++ python-pywebpush.spec | 10 ++++++---- 3 files changed, 53 insertions(+), 4 deletions(-) create mode 100644 no-more-six.patch diff --git a/no-more-six.patch b/no-more-six.patch new file mode 100644 index 0000000..c791058 --- /dev/null +++ b/no-more-six.patch @@ -0,0 +1,40 @@ +Index: pywebpush-1.14.0/pywebpush/__init__.py +=================================================================== +--- pywebpush-1.14.0.orig/pywebpush/__init__.py ++++ pywebpush-1.14.0/pywebpush/__init__.py +@@ -13,7 +13,6 @@ try: + except ImportError: # pragma nocover + from urlparse import urlparse + +-import six + import http_ece + import requests + from cryptography.hazmat.backends import default_backend +@@ -152,7 +151,7 @@ class WebPusher: + for k in ['p256dh', 'auth']: + if keys.get(k) is None: + raise WebPushException("Missing keys value: {}".format(k)) +- if isinstance(keys[k], six.text_type): ++ if isinstance(keys[k], str): + keys[k] = bytes(keys[k].encode('utf8')) + receiver_raw = base64.urlsafe_b64decode( + self._repad(keys['p256dh'])) +@@ -206,7 +205,7 @@ class WebPusher: + format=serialization.PublicFormat.UncompressedPoint + ) + +- if isinstance(data, six.text_type): ++ if isinstance(data, str): + data = bytes(data.encode('utf8')) + if content_encoding == "aes128gcm": + self.verb("Encrypting to aes128gcm...") +Index: pywebpush-1.14.0/requirements.txt +=================================================================== +--- pywebpush-1.14.0.orig/requirements.txt ++++ pywebpush-1.14.0/requirements.txt +@@ -1,5 +1,4 @@ + cryptography>=2.6.1 + http-ece>=1.1.0 + requests>=2.21.0 +-six>=1.15.0 + py-vapid>=1.7.0 diff --git a/python-pywebpush.changes b/python-pywebpush.changes index 18acc56..6871d0c 100644 --- a/python-pywebpush.changes +++ b/python-pywebpush.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Wed Jun 28 06:43:49 UTC 2023 - Steve Kowalik + +- Add patch no-more-six.patch: + * Do not require six. +- Do not use greedy globs in %files. + ------------------------------------------------------------------- Fri Apr 8 10:03:17 UTC 2022 - pgajdos@suse.com diff --git a/python-pywebpush.spec b/python-pywebpush.spec index 4df22ca..6862a17 100644 --- a/python-pywebpush.spec +++ b/python-pywebpush.spec @@ -1,7 +1,7 @@ # # spec file for package python-pywebpush # -# Copyright (c) 2022 SUSE LLC +# Copyright (c) 2023 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -16,7 +16,6 @@ # -%{?!python_module:%define python_module() python-%{**} python3-%{**}} Name: python-pywebpush Version: 1.14.0 Release: 0 @@ -24,6 +23,8 @@ Summary: WebPush publication library License: MPL-2.0 URL: https://github.com/web-push-libs/pywebpush Source: https://files.pythonhosted.org/packages/source/p/pywebpush/pywebpush-%{version}.tar.gz +# PATCH-FIX-OPENSUSE Do not require six module +Patch0: no-more-six.patch BuildRequires: %{python_module setuptools} BuildRequires: fdupes BuildRequires: python-rpm-macros @@ -47,7 +48,7 @@ BuildRequires: %{python_module requests >= 2.21.0} WebPush publication library. %prep -%setup -q -n pywebpush-%{version} +%autosetup -p1 -n pywebpush-%{version} %build %python_build @@ -72,6 +73,7 @@ sed -i 's:from mock:from unittest.mock:' pywebpush/tests/test_webpush.py %doc CHANGELOG.md README.md README.rst %license LICENSE %python_alternative %{_bindir}/pywebpush -%{python_sitelib}/* +%{python_sitelib}/pywebpush +%{python_sitelib}/pywebpush-%{version}*-*info %changelog