From 84921b906f88c0344b59a4754c0901ef7b6c5aa6c403bceec0a9a89fc15a0ef6 Mon Sep 17 00:00:00 2001 From: Steve Kowalik Date: Mon, 5 Feb 2024 04:36:05 +0000 Subject: [PATCH] - Add patch support-python312.patch: * Fix the test script to support Python 3.12. - Use fdupes. - Switch to autosetup macro. OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-bsddb3?expand=0&rev=39 --- python-bsddb3.changes | 8 ++++++++ python-bsddb3.spec | 8 ++++---- support-python312.patch | 23 +++++++++++++++++++++++ 3 files changed, 35 insertions(+), 4 deletions(-) create mode 100644 support-python312.patch diff --git a/python-bsddb3.changes b/python-bsddb3.changes index 95e46ef..7e5e9b8 100644 --- a/python-bsddb3.changes +++ b/python-bsddb3.changes @@ -1,3 +1,11 @@ +------------------------------------------------------------------- +Mon Feb 5 04:35:19 UTC 2024 - Steve Kowalik + +- Add patch support-python312.patch: + * Fix the test script to support Python 3.12. +- Use fdupes. +- Switch to autosetup macro. + ------------------------------------------------------------------- Mon Jan 15 20:37:12 UTC 2024 - Dirk Müller diff --git a/python-bsddb3.spec b/python-bsddb3.spec index 2ac95e1..121c8a0 100644 --- a/python-bsddb3.spec +++ b/python-bsddb3.spec @@ -16,21 +16,21 @@ # -%{?!python_module:%define python_module() python-%{**} python3-%{**}} Name: python-bsddb3 Version: 6.2.9 Release: 0 Summary: Python interface for Berkeley DB License: BSD-3-Clause -Group: Development/Libraries/Python URL: http://pypi.python.org/pypi/bsddb3 #Freecode-URL: https://www.jcea.es/programacion/pybsddb.htm Source: https://files.pythonhosted.org/packages/source/b/bsddb3/bsddb3-%{version}.tar.gz +Patch0: support-python312.patch BuildRequires: %{python_module devel} BuildRequires: %{python_module pip} BuildRequires: %{python_module setuptools} BuildRequires: %{python_module wheel} BuildRequires: db-devel +BuildRequires: fdupes BuildRequires: python-rpm-macros BuildRequires: python3-testsuite %python_subpackages @@ -43,7 +43,6 @@ bsddb3.db module. %package devel Summary: Development files for %{name} -Group: Development/Libraries/Python Requires: %{name} = %{version} %description devel @@ -55,7 +54,7 @@ bsddb3.db module. This package contains the development files for %{name} %prep -%setup -q -n bsddb3-%{version} +%autosetup -p1 -n bsddb3-%{version} sed -i "1d" Lib/bsddb/dbshelve.py # Fix non-executable bits %build @@ -64,6 +63,7 @@ export CFLAGS="%{optflags} -fno-strict-aliasing" %install %pyproject_install +%python_expand %fdupes %{buildroot}%{$python_sitearch} %python_expand rm -rf %{buildroot}%{$python_sitearch}/bsddb3/tests %check diff --git a/support-python312.patch b/support-python312.patch new file mode 100644 index 0000000..4aae535 --- /dev/null +++ b/support-python312.patch @@ -0,0 +1,23 @@ +Index: bsddb3-6.2.9/test3.py +=================================================================== +--- bsddb3-6.2.9.orig/test3.py ++++ bsddb3-6.2.9/test3.py +@@ -152,13 +152,13 @@ try : # Check in the future if this sti + # Python 2.7 and 3.2 + from unittest.runner import _TextTestResult + except ImportError : +- from unittest import _TextTestResult ++ from unittest import TextTestResult + +-class ImmediateTestResult(_TextTestResult): ++class ImmediateTestResult(TextTestResult): + +- __super_init = _TextTestResult.__init__ +- __super_startTest = _TextTestResult.startTest +- __super_printErrors = _TextTestResult.printErrors ++ __super_init = TextTestResult.__init__ ++ __super_startTest = TextTestResult.startTest ++ __super_printErrors = TextTestResult.printErrors + + def __init__(self, stream, descriptions, verbosity, debug=False, + count=None, progress=False):