[packages/python3-numpy] - added deprecated patch (disable usage of deprecated distutils code)

qboosh qboosh at pld-linux.org
Sat Sep 3 08:36:09 CEST 2022


commit fda4872cd70b476d113eb19cabe3b9c2a4079ff7
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date:   Sat Sep 3 08:36:10 2022 +0200

    - added deprecated patch (disable usage of deprecated distutils code)

 python3-numpy-deprecated.patch | 39 +++++++++++++++++++++++++++++++++++++++
 python3-numpy.spec             |  2 ++
 2 files changed, 41 insertions(+)
---
diff --git a/python3-numpy.spec b/python3-numpy.spec
index b8394ac..eb8a034 100644
--- a/python3-numpy.spec
+++ b/python3-numpy.spec
@@ -14,6 +14,7 @@ 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:	5b506b01ef454f39272ca75de1c7f61c
+Patch0:		%{name}-deprecated.patch
 URL:		https://github.com/numpy/numpy
 BuildRequires:	gcc-fortran
 BuildRequires:	lapack-devel >= 3.1.1-2
@@ -67,6 +68,7 @@ Generator interfejsów z Fortranu do Pythona 3.
 
 %prep
 %setup -q -n %{module}-%{version}
+%patch0 -p1
 
 %build
 # numpy.distutils uses CFLAGS/LDFLAGS as its own flags replacements,
diff --git a/python3-numpy-deprecated.patch b/python3-numpy-deprecated.patch
new file mode 100644
index 0000000..b3e827c
--- /dev/null
+++ b/python3-numpy-deprecated.patch
@@ -0,0 +1,39 @@
+--- numpy-1.22.4/numpy/random/tests/test_extending.py.orig	2022-05-20 15:46:11.022547000 +0200
++++ numpy-1.22.4/numpy/random/tests/test_extending.py	2022-09-02 21:05:39.227962995 +0200
+@@ -30,16 +30,6 @@ try:
+     from Cython.Compiler.Version import version as cython_version
+ except ImportError:
+     cython = None
+-else:
+-    from distutils.version import LooseVersion
+-    # Cython 0.29.21 is required for Python 3.9 and there are
+-    # other fixes in the 0.29 series that are needed even for earlier
+-    # Python versions.
+-    # Note: keep in sync with the one in pyproject.toml
+-    required_version = LooseVersion('0.29.21')
+-    if LooseVersion(cython_version) < required_version:
+-        # too old or wrong cython, skip the test
+-        cython = None
+ 
+ @pytest.mark.skipif(cython is None, reason="requires cython")
+ @pytest.mark.slow
+--- numpy-1.22.4/numpy/core/tests/test_cython.py.orig	2022-05-20 15:46:10.990547200 +0200
++++ numpy-1.22.4/numpy/core/tests/test_cython.py	2022-09-02 21:02:27.667878264 +0200
+@@ -12,17 +12,6 @@ try:
+     from Cython.Compiler.Version import version as cython_version
+ except ImportError:
+     cython = None
+-else:
+-    from distutils.version import LooseVersion
+-
+-    # Cython 0.29.21 is required for Python 3.9 and there are
+-    # other fixes in the 0.29 series that are needed even for earlier
+-    # Python versions.
+-    # Note: keep in sync with the one in pyproject.toml
+-    required_version = LooseVersion("0.29.21")
+-    if LooseVersion(cython_version) < required_version:
+-        # too old or wrong cython, skip the test
+-        cython = None
+ 
+ pytestmark = pytest.mark.skipif(cython is None, reason="requires cython")
+ 
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/python3-numpy.git/commitdiff/fda4872cd70b476d113eb19cabe3b9c2a4079ff7



More information about the pld-cvs-commit mailing list