Accepting request 1225807 from devel:languages:python:numeric

- add py313-support.patch to fix build with python 3.13

OBS-URL: https://build.opensuse.org/request/show/1225807
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-biopython?expand=0&rev=14
This commit is contained in:
Ana Guerrero 2024-11-22 22:53:13 +00:00 committed by Git OBS Bridge
commit 437b5f02fb
3 changed files with 34 additions and 4 deletions

26
py313-support.patch Normal file
View File

@ -0,0 +1,26 @@
From 22ebf951e736bd44f04e3552a4a39723ccb3c219 Mon Sep 17 00:00:00 2001
From: Sandro <devel@penguinpee.nl>
Date: Fri, 19 Apr 2024 14:41:38 +0200
Subject: [PATCH] Python 3.13: Replace deprecated PyEval_CallObject()
The function has been deprecated since Python 3.9 and will be removed
from Python 3.13.
See: https://docs.python.org/3.13/whatsnew/3.13.html#id9
---
Bio/cpairwise2module.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Bio/cpairwise2module.c b/Bio/cpairwise2module.c
index af7843ed4bc..ada6663ccd5 100644
--- a/Bio/cpairwise2module.c
+++ b/Bio/cpairwise2module.c
@@ -57,7 +57,7 @@ static double _get_match_score(PyObject *py_sequenceA, PyObject *py_sequenceB,
if(!(py_arglist = Py_BuildValue("(OO)", py_A, py_B)))
goto _get_match_score_cleanup;
- if(!(py_result = PyEval_CallObject(py_match_fn, py_arglist)))
+ if(!(py_result = PyObject_CallObject(py_match_fn, py_arglist)))
goto _get_match_score_cleanup;
score = PyFloat_AsDouble(py_result);

View File

@ -1,3 +1,8 @@
-------------------------------------------------------------------
Fri Nov 22 12:13:40 UTC 2024 - Dirk Müller <dmueller@suse.com>
- add py313-support.patch to fix build with python 3.13
-------------------------------------------------------------------
Thu Oct 10 15:36:36 UTC 2024 - Dirk Müller <dmueller@suse.com>

View File

@ -16,11 +16,9 @@
#
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
# Tests require a network connection
%bcond_with test
%define skip_python2 1
%define skip_python36 1
%{?sle15_python_module_pythons}
Name: python-biopython
Version: 1.84
Release: 0
@ -29,6 +27,7 @@ License: BSD-3-Clause AND MIT
URL: https://biopython.org/
Source0: https://files.pythonhosted.org/packages/source/b/biopython/biopython-%{version}.tar.gz
Source100: python-biopython-rpmlintrc
Patch1: https://github.com/biopython/biopython/commit/22ebf951e736bd44f04e3552a4a39723ccb3c219.patch#/py313-support.patch
BuildRequires: %{python_module devel}
BuildRequires: %{python_module numpy-devel}
BuildRequires: %{python_module setuptools}
@ -53,7 +52,7 @@ The Biopython Project is an international association of developers of freely
available Python tools for computational molecular biology.
%prep
%setup -q -n biopython-%{version}
%autosetup -p1 -n biopython-%{version}
find -type f -name "*.py" -exec sed -i '/^#![ ]*\/usr\/bin\/.*$/ d' {} 2>/dev/null ';'
# Example scripts cannot be in a subdirectory
mv -v Doc/examples examples