From 089588cb14388849068ed882863b366358b823e57a08fe6f5d9bf489bc7a6e7d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrian=20Schr=C3=B6ter?= Date: Wed, 4 Dec 2024 09:23:16 +0100 Subject: [PATCH] Sync from SUSE:SLFO:Main python-numpy revision f052e529610b1e7c18602104163d09ce --- ignore-pkg_resources-deprecation.patch | 12 - numpy-1.25.2.tar.gz | 3 - numpy-1.9.0-remove-__declspec.patch | 28 -- numpy-2.1.2.tar.gz | 3 + python-numpy-rpmlintrc | 11 +- python-numpy.changes | 391 +++++++++++++++++++++++++ python-numpy.spec | 118 ++++---- 7 files changed, 469 insertions(+), 97 deletions(-) delete mode 100644 ignore-pkg_resources-deprecation.patch delete mode 100644 numpy-1.25.2.tar.gz delete mode 100644 numpy-1.9.0-remove-__declspec.patch create mode 100644 numpy-2.1.2.tar.gz diff --git a/ignore-pkg_resources-deprecation.patch b/ignore-pkg_resources-deprecation.patch deleted file mode 100644 index d705897..0000000 --- a/ignore-pkg_resources-deprecation.patch +++ /dev/null @@ -1,12 +0,0 @@ -Index: numpy-1.24.2/pytest.ini -=================================================================== ---- numpy-1.24.2.orig/pytest.ini -+++ numpy-1.24.2/pytest.ini -@@ -25,5 +25,7 @@ filterwarnings = - # Ignore DeprecationWarnings from distutils - ignore::DeprecationWarning:.*distutils - ignore:\n\n `numpy.distutils`:DeprecationWarning -+# Ignore DeprecationWarning from pkg_resources -+ ignore:pkg_resources:DeprecationWarning - # Ignore mypy >= 0.971 DeprecationWarnings - ignore:path is deprecated\. Use files\(\) instead:DeprecationWarning:mypy diff --git a/numpy-1.25.2.tar.gz b/numpy-1.25.2.tar.gz deleted file mode 100644 index 985add9..0000000 --- a/numpy-1.25.2.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:fd608e19c8d7c55021dffd43bfe5492fab8cc105cc8986f813f8c3c048b38760 -size 10805282 diff --git a/numpy-1.9.0-remove-__declspec.patch b/numpy-1.9.0-remove-__declspec.patch deleted file mode 100644 index 2af8228..0000000 --- a/numpy-1.9.0-remove-__declspec.patch +++ /dev/null @@ -1,28 +0,0 @@ -From: toddrme2178@gmail.com -Date: 2014-09-09 04:45:00 +0000 -Subject: Remove windows-specific function -Upstream: openSUSE Fix -References: - http://lists.opensuse.org/opensuse-packaging/2014-09/msg00004.html - http://lists.opensuse.org/opensuse-packaging/2014-09/msg00005.html - -__declspec(thread) is a windows-specific function that is causing -spurious compiler warnings. These warnings can be safely ignored, -but are being falsely flagged as serious problems that cause the -build to fail. Since this is windows-specific, it can be -safely removed. - - -Index: numpy-1.24.0/numpy/core/setup_common.py -=================================================================== ---- numpy-1.24.0.orig/numpy/core/setup_common.py -+++ numpy-1.24.0/numpy/core/setup_common.py -@@ -141,7 +141,7 @@ OPTIONAL_FILE_FUNCS = ["ftello", "fseeko - OPTIONAL_MISC_FUNCS = ["backtrace", "madvise"] - - # variable attributes tested via "int %s a" % attribute --OPTIONAL_VARIABLE_ATTRIBUTES = ["__thread", "__declspec(thread)"] -+OPTIONAL_VARIABLE_ATTRIBUTES = ["__thread"] - - # Subset of OPTIONAL_*_FUNCS which may already have HAVE_* defined by Python.h - OPTIONAL_FUNCS_MAYBE = [ diff --git a/numpy-2.1.2.tar.gz b/numpy-2.1.2.tar.gz new file mode 100644 index 0000000..893b9a9 --- /dev/null +++ b/numpy-2.1.2.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:13532a088217fa624c99b843eeb54640de23b3414b14aa66d023805eb731066c +size 18878063 diff --git a/python-numpy-rpmlintrc b/python-numpy-rpmlintrc index ba645aa..673212c 100644 --- a/python-numpy-rpmlintrc +++ b/python-numpy-rpmlintrc @@ -1,6 +1,7 @@ # These files are required for testing (and testing the package on a live system) -addFilter("devel-file-in-non-devel-package.*numpy/f2py/tests/src/array_from_pyobj/wrapmodule.c") -addFilter("devel-file-in-non-devel-package.*numpy/core/tests/examples") -addFilter("devel-file-in-non-devel-package.*numpy/core/tests/data") -addFilter("hidden-file-or-dir .*/numpy/f2py/tests/src/assumed_shape/.f2py_f2cmap") -addFilter("hidden-file-or-dir .*/numpy/f2py/tests/src/f2cmap/.f2py_f2cmap") +addFilter("devel-file-in-non-devel-package .*numpy/f2py/tests/src/array_from_pyobj/wrapmodule.c") +addFilter("devel-file-in-non-devel-package .*numpy/_core/tests/examples") +addFilter("devel-file-in-non-devel-package .*numpy/_core/tests/data") +addFilter("hidden-file-or-dir .*numpy/f2py/tests/src/assumed_shape/.f2py_f2cmap") +addFilter("hidden-file-or-dir .*numpy/f2py/tests/src/f2cmap/.f2py_f2cmap") +addFilter("zero-length .*numpy/core/__init__.pyi") diff --git a/python-numpy.changes b/python-numpy.changes index 81f4d10..71b7a3c 100644 --- a/python-numpy.changes +++ b/python-numpy.changes @@ -1,3 +1,394 @@ +------------------------------------------------------------------- +Thu Oct 24 12:21:00 UTC 2024 - Daniel Garcia + +- Build with latest gcc for Leap 16.0 + +------------------------------------------------------------------- +Mon Oct 21 06:52:58 UTC 2024 - Richard Rahl + +- update to 2.1.2 + * #27333: MAINT: prepare 2.1.x for further development + * #27400: BUG: apply critical sections around populating the dispatch cache + * #27406: BUG: Stub out get_build_msvc_version if distutils.msvccompiler... + * #27416: BUILD: fix missing include for std::ptrdiff_t for C++23 language... + * #27433: BLD: pin setuptools to avoid breaking numpy.distutils + * #27437: BUG: Allow unsigned shift argument for np.roll + * #27439: BUG: Disable SVE VQSort + * #27471: BUG: rfftn axis bug + * #27479: BUG: Fix extra decref of PyArray_UInt8DType. + * #27480: CI: use PyPI not scientific-python-nightly-wheels for CI doc... + * #27481: MAINT: Check for SVE support on demand + * #27484: BUG: initialize the promotion state to be weak + * #27501: MAINT: Bump pypa/cibuildwheel from 2.20.0 to 2.21.2 + * #27506: BUG: avoid segfault on bad arguments in ndarray.__array_function__ + +------------------------------------------------------------------- +Fri Sep 6 18:35:18 UTC 2024 - Ben Greiner + +- Update to 2.1.1 + * #27259: BUG: revert unintended change in the return value of + set_printoptions + * #27266: BUG: fix reference counting bug in __array_interface__ + implementation... + * #27267: TST: Add regression test for missing descr in + array-interface + * #27276: BUG: Fix #27256 and #27257 + * #27278: BUG: Fix array_equal for numeric and non-numeric scalar + types + * #27304: BUG: f2py: better handle filtering of public/private + subroutines + +------------------------------------------------------------------- +Sat Aug 31 09:36:14 UTC 2024 - Ben Greiner + +- Update to 2.1.0 + * Support for Python 3.13. + * Preliminary support for free threaded Python 3.13. + * Support for the array-api 2023.12 standard. + ## New functions + * A new function np.unstack(array, axis=...) was added, which + splits an array into a tuple of arrays along an axis. It serves + as the inverse of numpy.stack. (gh-26579) + ## Deprecations + * The fix_imports keyword argument in numpy.save is deprecated. + Since NumPy 1.17, numpy.save uses a pickle protocol that no + longer supports Python 2, and ignored fix_imports keyword. This + keyword is kept only for backward compatibility. It is now + deprecated. (gh-26452) + * Passing non-integer inputs as the first argument of bincount is + now deprecated, because such inputs are silently cast to + integers with no warning about loss of precision. (gh-27076) + ## Expired deprecations + * Scalars and 0D arrays are disallowed for numpy.nonzero and + numpy.ndarray.nonzero. (gh-26268) + * set_string_function internal function was removed and + PyArray_SetStringFunction was stubbed out. (gh-26611) + ## C API changes + * API symbols now hidden but customizable + * Many shims removed from npy_3kcompat.h + * New PyUFuncObject field process_core_dims_func + ## New Features + * Preliminary Support for Free-Threaded CPython 3.13 + * f2py can generate freethreading-compatible C extensions + ## Improvements + * histogram auto-binning now returns bin sizes >=1 for integer + input data + * ndarray shape-type parameter is now covariant and bound to + tuple[int, ...] + * np.quantile with method closest_observation chooses nearest + even order statistic + * lapack_lite is now thread safe + * The numpy.printoptions context manager is now thread and + async-safe + * Type hinting numpy.polynomial + * Improved numpy.dtypes type hints + ## Performance improvements and changes + * ma.cov and ma.corrcoef are now significantly faster + ## Changes + * ma.corrcoef may return a slightly different result + * Cast-safety fixes in copyto and full +- Release 2.0.1 + ## Improvements + * np.quantile with method closest_observation chooses nearest + even order statistic + +------------------------------------------------------------------- +Tue Aug 13 06:04:49 UTC 2024 - Dirk Müller + +- remove meson-python upper limit (per upstream) + +------------------------------------------------------------------- +Thu Jul 11 08:29:38 UTC 2024 - Ben Greiner + +- Fix numpy-config path tests, provide reason for failing meson + test +- Remove mistaken pycache rpmlint filter + +------------------------------------------------------------------- +Fri Jun 28 06:47:52 UTC 2024 - Steve Kowalik + +- Update to 2.0.0, changes include: + * Adds support for array parameter declaration in fortran... + * Added ``bitwise_count`` UFuncs + * Add binding for random pyx files + * Use AVX512-FP16 SVML content for float16 umath functions + * allow int sequences as shape arguments in numpy.memmap + * Add .mT attribute for arrays + * Create complex scalars from real and imaginary parts + * add copy parameter for api.reshape function + * make use of locals() in a comprehension fully compatible... + * Add array API standard v2022.12 support to numpy.array_api + * Change string to bool conversions to be consistent with... + * Allow np.info on non-hashable objects with a dtype + * let zeros, empty, and empty_like accept dtype classes + * Bump C-ABI to 2 but accept older NumPy if compiled against... + * Use high accuracy SVML for double precision umath functions + * expose PyUFunc_GiveFloatingpointErrors in the dtype API + * PyObject_IsTrue and PyObject_Not error handling in setflags + * array2string does not add signs for positive integers. + * Vectorize np.partition and np.argpartition using AVX-512 + * Create helper for conversion to arrays + * Add size check for threaded array assignment + * Finalize ``fastCopyAndTranpose`` and other old C-funcs/members... + * assert_array_less should report max violations instead of... + * Introduce tracer for enabled CPU targets on each optimized... + * Extend np.add ufunc to work with unicode and byte dtypes + * Add find/rfind ufuncs for unicode and byte dtypes + * Make ``intp`` ``ssize_t`` and introduce characters nN + * Add isdigit/isspace/isdecimal/isnumeric ufuncs for string... + * DType API slot for descriptor finalization before array... + * ensure passing ``np.dtype`` to itself doesn't crash + * Vectorize np.sort and np.partition with AVX2 + * Change add/isalpha ufuncs to use buffer class & general... + * Add strip/lstrip/rstrip ufuncs for unicode and bytes + * Add ``matrix_norm``, ``vector_norm``, ``vecdot`` and ``matrix_transpose`` + * Make ``encoding=None`` the default in loadtxt + * Introduce ``copy`` argument for ``np.asarray`` + * Introduce ``correction`` argument for ``np.var`` and ``np.std``... + * Handle ``common`` blocks with ``kind`` specifications from modules + * Handle ``iso_c_type`` mappings more consistently + * Add ``device`` and ``to_device`` to ``numpy.ndarray`` + * Shrink MultiIterObject and make ``NPY_MAXARGS`` a runtime... + * enable linking of external libraries in the f2py Meson backend + * Don't use the _Complex extension in C++ mode + * Add fft optional extension submodule to numpy.array_api + * make arange ``start`` argument positional-only + * Make numpy.array_api more portable + * Adjust ``linalg.pinv`` and ``linalg.cholesky`` to Array... + * define a gufunc for vecdot (with BLAS support) + * Add ``rtol`` to ``matrix_rank`` and ``stable`` + * adjust nD fft ``s`` param to array API + * three string ufunc bugs, one leading to segfault + * allow building in cython with Py_LIMITED_API + * support axes argument in np.linalg.tensordot + * Add replace ufunc to np.strings + * change list-of-array to tuple-of-array returns (Numba compat) + * Wrap string ufuncs in np.strings to allow default arguments + * Allow ``None`` as ``api_version`` in ``__array_namespace__``... + * Vectorize argsort and argselect with AVX2 + * Use large file fallocate on 32 bit linux platforms + * Allow strings in logical ufuncs + * Allow NumPy int scalars to be divided by out-of-bound Python... + * correct irfft with n=1 on larger input + * check for overflow when converting a string to an int scalar + * Ensure meson updates generated umath doc correctly. + * support float and longdouble in FFT using C++ pocketfft... + * Make any and all return booleans by default + * Finalize future warning move in lstsq default + * add a pkg-config file and a ``numpy-config`` script + * Finalize future warning for shape=1 descriptor dropping... + * Add index/rindex ufuncs for unicode and bytes dtypes + * Add rest of unary ufuncs for unicode/bytes dtypes + * Create ``PyArray_DescrProto`` for legacy descriptor registration + * Make ``descr->f`` only accessible through ``PyDataType_GetArrFuncs`` + * ensure that FFT routines can deal with integer and bool... + * ensure static_string.buf is never NULL for a non-null string + * Include broadcasting for ``rtol`` argument in ``matrix_rank`` + * Add expandtabs ufunc for string & unicode dtypes + * implement stringdtype <-> timedelta roundtrip casts + * Make descr->f only accessible through ``PyDataType_GetArrFuncs`` + * Ensure non-array logspace base does not influence dtype... + * Require reduce promoters to start with None to match + * inherit numerical dtypes from abstract ones. + * Infinite Loop in numpy.base_repr + * Ensure seed sequences are restored through pickling + * use PyArray_SafeCast in array_astype + * introduce a notion of "compatible" stringdtype instances... + * add support for nan-like null strings in string replace + * Make sure that NumPy scalars are supported by can_cast + * Disallow string inputs for copy keyword in np.array and... + * Adds asanyarray to start of linalg.cross + * weighted nanpercentile, nanquantile and multi-dim q +- Remove patches, no longer required: + * 0001-BUG-Fix-test_impossible_feature_enable-failing-witho.patch + * 0001-feature-module-Fix-handling-of-multiple-conflicts-pe.patch + * fix-meson-multiple-python-versions.patch + * numpy-1.9.0-remove-__declspec.patch + +------------------------------------------------------------------- +Sun May 12 14:46:08 UTC 2024 - Sarah Kriesch + +- Enable openblas for python-numpy:gnu-hpc on s390x + +------------------------------------------------------------------- +Tue Apr 23 12:52:21 UTC 2024 - Steve Kowalik + +- Add patch fix-meson-multiple-python-versions.patch: + * Ensure meson executes sys.executable when testing Cython. + +------------------------------------------------------------------- +Tue Apr 16 19:12:21 UTC 2024 - Ben Greiner + +- Update to 1.26.4 + * NumPy 1.26.4 is a maintenance release that fixes bugs and + regressions discovered after the 1.26.3 release. The Python + versions supported by this release are 3.9-3.12. This is the + last planned release in the 1.26.x series. + * BUG: Restore missing asstr import + * MAINT: prepare 1.26.x for further development + * BUG: numpy.array_api: fix linalg.cholesky upper decomp... + * MAINT, BLD: Fix unused inline functions warnings on clang + * TST: Fix test_numeric on riscv64 + * MAINT: add newaxis to __all__ in numpy.array_api + * BUG: Use large file fallocate on 32 bit linux platforms + * TST: Fix test_warning_calls on Python 3.12 + * TST: Bump pytz to 2023.3.post1 + * BUG: Fix AVX512 build flags on Intel Classic Compiler + * BLD: fix potential issue with escape sequences in __config__.py + * BLD: unvendor meson-python on 1.26.x and upgrade to + meson-python... + * MAINT: Include header defining backtrace + * BUG: Fix np.quantile([Fraction(2,1)], 0.5) (#24711) +- Release 1.26.3 + ## Compatibility + * f2py will no longer accept ambiguous -m and .pyf CLI + combinations. When more than one .pyf file is passed, an error + is raised. When both -m and a .pyf is passed, a warning is + emitted and the -m provided name is ignored. + ## Improvements + * f2py now handles common blocks which have kind specifications + from modules. This further expands the usability of intrinsics + like iso_fortran_env and iso_c_binding. + ## Pull requests merged + * MAINT: prepare 1.26.x for further development + * TYP: add None to __getitem__ in numpy.array_api + * BLD,BUG: quadmath required where available [f2py] + * BUG: alpha doesn't use REAL(10) + * BUG: Fix FP overflow error in division when the divisor is + scalar + * MAINT: Pin scipy-openblas version. + * BUG: Fix f2py to enable use of string optional inout argument + * BUG: Fix -fsanitize=alignment issue in + numpy/_core/src/multiarray/arraytypes.c.src + * TST: Explicitly pass NumPy path to cython during tests (also... + * BUG: fix issues with newaxis and linalg.solve in + numpy.array_api + * BUG: Disallow shadowed modulenames + * BUG: Handle common blocks with kind specifications from modules + * BUG: Fix moving compiled executable to root with f2py -c on + Windows + * BUG: Fix single to half-precision conversion on PPC64/VSX3 + * TST: f2py: fix issue in test skip condition + * Revert "MAINT: Pin scipy-openblas version." + * MAINT: do not use long type + * TST: PyPy needs another gc.collect on latest versions + * MAINT: Bump conda-incubator/setup-miniconda from 2.2.0 to 3.0.1 + * BLD: update vendored Meson for AIX shared library fix + * MAINT: Init base in cpu_avx512_kn + * BUG: Fix failing test_features on SapphireRapids + * BUG: Fix non-contiguous memory load when ARM/Neon is enabled + * MAINT,BUG: Never import distutils above 3.12 [f2py] + * MAINT: make the import-time check for old Accelerate more + specific + * MAINT: Bump actions/setup-node and + larsoner/circleci-artifacts-redirector-action + * BUG: avoid seg fault from OOB access in RandomState.set_state() + * BUG: Fix two errors related to not checking for failed + allocations + * BUG: Fix regression with f2py wrappers when modules and + subroutines... + * BUG: Fix build issues on SPR + * BLD: fix uninitialized variable warnings from + simd/neon/memory.h + * BUG: Handle iso_c_type mappings more consistently + * BUG: Fix module name bug in signature files [urgent] [f2py] + * BUG: Handle .pyf.src and fix SciPy [urgent] + * DOC: f2py rewrite with meson details + * BUG: Add external library handling for meson [f2py] + * MAINT: Run f2py's meson backend with the same python that + ran... + * MAINT: Update numpy/f2py/_backends from main. + * MAINT: Easy updates of f2py/*.py from main. + * MAINT: Update crackfortran.py and f2py2e.py from main + +------------------------------------------------------------------- +Thu Mar 28 13:54:34 UTC 2024 - Fabian Vogt + +- Add patch to fix detection of some features: + * 0001-feature-module-Fix-handling-of-multiple-conflicts-pe.patch +- Add patch to fix test failure on some platforms (boo#1221902): + * 0001-BUG-Fix-test_impossible_feature_enable-failing-witho.patch + +------------------------------------------------------------------- +Mon Jan 15 16:35:46 UTC 2024 - Andreas Schwab + +- Update list of expected test failures on riscv64 + +------------------------------------------------------------------- +Thu Jan 11 07:33:45 UTC 2024 - Torsten Gruner + +- Fix gnu-hpc build error for Leap + +------------------------------------------------------------------- +Wed Dec 27 12:57:32 UTC 2023 - ecsos + +- Fix build error for Leap. Need gcc >= 8.5 + +------------------------------------------------------------------- +Wed Dec 13 06:53:32 UTC 2023 - Steve Kowalik + +- Do not attempt to ship numpy.distutils C code in the Python 3.12 -devel + package, it is not installed. + +------------------------------------------------------------------- +Mon Nov 20 05:09:33 UTC 2023 - Steve Kowalik + +- Update to 1.26.2: + * TYP: Trim down the ``_NestedSequence.__getitem__`` signature + * BUG: fix choose refcount leak + * TST: fix running the test suite in builds without BLAS/LAPACK + * BUG: random: Fix generation of nan by dirichlet. + * TST: fix distutils tests for deprecations in recent setuptools... + * MAINT: Remove versioneer + * MAINT: Pin upper version of sphinx. + * ENH: Add prefix to _ALIGN Macro + * BUG: cleanup warnings [skip azp][skip circle][skip travis][skip... + * BUG: ``asv dev`` has been removed, use ``asv run``. + * BUG: Fix meson build failure due to unchanged inplace auto-generated... + * BUG: fix issue with git-version script, needs a shebang to run + * BUG: Use a default assignment for git_hash [skip ci] + * BUG: fix NPY_cast_info error handling in choose + * BUG: Fix common block handling in f2py + * BUG: Fix assumed length f2py regression + * MAINT: Harmonize fortranobject + * TYP: add kind argument to numpy.isin type specification + * BUG: fix comparisons between masked and unmasked structured arrays + * ENH: Adopt new macOS Accelerate BLAS/LAPACK Interfaces, including... + * TYP: Add the missing ``casting`` keyword to ``np.clip`` + * TST: convert cython test from setup.py to meson + * MAINT: Fixup ``fromnumeric.pyi`` + * BUG, ENH: Fix ``iso_c_binding`` type maps + * TYP: Allow ``binary_repr`` to accept any object + * TYP: Explicitly declare ``dtype`` and ``generic`` hashable + * ENH: Refactor the typing "reveal" tests using `typing.assert_type` + * ENH: ``meson`` backend for ``f2py`` + * MAINT: Refactor partial load Workaround for Clang + * BUG: Fix data stmt handling for complex values in f2py + * TYP: Add annotations for the py3.12 buffer protocol + * DOC: Updated the f2py docs to remove a note on -fimplicit-none + * BUG: Fix SIMD f32 trunc test on s390x when baseline is none + * BUG: Fix DATA statements for f2py + * API: Add ``NumpyUnpickler`` for backporting + * MAINT: Xfail test failing on PyPy. + * ENH: meson: implement BLAS/LAPACK auto-detection + * DOC: add a 1.26.1 release notes section for BLAS/LAPACK build + * MAINT: Backport ``numpy._core`` stubs. Remove ``NumpyUnpickler`` + * BUG: loongarch doesn't use REAL(10) + * MAINT: align test_dispatcher s390x targets with _umath_tests_mtargets + * ENH: Add Cython enumeration for NPY_FR_GENERIC + * MAINT: Remove unhelpful error replacements from ``import_array()`` + * BUG: Avoid intp conversion regression in Cython 3 + * MAINT: Add missing ``noexcept`` to shuffle helpers + * DOC: Fix license identifier for OpenBLAS + * BLD: improve detection of Netlib libblas/libcblas/liblapack + * MAINT: Make bitfield integers unsigned + * BUG: Make n a long int for np.random.multinomial + * BUG: ensure passing ``np.dtype`` to itself doesn't crash +- Update BuildRequires as appropiate, build system changed from setuptools + to meson. +- Drop patch ignore-pkg_resources-deprecation.patch, no longer required +- f2py3 no longer shipped + ------------------------------------------------------------------- Wed Aug 16 11:31:28 UTC 2023 - Daniel Garcia diff --git a/python-numpy.spec b/python-numpy.spec index f075d8b..9630901 100644 --- a/python-numpy.spec +++ b/python-numpy.spec @@ -1,7 +1,7 @@ # -# spec file +# spec file for package python-numpy # -# Copyright (c) 2023 SUSE LLC +# Copyright (c) 2024 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -17,8 +17,8 @@ %global flavor @BUILD_FLAVOR@%{nil} -%define ver 1.25.2 -%define _ver 1_25_2 +%define ver 2.1.2 +%define _ver 2_1_2 %define pname python-numpy %define plainpython python %define hpc_upcase_trans_hyph() %(echo %{**} | tr [a-z] [A-Z] | tr '-' '_') @@ -39,9 +39,6 @@ %if 0%{?sle_version} == 120300 %{?with_openblas:ExclusiveArch: do_not_build} %endif -%ifarch s390 s390x -%{?with_openblas:ExclusiveArch: do_not_build} -%endif %{?with_hpc:%{hpc_requires}} # %if 0%{?suse_version} > 1500 @@ -84,17 +81,22 @@ Source: https://files.pythonhosted.org/packages/source/n/numpy/numpy-%{v Source99: python-numpy-rpmlintrc # PATCH-FIX-OPENSUSE numpy-buildfix.patch -- openSUSE-specific build fixes Patch0: numpy-buildfix.patch -# PATCH-FIX-OPENSUSE numpy-1.9.0-remove-__declspec.patch -- fix for spurious compiler warnings that cause build failure -Patch1: numpy-1.9.0-remove-__declspec.patch -# PATCH-FIX-OPENSUSE Ignore DeprecationWarnings when importing pkg_resources -Patch2: ignore-pkg_resources-deprecation.patch -BuildRequires: %{python_module Cython >= 0.29.30 with %python-Cython < 3} -BuildRequires: %{python_module base >= 3.8} +BuildRequires: %{python_module Cython >= 3.0} +BuildRequires: %{python_module base >= 3.10} BuildRequires: %{python_module devel} +BuildRequires: %{python_module meson-python >= 0.15} BuildRequires: %{python_module pip} -BuildRequires: %{python_module setuptools >= 60.0.0} -BuildRequires: %{python_module wheel} +BuildRequires: %{python_module pyproject-metadata >= 0.7.1} +BuildRequires: cmake +%if 0%{?suse_version} < 1600 +BuildRequires: gcc12 +BuildRequires: gcc12-c++ +%else +BuildRequires: gcc BuildRequires: gcc-c++ +%endif +BuildRequires: ninja >= 1.8.2 +BuildRequires: patchelf BuildRequires: python-rpm-macros >= 20210929 BuildConflicts: gcc11 < 11.2 %if 0%{?suse_version} @@ -131,7 +133,7 @@ BuildRequires: alts Requires: alts %else Requires(post): update-alternatives -Requires(postun):update-alternatives +Requires(postun): update-alternatives %endif %else BuildRequires: %{compiler_family}%{?c_f_ver}-compilers-hpc-macros-devel @@ -186,8 +188,14 @@ This package contains files for developing applications using numpy. %prep %autosetup -p1 -n numpy-%{version} # Fix non-executable scripts -sed -i '1s/^#!.*$//' numpy/{compat/setup,random/_examples/cython/setup,distutils/{conv_template,cpuinfo,exec_command,from_template,setup,system_info},f2py/{__init__,auxfuncs,capi_maps,cb_rules,cfuncs,common_rules,crackfortran,diagnose,f2py2e,f90mod_rules,func2subr,rules,setup,use_rules},matrixlib/setup,setup,testing/{print_coercion_tables,setup}}.py -sed -i '1s/^#!.*$//' numpy/random/_examples/cython/*.pyx +sed -i '1{/^#!/d}'\ + numpy/distutils/{conv_template,cpuinfo,from_template,system_info}.py \ + numpy/f2py/{__init__,cfuncs,diagnose,crackfortran,f2py2e,rules}.py \ + numpy/random/_examples/cython/extending{,_distributions}.pyx \ + numpy/testing/print_coercion_tables.py +chmod -x \ + numpy/f2py/{crackfortran,f2py2e,rules}.py \ + numpy/testing/print_coercion_tables.py # force cythonization rm -f PKG-INFO @@ -207,6 +215,10 @@ EOF %else export CFLAGS="%{optflags} -fno-strict-aliasing" %endif +%if 0%{?suse_version} < 1600 +export CC=gcc-12 +export CXX=g++-12 +%endif %pyproject_wheel @@ -218,9 +230,7 @@ export CFLAGS="%{optflags} -fno-strict-aliasing" %if !%{with hpc} %python_clone -a %{buildroot}%{_bindir}/f2py -%python_expand rm %{buildroot}%{$python_sitearch}/numpy/core/include/numpy/.doxyfile -%else -rm %{buildroot}%{p_python_sitearch}/numpy/core/include/numpy/.doxyfile +%python_clone -a %{buildroot}%{_bindir}/numpy-config %endif %if 0%{?suse_version} @@ -233,7 +243,7 @@ rm %{buildroot}%{p_python_sitearch}/numpy/core/include/numpy/.doxyfile %{python_expand # Don't package testsuite python_flavor=`cat _current_flavor` sitesearch_path=`$python -c "import sysconfig as s; print(s.get_paths(vars={'platbase':'%{hpc_prefix}','base':'%{hpc_prefix}'}).get('platlib'))"` -rm -rf %{buildroot}${sitesearch_path}/numpy/{,core,distutils,f2py,fft,lib,linalg,ma,matrixlib,oldnumeric,polynomial,random,testing}/tests +rm -rf %{buildroot}${sitesearch_path}/numpy/{,_core,distutils,f2py,fft,lib,linalg,ma,matrixlib,oldnumeric,polynomial,random,testing}/tests %hpc_write_modules_files #%%Module1.0##################################################################### @@ -274,11 +284,18 @@ EOF %check # https://numpy.org/doc/stable/dev/development_environment.html#running-tests %if %{without hpc} -export PATH="%{buildroot}%{_bindir}:$PATH" mkdir -p testing cp pytest.ini testing/ pushd testing +%python_flavored_alternatives +%if %{with libalternatives} +%{python_expand # +for b in f2py numpy-config; do + ln -s %{buildroot}%{_bindir}/$b-%{$python_bin_suffix} build/flavorbin/$b +done +} +%endif # flaky tests test_failok+=" or test_structured_object_indexing" @@ -323,16 +340,18 @@ test_failok+=" or (test_multinomial_pvals_float32)" %endif %ifarch %{arm} # https://github.com/numpy/numpy/issues/24001 -test_failok+=" or (test_cpu_features and test_impossible_feature_enable)" test_failok+=" or (test_cpu_features and test_features)" test_failok+=" or (test_umath and test_unary_spurious_fpexception)" %endif %ifarch riscv64 # These tests fail due to non-portable assumptions about the signbit of NaN # gh#numpy/numpy#8213 -test_failok+=" or test_fpclass" -test_failok+=" or test_float" +test_failok+=" or (test_umath and test_fpclass)" +test_failok+=" or (test_numeric and TestBoolCmp and test_float)" +test_failok+=" or (test_umath and test_fp_noncontiguous)" %endif +# The meson command is always on the primary python and wants to import numpy from there +test_failok+=" or test_limited_api" echo " import sys @@ -347,7 +366,7 @@ export PYTHONPATH=%{buildroot}%{$python_sitearch} export PYTHONDONTWRITEBYTECODE=1 [ -n "$test_failok" ] && $python runobstest.py "${test_failok:4}" ||: # test_new_policy: duplicates test runs and output and does not follow our deselection -$python runobstest.py "not (test_new_policy ${test_failok})" +$python runobstest.py "not (test_new_policy ${test_failok} or slow)" } popd @@ -359,7 +378,7 @@ popd %python_libalternatives_reset_alternative f2py %post -%python_install_alternative f2py +%python_install_alternative f2py numpy-config %postun %python_uninstall_alternative f2py @@ -367,37 +386,32 @@ popd %files %{python_files} %doc README.md THANKS.txt +%license LICENSE.txt %if %{without hpc} %python_alternative %{_bindir}/f2py -%if "%{python_flavor}" == "python3" || "%{python_provides}" == "python3" -%{_bindir}/f2py3 -%else -%exclude %{_bindir}/f2py3 -%endif -%{_bindir}/f2py%{python_bin_suffix} +%python_alternative %{_bindir}/numpy-config %{python_sitearch}/numpy/ -%{python_sitearch}/numpy-%{version}*-info -%license %{python_sitearch}/numpy/LICENSE.txt -%exclude %{python_sitearch}/numpy/core/include/ +%{python_sitearch}/numpy-%{version}.dist-info +%exclude %{python_sitearch}/numpy/_core/include +%exclude %{python_sitearch}/numpy/_core/lib/libnpymath.a +%exclude %{python_sitearch}/numpy/_core/lib/pkgconfig/numpy.pc %exclude %{python_sitearch}/numpy/distutils/mingw/*.c %exclude %{python_sitearch}/numpy/distutils/checks/*.c %exclude %{python_sitearch}/numpy/f2py/src/ -%exclude %{python_sitearch}/numpy/core/lib/libnpymath.a %exclude %{python_sitearch}/numpy/random/lib/libnpyrandom.a %else %if "%{python_flavor}" == "python3" || "%{python_provides}" == "python3" %{p_bindir}/f2py -%{p_bindir}/f2py3 +%{p_bindir}/numpy-config %else %exclude %{p_bindir}/f2py -%exclude %{p_bindir}/f2py3 +%exclude %{p_bindir}/numpy-config %endif -%{p_bindir}/f2py%{python_bin_suffix} %{p_python_sitearch}/numpy/ -%{p_python_sitearch}/numpy-%{version}*-info -%license %{p_python_sitearch}/numpy/LICENSE.txt -%exclude %{p_python_sitearch}/numpy/core/include/ -%exclude %{p_python_sitearch}/numpy/core/lib/libnpymath.a +%{p_python_sitearch}/numpy-%{version}.dist-info +%exclude %{p_python_sitearch}/numpy/_core/include/ +%exclude %{p_python_sitearch}/numpy/_core/lib/libnpymath.a +%exclude %{p_python_sitearch}/numpy/_core/lib/pkgconfig/numpy.pc %exclude %{p_python_sitearch}/numpy/random/lib/libnpyrandom.a %exclude %{p_python_sitearch}/numpy/distutils/mingw/*.c %exclude %{p_python_sitearch}/numpy/distutils/checks/*.c @@ -416,18 +430,24 @@ popd %files %{python_files devel} %license LICENSE.txt %if %{without hpc} -%{python_sitearch}/numpy/core/include/ +%{python_sitearch}/numpy/_core/include/ +%if 0%{python_version_nodots} < 312 %{python_sitearch}/numpy/distutils/mingw/*.c %{python_sitearch}/numpy/distutils/checks/*.c +%endif %{python_sitearch}/numpy/f2py/src/ -%{python_sitearch}/numpy/core/lib/libnpymath.a +%{python_sitearch}/numpy/_core/lib/libnpymath.a +%{python_sitearch}/numpy/_core/lib/pkgconfig/numpy.pc %{python_sitearch}/numpy/random/lib/libnpyrandom.a %else -%{p_python_sitearch}/numpy/core/include/ -%{p_python_sitearch}/numpy/core/lib/libnpymath.a +%{p_python_sitearch}/numpy/_core/include/ +%{p_python_sitearch}/numpy/_core/lib/pkgconfig/numpy.pc +%{p_python_sitearch}/numpy/_core/lib/libnpymath.a %{p_python_sitearch}/numpy/random/lib/libnpyrandom.a +%if 0%{python_version_nodots} < 312 %{p_python_sitearch}/numpy/distutils/mingw/*.c %{p_python_sitearch}/numpy/distutils/checks/*.c +%endif %{p_python_sitearch}/numpy/f2py/src/ %endif