diff --git a/np-fromstring.patch b/np-fromstring.patch new file mode 100644 index 0000000..9ea61d4 --- /dev/null +++ b/np-fromstring.patch @@ -0,0 +1,31 @@ +From 2e4da862478a2c5b026a9066771da4dcd34a144b Mon Sep 17 00:00:00 2001 +From: serge-sans-paille +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]) + diff --git a/python-pythran.changes b/python-pythran.changes index fafca93..9dfe811 100644 --- a/python-pythran.changes +++ b/python-pythran.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Thu Aug 14 08:37:43 UTC 2025 - Markéta Machová + +- Add upstream np-fromstring.patch to fix tests with NumPy 2.3 + ------------------------------------------------------------------- Mon Jul 7 18:31:44 UTC 2025 - Ben Greiner diff --git a/python-pythran.spec b/python-pythran.spec index de86c7d..f47df4e 100644 --- a/python-pythran.spec +++ b/python-pythran.spec @@ -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}