From ea09feb13cd4e5d08f6456445f7e98c06f9296d2a6b8b5de2a7cff08d603559e Mon Sep 17 00:00:00 2001 From: John Vandenberg Date: Sun, 15 Aug 2021 00:55:57 +0000 Subject: [PATCH] Accepting request 912052 from home:fusionfuture:branches:devel:languages:python:flask - Require pip and importlib-metadata to fix build. - Add fix-ParanoidTests-fail.patch to fix test failures in ParanoidTests. OBS-URL: https://build.opensuse.org/request/show/912052 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:flask/python-Flask-Paranoid?expand=0&rev=5 --- fix-ParanoidTests-fail.patch | 11 +++++++++++ python-Flask-Paranoid.changes | 7 +++++++ python-Flask-Paranoid.spec | 16 ++++++++++++---- 3 files changed, 30 insertions(+), 4 deletions(-) create mode 100644 fix-ParanoidTests-fail.patch diff --git a/fix-ParanoidTests-fail.patch b/fix-ParanoidTests-fail.patch new file mode 100644 index 0000000..a86d8a1 --- /dev/null +++ b/fix-ParanoidTests-fail.patch @@ -0,0 +1,11 @@ +--- a/tests/test_paranoid.py ++++ b/tests/test_paranoid.py +@@ -7,7 +7,7 @@ from flask_paranoid import Paranoid + + class ParanoidTests(unittest.TestCase): + def _delete_cookie(self, name): +- return (name + '=; Expires=Thu, 01-Jan-1970 00:00:00 GMT; ' ++ return (name + '=; Expires=Thu, 01 Jan 1970 00:00:00 GMT; ' + 'Max-Age=0; Path=/') + + def test_401(self): diff --git a/python-Flask-Paranoid.changes b/python-Flask-Paranoid.changes index 9241b49..140084c 100644 --- a/python-Flask-Paranoid.changes +++ b/python-Flask-Paranoid.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Sat Aug 14 02:54:08 UTC 2021 - Fusion Future + +- Require pip and importlib-metadata to fix build. +- Add fix-ParanoidTests-fail.patch to fix test failures in + ParanoidTests. + ------------------------------------------------------------------- Wed Oct 24 14:05:47 UTC 2018 - Jan Engelhardt diff --git a/python-Flask-Paranoid.spec b/python-Flask-Paranoid.spec index 6ed97c0..2fcd4eb 100644 --- a/python-Flask-Paranoid.spec +++ b/python-Flask-Paranoid.spec @@ -1,7 +1,7 @@ # # spec file for package python-Flask-Paranoid # -# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2021 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -12,7 +12,8 @@ # license that conforms to the Open Source Definition (Version 1.9) # published by the Open Source Initiative. -# Please submit bugfixes or comments via http://bugs.opensuse.org/ +# Please submit bugfixes or comments via https://bugs.opensuse.org/ +# %{?!python_module:%define python_module() python-%{**} python3-%{**}} @@ -21,15 +22,19 @@ Version: 0.2.0 Release: 0 License: MIT Summary: Flask user session protection -Url: http://github.com/miguelgrinberg/flask-paranoid/ +URL: http://github.com/miguelgrinberg/flask-paranoid/ Group: Development/Languages/Python # Pypi sources don't include tests #Source: https://files.pythonhosted.org/packages/source/F/Flask-Paranoid/Flask-Paranoid-%%{version}.tar.gz Source: https://github.com/miguelgrinberg/flask-paranoid/archive/v0.2.tar.gz Source99: https://raw.githubusercontent.com/miguelgrinberg/flask-paranoid/master/LICENSE -BuildRequires: python-rpm-macros +# PATCH-FIX-OPENSUSE fix-ParanoidTests-fail.patch The minus sign is removed from HTTP headers in newer Python releases. +Patch0: fix-ParanoidTests-fail.patch +BuildRequires: %{python_module importlib-metadata} +BuildRequires: %{python_module pip} BuildRequires: %{python_module setuptools} BuildRequires: fdupes +BuildRequires: python-rpm-macros # Test requirements BuildRequires: %{python_module Flask >= 0.10} # End of test requirements @@ -48,6 +53,9 @@ agent when a client connects to the flask application. %prep %setup -q -n flask-paranoid-0.2 +%if 0%{?suse_version} > 1500 +%patch0 -p1 +%endif cp %{SOURCE99} . %build