From 01420e3406723f234bba18765fd0a645f14f9e0c Mon Sep 17 00:00:00 2001 From: desert-sailor Date: Tue, 17 Jun 2025 13:26:39 +0800 Subject: [PATCH] Fix build error for setuptools upgrade --- ...-fix-build-error-with-new-setuptools.patch | 31 +++++++++++++++++++ numpy.spec | 6 +++- 2 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 0001-fix-build-error-with-new-setuptools.patch diff --git a/0001-fix-build-error-with-new-setuptools.patch b/0001-fix-build-error-with-new-setuptools.patch new file mode 100644 index 0000000..6decaf2 --- /dev/null +++ b/0001-fix-build-error-with-new-setuptools.patch @@ -0,0 +1,31 @@ +From 12fb7f3d5b70b870cfd16e4ff4fc30a00e3c6fa3 Mon Sep 17 00:00:00 2001 +From: desert-sailor +Date: Tue, 17 Jun 2025 13:23:46 +0800 +Subject: [PATCH] fix build error with new setuptools + +--- + numpy/distutils/mingw32ccompiler.py | 8 +++++++- + 1 file changed, 7 insertions(+), 1 deletion(-) + +diff --git a/numpy/distutils/mingw32ccompiler.py b/numpy/distutils/mingw32ccompiler.py +index 4763f41..ac0c206 100644 +--- a/numpy/distutils/mingw32ccompiler.py ++++ b/numpy/distutils/mingw32ccompiler.py +@@ -24,7 +24,13 @@ + + import distutils.cygwinccompiler + from distutils.unixccompiler import UnixCCompiler +-from distutils.msvccompiler import get_build_version as get_build_msvc_version ++ ++try: ++ from distutils.msvccompiler import get_build_version as get_build_msvc_version ++except ImportError: ++ def get_build_msvc_version(): ++ return None ++ + from distutils.errors import UnknownFileError + from numpy.distutils.misc_util import (msvc_runtime_library, + msvc_runtime_version, +-- +2.43.0 + diff --git a/numpy.spec b/numpy.spec index 787ace5..9e3debe 100644 --- a/numpy.spec +++ b/numpy.spec @@ -2,13 +2,14 @@ Name: numpy Version: 1.26.4 -Release: 1 +Release: 2 Epoch: 1 Summary: A fast multidimensional array facility for Python License: ASL 2.0 URL: http://www.numpy.org/ Source0: https://github.com/%{name}/%{name}/releases/download/v%{version}/%{name}-%{version}.tar.gz +Patch1: 0001-fix-build-error-with-new-setuptools.patch BuildRequires: openblas-devel BuildRequires: lapack-devel gcc-gfortran @@ -107,6 +108,9 @@ popd &> /dev/null %exclude %{python3_sitearch}/%{name}/f2py/tests/ %changelog +* Tue Jun 17 2025 Dongxing Wang - 1:1.26.4-2 +- Fix build error for setuptools upgrade + * Fri Nov 29 2024 zhang_wenyu1 - 1:1.26.4-1 - Update to 1.26.4 -- Gitee