Accepting request 1299345 from home:mcalabkova:branches:devel:languages:python:numeric

- Add upstream np-fromstring.patch to fix tests with NumPy 2.3

OBS-URL: https://build.opensuse.org/request/show/1299345
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:numeric/python-pythran?expand=0&rev=65
This commit is contained in:
2025-08-14 08:42:32 +00:00
committed by Git OBS Bridge
parent 60b8631def
commit adcede641b
3 changed files with 38 additions and 0 deletions

31
np-fromstring.patch Normal file
View File

@@ -0,0 +1,31 @@
From 2e4da862478a2c5b026a9066771da4dcd34a144b Mon Sep 17 00:00:00 2001
From: serge-sans-paille <serge.guelton@telecom-bretagne.eu>
Date: Sun, 8 Jun 2025 19:15:28 +0200
Subject: [PATCH] Do not test binary mode of numpy.fromstring for recent numpy
version
It's no longer supported as of numpy 2.3, see
https://numpy.org/devdocs/release/2.3.0-notes.html and
https://github.com/numpy/numpy/pull/28254
Fix #2322
---
pythran/tests/test_numpy_func0.py | 2 ++
1 file changed, 2 insertions(+)
diff --git a/pythran/tests/test_numpy_func0.py b/pythran/tests/test_numpy_func0.py
index a97a43c50..91c37e979 100644
--- a/pythran/tests/test_numpy_func0.py
+++ b/pythran/tests/test_numpy_func0.py
@@ -553,9 +553,11 @@ def test_fromfile5(self):
finally:
os.remove(temp_name)
+ @unittest.skipIf(np_version > version.Version("2.2"), reason="np.fromstring no longer supports binary mode")
def test_fromstring0(self):
self.run_test("def np_fromstring0(a): from numpy import fromstring, uint8 ; return fromstring(a, uint8)", '\x01\x02', np_fromstring0=[str])
+ @unittest.skipIf(np_version > version.Version("2.2"), reason="np.fromstring no longer supports binary mode")
def test_fromstring1(self):
self.run_test("def np_fromstring1(a): from numpy import fromstring, uint8 ; a = '\x01\x02\x03\x04' ; return fromstring(a, uint8,3)", '\x01\x02\x03\x04', np_fromstring1=[str])

View File

@@ -1,3 +1,8 @@
-------------------------------------------------------------------
Thu Aug 14 08:37:43 UTC 2025 - Markéta Machová <mmachova@suse.com>
- Add upstream np-fromstring.patch to fix tests with NumPy 2.3
-------------------------------------------------------------------
Mon Jul 7 18:31:44 UTC 2025 - Ben Greiner <code@bnavigator.de>

View File

@@ -56,6 +56,8 @@ Source99: python-pythran-rpmlintrc
Patch0: GCC15_fix_Add-missing-operators-to-nditerator.patch
# PATCH-FIX-UPSTREAM: https://github.com/serge-sans-paille/pythran/commit/623fa5031df7ec5c3dfe6789bf608cf11ac95c36
Patch1: GCC15_pythran-PR2325-missing-operators.patch
# PATCH-FIX-UPSTREAM https://github.com/serge-sans-paille/pythran/commit/2e4da862478a2c5b026a9066771da4dcd34a144b Do not test binary mode of numpy.fromstring for recent numpy version
Patch2: np-fromstring.patch
BuildRequires: %{python_module pip}
BuildRequires: %{python_module setuptools}
BuildRequires: %{python_module wheel}