diff --git a/f2py_test.patch b/f2py_test.patch new file mode 100644 index 0000000000000000000000000000000000000000..51c35c8851cf4e464efab52095d7ce2aa747040d --- /dev/null +++ b/f2py_test.patch @@ -0,0 +1,15 @@ +diff --git c/numpy/f2py/tests/test_compile_function.py i/numpy/f2py/tests/test_compile_function.py +index 3c16f3198..e38fed898 100644 +--- c/numpy/f2py/tests/test_compile_function.py ++++ i/numpy/f2py/tests/test_compile_function.py +@@ -17,6 +17,10 @@ def setup_module(): + pytest.skip("Needs C compiler") + if not util.has_f77_compiler(): + pytest.skip("Needs FORTRAN 77 compiler") ++ if sys.version_info[:2] >= (3, 12): ++ pytest.skip( ++ "F2PY compilation tests do not work with meson." ++ ) + + + # extra_args can be a list (since gh-11937) or string. diff --git a/numpy.spec b/numpy.spec index 1c0f89b02c21505eaf8e7598091c01abd788e793..174a4cd45596c0047bea560dec617129b44ce0a4 100644 --- a/numpy.spec +++ b/numpy.spec @@ -1,4 +1,4 @@ -%define anolis_release 2 +%define anolis_release 3 %bcond_with tests %global blaslib flexiblas @@ -6,16 +6,18 @@ Name: numpy Summary: A fast multidimensional array facility for Python -Version: 1.26.4 +Version: 1.26.4 Release: %{anolis_release}%{?dist} Epoch: 1 License: BSD and Python and ASL 2.0 URL: http://www.%{name}.org/ -Source0: https://github.com/%{name}/%{name}/releases/download/v%{version}/%{name}-%{version}.tar.gz -Source1: https://%{name}.org/doc/1.24/%{name}-html.zip +Source0: https://github.com/numpy/numpy/releases/download/v1.26.4/numpy-1.26.4.tar.gz +Source1: https://numpy.org/doc/1.26/numpy-html.zip Patch0001: 0001-Add-sw_64-support.patch +Patch2: f2py_test.patch +Patch3: replace-deprecated-ctypes.ARRAY.patch %description NumPy is a community-driven open source project developed by @@ -40,6 +42,11 @@ BuildRequires: python3-meson-python BuildRequires: python3-devel python3-setuptools lapack-devel %{blaslib}-devel python3-Cython >= 0.29.30 %if %{with tests} BuildRequires: python3-pytest python3-hypothesis python3-test python3-typing-extensions +BuildRequires: openblas-devel +BuildRequires: python3-hypothesis +BuildRequires: python3-pytest +BuildRequires: python3-test +BuildRequires: python3-typing-extensions %endif %description -n python3-numpy @@ -169,6 +176,8 @@ python3 runtests.py \ %doc docs/* THANKS.* site.cfg.example %changelog +* Thu Sep 18 2025 wenyuzifang - 1:1.26.4-3 +- Skip failing F2PY tests on Python 3.12+ to prevent CI breakage during Meson transition * Wed Apr 23 2025 Chunchao Zhang - 1.26.4-2 - Add sw_64 support diff --git a/replace-deprecated-ctypes.ARRAY.patch b/replace-deprecated-ctypes.ARRAY.patch new file mode 100644 index 0000000000000000000000000000000000000000..53330f93a9b067d52338a9b289371a6bc950385b --- /dev/null +++ b/replace-deprecated-ctypes.ARRAY.patch @@ -0,0 +1,28 @@ +From d9155244ea06705ebd9194cc7a621e82316b61ba Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= +Date: Mon, 20 Nov 2023 11:36:36 +0100 +Subject: [PATCH] MAINT: Replace deprecated ctypes.ARRAY(item_type, size) with + item_type * size + +See https://github.com/python/cpython/issues/105733 +--- + numpy/core/tests/test_ufunc.py | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/numpy/core/tests/test_ufunc.py b/numpy/core/tests/test_ufunc.py +index a7401ff616f..fc1fd5af169 100644 +--- a/numpy/core/tests/test_ufunc.py ++++ b/numpy/core/tests/test_ufunc.py +@@ -2985,9 +2985,9 @@ def test_resolve_dtypes_reduction_errors(self): + reason="`ctypes.pythonapi` required for capsule unpacking.") + def test_loop_access(self): + # This is a basic test for the full strided loop access +- data_t = ct.ARRAY(ct.c_char_p, 2) +- dim_t = ct.ARRAY(ct.c_ssize_t, 1) +- strides_t = ct.ARRAY(ct.c_ssize_t, 2) ++ data_t = ct.c_char_p * 2 ++ dim_t = ct.c_ssize_t * 1 ++ strides_t = ct.c_ssize_t * 2 + strided_loop_t = ct.CFUNCTYPE( + ct.c_int, ct.c_void_p, data_t, dim_t, strides_t, ct.c_void_p) +