[packages/python3-numpy] - up to 2.2.3
baggins
baggins at pld-linux.org
Tue Mar 11 20:48:50 CET 2025
commit 5184a48c6a334f80cb3f1d999dc4f97ccd396096
Author: Jan Rękorajski <baggins at pld-linux.org>
Date: Tue Mar 11 21:36:56 2025 +0100
- up to 2.2.3
bpo-45167.patch | 59 -------------------------
python3-numpy.spec | 124 +++++++++++++++++------------------------------------
2 files changed, 39 insertions(+), 144 deletions(-)
---
diff --git a/python3-numpy.spec b/python3-numpy.spec
index 47b64ba..862d758 100644
--- a/python3-numpy.spec
+++ b/python3-numpy.spec
@@ -1,15 +1,7 @@
-# TODO: failing tests with 32-bit ABIs:
-# - i686:
-# FAILED numpy/core/tests/test_mem_policy.py::test_new_policy - AssertionError:...
-# FAILED numpy/core/tests/test_ufunc.py::TestUfunc::test_identityless_reduction_huge_array
-# FAILED numpy/core/tests/test_umath.py::TestRemainder::test_float_remainder_overflow
-# FAILED numpy/random/tests/test_generator_mt19937.py::TestRandomDist::test_pareto
-# - x32:
-# Fatal Python error: Segmentation fault
-# File ".../BUILD/numpy-1.22.2/build/testenv/libx32/python3.10/site-packages/numpy/random/tests/test_direct.py", line 250 in test_pickle
+# TODO: how to run test suite now?
#
# Conditional build:
-%bcond_without tests # unit tests
+%bcond_with tests # unit tests
%define module numpy
Summary: Python 3.x numerical facilities
@@ -22,7 +14,7 @@ License: BSD
Group: Libraries/Python
#Source0Download: https://github.com/numpy/numpy/releases/
Source0: https://github.com/numpy/numpy/releases/download/v%{version}/%{module}-%{version}.tar.gz
-# Source0-md5: 09b3a41ea0b9bc20bd1691cf88f0b0d3
+# Source0-md5: c6ee254bcdf1e2fdb13d87e0ee4166ba
URL: https://github.com/numpy/numpy
%if "%(test -w /dev/shm ; echo $?)" != "0"
BuildRequires: WRITABLE(/dev/shm)
@@ -33,7 +25,7 @@ BuildRequires: python3-Cython >= 0.29.30
BuildRequires: python3-devel >= 1:3.10
BuildRequires: python3-build
BuildRequires: python3-installer
-BuildRequires: python3-meson # (-python?)
+BuildRequires: python3-meson-python
%if %{with tests}
BuildRequires: python3-hypothesis >= 6.24.1
#BuildRequires: python3-mypy >= 0.940
@@ -85,31 +77,27 @@ Generator interfejsów z Fortranu do Pythona 3.
%prep
%setup -q -n %{module}-%{version}
-%build
-# numpy.distutils uses CFLAGS/LDFLAGS as its own flags replacements,
-# instead of appending proper options (like -fPIC/-shared resp.)
-CFLAGS="%{rpmcflags} -fPIC"
-LDFLAGS="%{rpmldflags} -shared"
+# fix #!/usr/bin/env python -> #!/usr/bin/python:
+%{__sed} -i -e '1s,^#!.*python3,#!%{__python3},' numpy/testing/print_coercion_tables.py
+%build
%py3_build_pyproject
-%if %{with tests}
-PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
-%{__python3} runtests.py --mode=full
-%endif
-
%install
rm -rf $RPM_BUILD_ROOT
%py3_install_pyproject
+%if %{with tests}
+PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
+%{__python3} runtests.py --mode=full
+%endif
+
%{__rm} -r $RPM_BUILD_ROOT%{py3_sitedir}/%{module}/doc
%{__rm} -r $RPM_BUILD_ROOT%{py3_sitedir}/%{module}/random/_examples
%{__rm} -r $RPM_BUILD_ROOT%{py3_sitedir}/%{module}/tests
%{__rm} -r $RPM_BUILD_ROOT%{py3_sitedir}/%{module}/*/tests
-%{__rm} $RPM_BUILD_ROOT%{py3_sitedir}/%{module}/LICENSE.txt
-
-%{__rm} $RPM_BUILD_ROOT%{py3_sitedir}/%{module}/distutils/mingw/gfortran_vs2003_hack.c
+%{__rm} $RPM_BUILD_ROOT%{py3_sitedir}/%{module}/random/LICENSE.md
%clean
rm -rf $RPM_BUILD_ROOT
@@ -122,86 +110,52 @@ rm -rf $RPM_BUILD_ROOT
%{py3_sitedir}/%{module}/*.pyi
%{py3_sitedir}/%{module}/py.typed
%{py3_sitedir}/%{module}/__pycache__
-%dir %{py3_sitedir}/%{module}/array_api
-%{py3_sitedir}/%{module}/array_api/*.py
-%{py3_sitedir}/%{module}/array_api/__pycache__
-%dir %{py3_sitedir}/%{module}/compat
-%{py3_sitedir}/%{module}/compat/*.py
-%{py3_sitedir}/%{module}/compat/__pycache__
-%dir %{py3_sitedir}/%{module}/core
-%{py3_sitedir}/%{module}/core/*.py
-%{py3_sitedir}/%{module}/core/*.pyi
-%{py3_sitedir}/%{module}/core/__pycache__
-%attr(755,root,root) %{py3_sitedir}/%{module}/core/*.cpython-3*.so
-%dir %{py3_sitedir}/%{module}/distutils
-%{py3_sitedir}/%{module}/distutils/*.py
-%{py3_sitedir}/%{module}/distutils/*.pyi
-%{py3_sitedir}/%{module}/distutils/__pycache__
-%{py3_sitedir}/%{module}/distutils/checks
-%dir %{py3_sitedir}/%{module}/distutils/command
-%{py3_sitedir}/%{module}/distutils/command/*.py
-%{py3_sitedir}/%{module}/distutils/command/__pycache__
-%dir %{py3_sitedir}/%{module}/distutils/fcompiler
-%{py3_sitedir}/%{module}/distutils/fcompiler/*.py
-%{py3_sitedir}/%{module}/distutils/fcompiler/__pycache__
+%dir %{py3_sitedir}/%{module}/_core
+%{py3_sitedir}/%{module}/_core/*.py
+%{py3_sitedir}/%{module}/_core/*.pyi
+%{py3_sitedir}/%{module}/_core/__pycache__
+%attr(755,root,root) %{py3_sitedir}/%{module}/_core/*.cpython-3*.so
+%{py3_sitedir}/%{module}/_pyinstaller
+%{py3_sitedir}/%{module}/_typing
+%{py3_sitedir}/%{module}/_utils
+%{py3_sitedir}/%{module}/char
+%{py3_sitedir}/%{module}/compat
+%{py3_sitedir}/%{module}/core
%dir %{py3_sitedir}/%{module}/fft
%{py3_sitedir}/%{module}/fft/*.py
%{py3_sitedir}/%{module}/fft/*.pyi
%{py3_sitedir}/%{module}/fft/__pycache__
-%attr(755,root,root) %{py3_sitedir}/%{module}/fft/_pocketfft_internal.cpython-3*.so
-%dir %{py3_sitedir}/%{module}/lib
-%{py3_sitedir}/%{module}/lib/*.py
-%{py3_sitedir}/%{module}/lib/*.pyi
-%{py3_sitedir}/%{module}/lib/__pycache__
+%attr(755,root,root) %{py3_sitedir}/%{module}/fft/*.cpython-3*.so
+%{py3_sitedir}/%{module}/lib
%dir %{py3_sitedir}/%{module}/linalg
%{py3_sitedir}/%{module}/linalg/*.py
%{py3_sitedir}/%{module}/linalg/*.pyi
%{py3_sitedir}/%{module}/linalg/__pycache__
-%attr(755,root,root) %{py3_sitedir}/%{module}/linalg/_umath_linalg.cpython-3*.so
-%attr(755,root,root) %{py3_sitedir}/%{module}/linalg/lapack_lite.cpython-3*.so
-%dir %{py3_sitedir}/%{module}/ma
-%{py3_sitedir}/%{module}/ma/*.py
-%{py3_sitedir}/%{module}/ma/*.pyi
-%{py3_sitedir}/%{module}/ma/__pycache__
-%dir %{py3_sitedir}/%{module}/matrixlib
-%{py3_sitedir}/%{module}/matrixlib/*.py
-%{py3_sitedir}/%{module}/matrixlib/*.pyi
-%{py3_sitedir}/%{module}/matrixlib/__pycache__
-%dir %{py3_sitedir}/%{module}/polynomial
-%{py3_sitedir}/%{module}/polynomial/*.py
-%{py3_sitedir}/%{module}/polynomial/*.pyi
-%{py3_sitedir}/%{module}/polynomial/__pycache__
+%attr(755,root,root) %{py3_sitedir}/%{module}/linalg/*.cpython-3*.so
+%{py3_sitedir}/%{module}/ma
+%{py3_sitedir}/%{module}/matrixlib
+%{py3_sitedir}/%{module}/polynomial
%dir %{py3_sitedir}/%{module}/random
%{py3_sitedir}/%{module}/random/*.py
%{py3_sitedir}/%{module}/random/*.pyi
%{py3_sitedir}/%{module}/random/__pycache__
%attr(755,root,root) %{py3_sitedir}/%{module}/random/*.cpython-3*.so
-%dir %{py3_sitedir}/%{module}/testing
-%{py3_sitedir}/%{module}/testing/_private
-%{py3_sitedir}/%{module}/testing/*.py
-%{py3_sitedir}/%{module}/testing/*.pyi
-%{py3_sitedir}/%{module}/testing/__pycache__
-%dir %{py3_sitedir}/%{module}/typing
-%{py3_sitedir}/%{module}/typing/*.py
-%{py3_sitedir}/%{module}/typing/*.pyi
-%{py3_sitedir}/%{module}/typing/__pycache__
-%{py3_sitedir}/numpy-%{version}-py*.egg-info
+%{py3_sitedir}/%{module}/testing
+%{py3_sitedir}/%{module}/rec
+%{py3_sitedir}/%{module}/strings
+%{py3_sitedir}/%{module}/typing
+%{py3_sitedir}/numpy-%{version}.dist-info
%files devel
%defattr(644,root,root,755)
+%attr(755,root,root) %{_bindir}/numpy-config
%{py3_sitedir}/%{module}/*.pxd
-%{py3_sitedir}/%{module}/core/include
-%{py3_sitedir}/%{module}/core/lib
+%{py3_sitedir}/%{module}/_core/include
+%{py3_sitedir}/%{module}/_core/lib
%{py3_sitedir}/%{module}/random/*.pxd
%{py3_sitedir}/%{module}/random/lib
%files -n f2py3
%defattr(644,root,root,755)
%attr(755,root,root) %{_bindir}/f2py
-%attr(755,root,root) %{_bindir}/f2py3
-%attr(755,root,root) %{_bindir}/f2py%{py3_ver}
-%dir %{py3_sitedir}/%{module}/f2py
-%{py3_sitedir}/%{module}/f2py/*.py
-%{py3_sitedir}/%{module}/f2py/*.pyi
-%{py3_sitedir}/%{module}/f2py/__pycache__
-%{py3_sitedir}/%{module}/f2py/src
+%{py3_sitedir}/%{module}/f2py
diff --git a/bpo-45167.patch b/bpo-45167.patch
deleted file mode 100644
index 7c099e0..0000000
--- a/bpo-45167.patch
+++ /dev/null
@@ -1,59 +0,0 @@
-From 8871c7285fc097fd1bf713aa184cba7e2804f625 Mon Sep 17 00:00:00 2001
-From: Bas van Beek <b.f.van.beek at vu.nl>
-Date: Wed, 10 Nov 2021 15:36:00 +0100
-Subject: [PATCH] MAINT: Do not forward `__(deep)copy__` calls of
- `_GenericAlias` to the wrapped type
-
-Adapt to the python 3.9.8 changes made in bpo-45167.
----
- numpy/typing/_generic_alias.py | 2 ++
- numpy/typing/tests/test_generic_alias.py | 16 ++++++++++++++++
- 2 files changed, 18 insertions(+)
-
-diff --git a/numpy/typing/_generic_alias.py b/numpy/typing/_generic_alias.py
-index 932f12dd05d..1eb2c8c05f0 100644
---- a/numpy/typing/_generic_alias.py
-+++ b/numpy/typing/_generic_alias.py
-@@ -185,6 +185,8 @@ def __eq__(self, value: object) -> bool:
- "__mro_entries__",
- "__reduce__",
- "__reduce_ex__",
-+ "__copy__",
-+ "__deepcopy__",
- })
-
- def __getattribute__(self, name: str) -> Any:
-diff --git a/numpy/typing/tests/test_generic_alias.py b/numpy/typing/tests/test_generic_alias.py
-index 3021d985934..39343420bdc 100644
---- a/numpy/typing/tests/test_generic_alias.py
-+++ b/numpy/typing/tests/test_generic_alias.py
-@@ -1,6 +1,7 @@
- from __future__ import annotations
-
- import sys
-+import copy
- import types
- import pickle
- import weakref
-@@ -80,6 +81,21 @@ def test_pass(self, name: str, func: FuncType) -> None:
- value_ref = func(NDArray_ref)
- assert value == value_ref
-
-+ @pytest.mark.parametrize("name,func", [
-+ ("__copy__", lambda n: n == copy.copy(n)),
-+ ("__deepcopy__", lambda n: n == copy.deepcopy(n)),
-+ ])
-+ def test_copy(self, name: str, func: FuncType) -> None:
-+ value = func(NDArray)
-+
-+ # xref bpo-45167
-+ GE_398 = (
-+ sys.version_info[:2] == (3, 9) and sys.version_info >= (3, 9, 8)
-+ )
-+ if GE_398 or sys.version_info >= (3, 10, 1):
-+ value_ref = func(NDArray_ref)
-+ assert value == value_ref
-+
- def test_weakref(self) -> None:
- """Test ``__weakref__``."""
- value = weakref.ref(NDArray)()
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/python3-numpy.git/commitdiff/5184a48c6a334f80cb3f1d999dc4f97ccd396096
More information about the pld-cvs-commit
mailing list