From e87f1e34b74c6f6b18347ce87dbb68e715b10bf30f044c55fba021b4c2306c3f Mon Sep 17 00:00:00 2001 From: Daniel Garcia Date: Fri, 22 Mar 2024 06:41:54 +0000 Subject: [PATCH 1/2] - Add python312.patch and build for python 3.12 gh#Pylons/paginate#19 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-paginate?expand=0&rev=5 --- python-paginate.spec | 3 ++- python312.patch | 13 +++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 python312.patch diff --git a/python-paginate.spec b/python-paginate.spec index e5825be..ae4f9c3 100644 --- a/python-paginate.spec +++ b/python-paginate.spec @@ -17,7 +17,6 @@ %{?sle15_python_module_pythons} -%global skip_python312 1 Name: python-paginate Version: 0.5.6 Release: 0 @@ -26,6 +25,8 @@ License: MIT URL: https://github.com/Signum/paginate # PyPI tarball does not include tests... Source: https://github.com/Signum/paginate/archive/%{version}.tar.gz#/paginate-%{version}.tar.gz +# PATCH-FIX-OPENSUSE python312.patch gh#Pylons/paginate#19 +Patch0: python312.patch BuildRequires: %{python_module pip} BuildRequires: %{python_module setuptools} BuildRequires: %{python_module wheel} diff --git a/python312.patch b/python312.patch new file mode 100644 index 0000000..a31cc68 --- /dev/null +++ b/python312.patch @@ -0,0 +1,13 @@ +Index: paginate-0.5.6/paginate/__init__.py +=================================================================== +--- paginate-0.5.6.orig/paginate/__init__.py ++++ paginate-0.5.6/paginate/__init__.py +@@ -250,7 +250,7 @@ class Page(list): + first = (self.page - 1) * items_per_page + last = first + items_per_page + self.items = list(self.collection[first:last]) +- except TypeError: ++ except (TypeError, KeyError): + raise TypeError("Your collection of type {} cannot be handled " + "by paginate.".format(type(self.collection))) + From 6f634f703c9bf19cae488c1e84c0c620914b2327048ba3f013f1b7cc097dd7f8 Mon Sep 17 00:00:00 2001 From: Daniel Garcia Date: Fri, 22 Mar 2024 06:42:29 +0000 Subject: [PATCH 2/2] - Add python312.patch and build for python 3.12 gh#Pylons/paginate#19 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-paginate?expand=0&rev=6 --- python-paginate.changes | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/python-paginate.changes b/python-paginate.changes index e888730..ae31203 100644 --- a/python-paginate.changes +++ b/python-paginate.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Fri Mar 22 06:42:18 UTC 2024 - Daniel Garcia + +- Add python312.patch and build for python 3.12 + gh#Pylons/paginate#19 + ------------------------------------------------------------------- Wed Feb 7 08:48:25 UTC 2024 - Dirk Müller