Accepting request 978800 from devel:languages:python:flask

OBS-URL: https://build.opensuse.org/request/show/978800
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-Flask-Paranoid?expand=0&rev=5
This commit is contained in:
Dominique Leuenberger 2022-05-24 18:31:33 +00:00 committed by Git OBS Bridge
commit 9bce6bccf3
5 changed files with 46 additions and 17 deletions

View File

@ -1,11 +1,26 @@
--- a/tests/test_paranoid.py
+++ b/tests/test_paranoid.py
@@ -7,7 +7,7 @@ from flask_paranoid import Paranoid
Index: flask-paranoid-0.3.0/tests/test_paranoid.py
===================================================================
--- flask-paranoid-0.3.0.orig/tests/test_paranoid.py
+++ flask-paranoid-0.3.0/tests/test_paranoid.py
@@ -1,12 +1,21 @@
import sys
import unittest
+import flask
from flask import Flask
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 _delete_cookie(self, name, httponly=True):
+ flask_version = flask.__version__.split('.')
+ if int(flask_version[0]) < 2 or (int(flask_version[0]) == 2 and int(flask_version[1]) < 1):
+ httponly = False
+
+ if (sys.version_info.minor < 8):
+ return (name + '=; Expires=Thu, 01-Jan-1970 00:00:00 GMT; '
+ f'Max-Age=0; {"HttpOnly; " if httponly else ""}Path=/')
+
return (name + '=; Expires=Thu, 01 Jan 1970 00:00:00 GMT; '
f'Max-Age=0; {"HttpOnly; " if httponly else ""}Path=/')
def test_401(self):

View File

@ -1,3 +1,12 @@
-------------------------------------------------------------------
Tue May 24 02:58:33 UTC 2022 - Fusion Future <qydwhotmail@gmail.com>
- Update to 0.3.0
* Project restructure and test fixes
- Bump minimum required python version to 3.7
- Fix compatibility with old Flask versions
* fix-ParanoidTests-fail.patch
-------------------------------------------------------------------
Tue Sep 14 11:51:45 UTC 2021 - pgajdos@suse.com

View File

@ -1,7 +1,7 @@
#
# spec file for package python-Flask-Paranoid
#
# Copyright (c) 2021 SUSE LLC
# Copyright (c) 2022 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@ -16,9 +16,12 @@
#
%define skip_python2 1
%define skip_python36 1
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
Name: python-Flask-Paranoid
Version: 0.2.0
Version: 0.3.0
Release: 0
License: MIT
Summary: Flask user session protection
@ -26,7 +29,7 @@ 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
Source: https://github.com/miguelgrinberg/flask-paranoid/archive/refs/tags/v%{version}.tar.gz
Source99: https://raw.githubusercontent.com/miguelgrinberg/flask-paranoid/master/LICENSE
# PATCH-FIX-OPENSUSE fix-ParanoidTests-fail.patch The minus sign is removed from HTTP headers in newer Python releases.
Patch0: fix-ParanoidTests-fail.patch
@ -52,10 +55,8 @@ The extension generates a "paranoid" token according to the IP address and user
agent when a client connects to the flask application.
%prep
%setup -q -n flask-paranoid-0.2
%if 0%{?suse_version} > 1500
%setup -q -n flask-paranoid-%{version}
%patch0 -p1
%endif
cp %{SOURCE99} .
%build
@ -66,7 +67,11 @@ cp %{SOURCE99} .
%python_expand %fdupes %{buildroot}%{$python_sitelib}
%check
%if 0%{?suse_version} > 1500
%pyunittest discover -v
%else
%python_exec setup.py test
%endif
%files %{python_files}
%license LICENSE

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:cda72c43fd17e6b782e079942b79ec9b19ac40c06337c871cc1dfedbe49297d3
size 101084

3
v0.3.0.tar.gz Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:cab9f54e382707c31eb5ad58e1ce3b371ecd0d5d4f3385f9cf01bd13a2e1d9ec
size 102495