[packages/python-flask] - updated to 1.1.4 (for python2.7) instead of accidental 2.0.2 commit - added patch to fix pathlib t

qboosh qboosh at pld-linux.org
Fri Oct 13 21:00:55 CEST 2023


commit bd3097fa97dfd473bd8089b212d46ce278a0689f
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date:   Fri Oct 13 21:02:53 2023 +0200

    - updated to 1.1.4 (for python2.7) instead of accidental 2.0.2 commit
    - added patch to fix pathlib test

 ...n-t-require-sphinxcontrib.log_cabinet-extension.patch |  7 +++----
 python-flask-pathlib2.patch                              | 16 ++++++++++++++++
 python-flask.spec                                        | 11 +++++++----
 3 files changed, 26 insertions(+), 8 deletions(-)
---
diff --git a/python-flask.spec b/python-flask.spec
index 0cd4aaf..0769394 100644
--- a/python-flask.spec
+++ b/python-flask.spec
@@ -3,21 +3,22 @@
 %bcond_without  doc	# Sphinx documentation
 %bcond_without	tests	# unit tests
 %bcond_without	python2	# CPython 2.x module
-# see python3-flask.spec
-%bcond_with	python3	# CPython 3.x module
+%bcond_with	python3	# CPython 3.x module (built from python3-flask.spec)
 
 %define 	module	flask
 Summary:	A microframework based on Werkzeug, Jinja2 and good intentions
 Summary(pl.UTF-8):	Mikroszkielet oparty na Werkzeugu, Jinja2 i dobrych intencjach
 Name:		python-%{module}
-Version:	2.0.2
+# keep 1.x here for python2 support
+Version:	1.1.4
 Release:	1
 License:	BSD
 Group:		Development/Languages/Python
 #Source0Download: https://pypi.python.org/simple/Flask
 Source0:	https://files.pythonhosted.org/packages/source/F/Flask/Flask-%{version}.tar.gz
-# Source0-md5:	f875da30335908956e2f9f3d0f224f2d
+# Source0-md5:	49c23fb3096ee548f9737bbddc934c41
 Patch0:		0001-Don-t-require-sphinxcontrib.log_cabinet-extension.patch
+Patch1:		%{name}-pathlib2.patch
 URL:		https://flask.palletsprojects.com/
 %if %{with tests} && %(locale -a | grep -q '^C\.UTF-8$'; echo $?)
 BuildRequires:	glibc-localedb-all
@@ -30,6 +31,7 @@ BuildRequires:	python-setuptools
 BuildRequires:	python-click >= 5.1
 BuildRequires:	python-itsdangerous >= 0.24
 BuildRequires:	python-jinja2 >= 2.10.1
+BuildRequires:	python-pathlib2
 BuildRequires:	python-pytest
 BuildRequires:	python-werkzeug >= 0.15
 %endif
@@ -93,6 +95,7 @@ Dokumentacja do pakietu Pythona Flask.
 %prep
 %setup -q -n Flask-%{version}
 %patch0 -p1
+%patch1 -p1
 
 %build
 %if %{with python2}
diff --git a/0001-Don-t-require-sphinxcontrib.log_cabinet-extension.patch b/0001-Don-t-require-sphinxcontrib.log_cabinet-extension.patch
index 15dd0a0..be0cbdc 100644
--- a/0001-Don-t-require-sphinxcontrib.log_cabinet-extension.patch
+++ b/0001-Don-t-require-sphinxcontrib.log_cabinet-extension.patch
@@ -7,9 +7,8 @@ Subject: Don't require sphinxcontrib.log_cabinet extension
  docs/conf.py | 1 -
  1 file changed, 1 deletion(-)
 
-diff -urNp -x '*.orig' Flask-2.0.2.org/docs/conf.py Flask-2.0.2/docs/conf.py
---- Flask-2.0.2.org/docs/conf.py	2021-10-01 16:21:57.000000000 +0000
-+++ Flask-2.0.2/docs/conf.py	2021-10-13 09:57:24.866571598 +0000
+--- Flask-1.1.4/docs/conf.py.orig	2023-10-12 21:40:03.642274295 +0200
++++ Flask-1.1.4/docs/conf.py	2023-10-12 21:40:50.942018051 +0200
 @@ -15,7 +15,6 @@ master_doc = "index"
  extensions = [
      "sphinx.ext.autodoc",
@@ -17,4 +16,4 @@ diff -urNp -x '*.orig' Flask-2.0.2.org/docs/conf.py Flask-2.0.2/docs/conf.py
 -    "sphinxcontrib.log_cabinet",
      "pallets_sphinx_themes",
      "sphinx_issues",
-     "sphinx_tabs.tabs",
+ ]
diff --git a/python-flask-pathlib2.patch b/python-flask-pathlib2.patch
new file mode 100644
index 0000000..eb8fc5c
--- /dev/null
+++ b/python-flask-pathlib2.patch
@@ -0,0 +1,16 @@
+Python 2.x pathlib backport doesn't support conversion to str via __fspath__(); pathlib2 does.
+
+--- Flask-1.1.4/tests/test_basic.py.orig	2021-05-14 03:21:10.000000000 +0200
++++ Flask-1.1.4/tests/test_basic.py	2023-10-13 20:55:23.278726095 +0200
+@@ -1426,7 +1426,10 @@ def test_static_url_empty_path_default(a
+ 
+ 
+ def test_static_folder_with_pathlib_path(app):
+-    from pathlib import Path
++    try:
++        from pathlib2 import Path
++    except ImportError:
++        from pathlib import Path
+ 
+     app = flask.Flask(__name__, static_folder=Path("static"))
+     rv = app.test_client().open("/static/index.html", method="GET")
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/python-flask.git/commitdiff/bd3097fa97dfd473bd8089b212d46ce278a0689f



More information about the pld-cvs-commit mailing list