import CS python3.12-numpy-1.24.4-3.el8
This commit is contained in:
parent
5face40859
commit
53874ed0db
1
.gitignore
vendored
1
.gitignore
vendored
@ -1 +0,0 @@
|
||||
SOURCES/numpy-1.24.4.tar.gz
|
@ -1 +0,0 @@
|
||||
2ce526047c0f35c372f838afd5666165b0427039 SOURCES/numpy-1.24.4.tar.gz
|
@ -1,46 +0,0 @@
|
||||
From b0872b858e2e6ebc394e95c81a024dcf1573c690 Mon Sep 17 00:00:00 2001
|
||||
From: Ralf Gommers <ralf.gommers@gmail.com>
|
||||
Date: Mon, 19 Jun 2023 11:07:19 +0200
|
||||
Subject: [PATCH] TST: skip refcount related tests on py312
|
||||
|
||||
Python 3.12 has immortal refcounts; the initial and final
|
||||
values will be the same when accessing `sys.getrefcount` inside a
|
||||
test.
|
||||
|
||||
Closes gh-23986
|
||||
---
|
||||
numpy/core/tests/test_dtype.py | 5 +++++
|
||||
numpy/core/tests/test_regression.py | 4 ++++
|
||||
2 files changed, 9 insertions(+)
|
||||
|
||||
diff --git a/numpy/core/tests/test_dtype.py b/numpy/core/tests/test_dtype.py
|
||||
index 454bcfa7cc1..9c88ddb5cd7 100644
|
||||
--- a/numpy/core/tests/test_dtype.py
|
||||
+++ b/numpy/core/tests/test_dtype.py
|
||||
@@ -755,6 +755,11 @@ def iter_struct_object_dtypes():
|
||||
yield pytest.param(dt, p, 12, obj, id="<structured subarray 2>")
|
||||
|
||||
|
||||
+@pytest.mark.skipif(
|
||||
+ sys.version_info >= (3, 12),
|
||||
+ reason="Python 3.12 has immortal refcounts, this test will no longer "
|
||||
+ "work. See gh-23986"
|
||||
+)
|
||||
@pytest.mark.skipif(not HAS_REFCOUNT, reason="Python lacks refcounts")
|
||||
class TestStructuredObjectRefcounting:
|
||||
"""These tests cover various uses of complicated structured types which
|
||||
diff --git a/numpy/core/tests/test_regression.py b/numpy/core/tests/test_regression.py
|
||||
index e415ecccf9f..35763f843da 100644
|
||||
--- a/numpy/core/tests/test_regression.py
|
||||
+++ b/numpy/core/tests/test_regression.py
|
||||
@@ -1465,6 +1465,10 @@ def test_structured_arrays_with_objects1(self):
|
||||
x[x.nonzero()] = x.ravel()[:1]
|
||||
assert_(x[0, 1] == x[0, 0])
|
||||
|
||||
+ @pytest.mark.skipif(
|
||||
+ sys.version_info >= (3, 12),
|
||||
+ reason="Python 3.12 has immortal refcounts, this test no longer works."
|
||||
+ )
|
||||
@pytest.mark.skipif(not HAS_REFCOUNT, reason="Python lacks refcounts")
|
||||
def test_structured_arrays_with_objects2(self):
|
||||
# Ticket #1299 second test
|
@ -1,278 +0,0 @@
|
||||
From 60720ee4d160fc2ae8ed74f98668f486ad862cef Mon Sep 17 00:00:00 2001
|
||||
From: Stefan Behnel <stefan_ml@behnel.de>
|
||||
Date: Thu, 4 May 2023 09:18:16 +0200
|
||||
Subject: [PATCH] Add "noexcept" markers to functions that do not raise
|
||||
exceptions
|
||||
|
||||
---
|
||||
numpy/random/_common.pxd | 40 +++++++++++++++++++--------------------
|
||||
numpy/random/_common.pyx | 2 +-
|
||||
numpy/random/_mt19937.pyx | 8 ++++----
|
||||
numpy/random/_pcg64.pyx | 6 +++---
|
||||
numpy/random/_philox.pyx | 6 +++---
|
||||
numpy/random/_sfc64.pyx | 6 +++---
|
||||
6 files changed, 34 insertions(+), 34 deletions(-)
|
||||
|
||||
diff --git a/numpy/random/_common.pxd b/numpy/random/_common.pxd
|
||||
index 3eaf39d..5419d63 100644
|
||||
--- a/numpy/random/_common.pxd
|
||||
+++ b/numpy/random/_common.pxd
|
||||
@@ -39,32 +39,32 @@ cdef extern from "include/aligned_malloc.h":
|
||||
cdef void *PyArray_calloc_aligned(size_t n, size_t s)
|
||||
cdef void PyArray_free_aligned(void *p)
|
||||
|
||||
-ctypedef void (*random_double_fill)(bitgen_t *state, np.npy_intp count, double* out) nogil
|
||||
-ctypedef double (*random_double_0)(void *state) nogil
|
||||
-ctypedef double (*random_double_1)(void *state, double a) nogil
|
||||
-ctypedef double (*random_double_2)(void *state, double a, double b) nogil
|
||||
-ctypedef double (*random_double_3)(void *state, double a, double b, double c) nogil
|
||||
+ctypedef void (*random_double_fill)(bitgen_t *state, np.npy_intp count, double* out) noexcept nogil
|
||||
+ctypedef double (*random_double_0)(void *state) noexcept nogil
|
||||
+ctypedef double (*random_double_1)(void *state, double a) noexcept nogil
|
||||
+ctypedef double (*random_double_2)(void *state, double a, double b) noexcept nogil
|
||||
+ctypedef double (*random_double_3)(void *state, double a, double b, double c) noexcept nogil
|
||||
|
||||
-ctypedef void (*random_float_fill)(bitgen_t *state, np.npy_intp count, float* out) nogil
|
||||
-ctypedef float (*random_float_0)(bitgen_t *state) nogil
|
||||
-ctypedef float (*random_float_1)(bitgen_t *state, float a) nogil
|
||||
+ctypedef void (*random_float_fill)(bitgen_t *state, np.npy_intp count, float* out) noexcept nogil
|
||||
+ctypedef float (*random_float_0)(bitgen_t *state) noexcept nogil
|
||||
+ctypedef float (*random_float_1)(bitgen_t *state, float a) noexcept nogil
|
||||
|
||||
-ctypedef int64_t (*random_uint_0)(void *state) nogil
|
||||
-ctypedef int64_t (*random_uint_d)(void *state, double a) nogil
|
||||
-ctypedef int64_t (*random_uint_dd)(void *state, double a, double b) nogil
|
||||
-ctypedef int64_t (*random_uint_di)(void *state, double a, uint64_t b) nogil
|
||||
-ctypedef int64_t (*random_uint_i)(void *state, int64_t a) nogil
|
||||
-ctypedef int64_t (*random_uint_iii)(void *state, int64_t a, int64_t b, int64_t c) nogil
|
||||
+ctypedef int64_t (*random_uint_0)(void *state) noexcept nogil
|
||||
+ctypedef int64_t (*random_uint_d)(void *state, double a) noexcept nogil
|
||||
+ctypedef int64_t (*random_uint_dd)(void *state, double a, double b) noexcept nogil
|
||||
+ctypedef int64_t (*random_uint_di)(void *state, double a, uint64_t b) noexcept nogil
|
||||
+ctypedef int64_t (*random_uint_i)(void *state, int64_t a) noexcept nogil
|
||||
+ctypedef int64_t (*random_uint_iii)(void *state, int64_t a, int64_t b, int64_t c) noexcept nogil
|
||||
|
||||
-ctypedef uint32_t (*random_uint_0_32)(bitgen_t *state) nogil
|
||||
-ctypedef uint32_t (*random_uint_1_i_32)(bitgen_t *state, uint32_t a) nogil
|
||||
+ctypedef uint32_t (*random_uint_0_32)(bitgen_t *state) noexcept nogil
|
||||
+ctypedef uint32_t (*random_uint_1_i_32)(bitgen_t *state, uint32_t a) noexcept nogil
|
||||
|
||||
-ctypedef int32_t (*random_int_2_i_32)(bitgen_t *state, int32_t a, int32_t b) nogil
|
||||
-ctypedef int64_t (*random_int_2_i)(bitgen_t *state, int64_t a, int64_t b) nogil
|
||||
+ctypedef int32_t (*random_int_2_i_32)(bitgen_t *state, int32_t a, int32_t b) noexcept nogil
|
||||
+ctypedef int64_t (*random_int_2_i)(bitgen_t *state, int64_t a, int64_t b) noexcept nogil
|
||||
|
||||
-cdef double kahan_sum(double *darr, np.npy_intp n)
|
||||
+cdef double kahan_sum(double *darr, np.npy_intp n) noexcept
|
||||
|
||||
-cdef inline double uint64_to_double(uint64_t rnd) nogil:
|
||||
+cdef inline double uint64_to_double(uint64_t rnd) noexcept nogil:
|
||||
return (rnd >> 11) * (1.0 / 9007199254740992.0)
|
||||
|
||||
cdef object double_fill(void *func, bitgen_t *state, object size, object lock, object out)
|
||||
diff --git a/numpy/random/_common.pyx b/numpy/random/_common.pyx
|
||||
index 7b6f693..c5e4e32 100644
|
||||
--- a/numpy/random/_common.pyx
|
||||
+++ b/numpy/random/_common.pyx
|
||||
@@ -171,7 +171,7 @@ cdef object prepare_ctypes(bitgen_t *bitgen):
|
||||
ctypes.c_void_p(<uintptr_t>bitgen))
|
||||
return _ctypes
|
||||
|
||||
-cdef double kahan_sum(double *darr, np.npy_intp n):
|
||||
+cdef double kahan_sum(double *darr, np.npy_intp n) noexcept:
|
||||
"""
|
||||
Parameters
|
||||
----------
|
||||
diff --git a/numpy/random/_mt19937.pyx b/numpy/random/_mt19937.pyx
|
||||
index 5a8d52e..8b99125 100644
|
||||
--- a/numpy/random/_mt19937.pyx
|
||||
+++ b/numpy/random/_mt19937.pyx
|
||||
@@ -28,16 +28,16 @@ cdef extern from "src/mt19937/mt19937.h":
|
||||
enum:
|
||||
RK_STATE_LEN
|
||||
|
||||
-cdef uint64_t mt19937_uint64(void *st) nogil:
|
||||
+cdef uint64_t mt19937_uint64(void *st) noexcept nogil:
|
||||
return mt19937_next64(<mt19937_state *> st)
|
||||
|
||||
-cdef uint32_t mt19937_uint32(void *st) nogil:
|
||||
+cdef uint32_t mt19937_uint32(void *st) noexcept nogil:
|
||||
return mt19937_next32(<mt19937_state *> st)
|
||||
|
||||
-cdef double mt19937_double(void *st) nogil:
|
||||
+cdef double mt19937_double(void *st) noexcept nogil:
|
||||
return mt19937_next_double(<mt19937_state *> st)
|
||||
|
||||
-cdef uint64_t mt19937_raw(void *st) nogil:
|
||||
+cdef uint64_t mt19937_raw(void *st) noexcept nogil:
|
||||
return <uint64_t>mt19937_next32(<mt19937_state *> st)
|
||||
|
||||
cdef class MT19937(BitGenerator):
|
||||
diff --git a/numpy/random/_pcg64.pyx b/numpy/random/_pcg64.pyx
|
||||
index c0a10a8..dee38c0 100644
|
||||
--- a/numpy/random/_pcg64.pyx
|
||||
+++ b/numpy/random/_pcg64.pyx
|
||||
@@ -30,13 +30,13 @@ cdef extern from "src/pcg64/pcg64.h":
|
||||
uint32_t pcg64_cm_next32(pcg64_state *state) nogil
|
||||
void pcg64_cm_advance(pcg64_state *state, uint64_t *step)
|
||||
|
||||
-cdef uint64_t pcg64_uint64(void* st) nogil:
|
||||
+cdef uint64_t pcg64_uint64(void* st) noexcept nogil:
|
||||
return pcg64_next64(<pcg64_state *>st)
|
||||
|
||||
-cdef uint32_t pcg64_uint32(void *st) nogil:
|
||||
+cdef uint32_t pcg64_uint32(void *st) noexcept nogil:
|
||||
return pcg64_next32(<pcg64_state *> st)
|
||||
|
||||
-cdef double pcg64_double(void* st) nogil:
|
||||
+cdef double pcg64_double(void* st) noexcept nogil:
|
||||
return uint64_to_double(pcg64_next64(<pcg64_state *>st))
|
||||
|
||||
cdef uint64_t pcg64_cm_uint64(void* st) nogil:
|
||||
diff --git a/numpy/random/_philox.pyx b/numpy/random/_philox.pyx
|
||||
index d9a366e..e0c0504 100644
|
||||
--- a/numpy/random/_philox.pyx
|
||||
+++ b/numpy/random/_philox.pyx
|
||||
@@ -42,13 +42,13 @@ cdef extern from 'src/philox/philox.h':
|
||||
void philox_advance(uint64_t *step, philox_state *state)
|
||||
|
||||
|
||||
-cdef uint64_t philox_uint64(void*st) nogil:
|
||||
+cdef uint64_t philox_uint64(void*st) noexcept nogil:
|
||||
return philox_next64(<philox_state *> st)
|
||||
|
||||
-cdef uint32_t philox_uint32(void *st) nogil:
|
||||
+cdef uint32_t philox_uint32(void *st) noexcept nogil:
|
||||
return philox_next32(<philox_state *> st)
|
||||
|
||||
-cdef double philox_double(void*st) nogil:
|
||||
+cdef double philox_double(void*st) noexcept nogil:
|
||||
return uint64_to_double(philox_next64(<philox_state *> st))
|
||||
|
||||
cdef class Philox(BitGenerator):
|
||||
diff --git a/numpy/random/_sfc64.pyx b/numpy/random/_sfc64.pyx
|
||||
index 1daee34..419045c 100644
|
||||
--- a/numpy/random/_sfc64.pyx
|
||||
+++ b/numpy/random/_sfc64.pyx
|
||||
@@ -21,13 +21,13 @@ cdef extern from "src/sfc64/sfc64.h":
|
||||
void sfc64_set_state(sfc64_state *state, uint64_t *state_arr, int has_uint32, uint32_t uinteger)
|
||||
|
||||
|
||||
-cdef uint64_t sfc64_uint64(void* st) nogil:
|
||||
+cdef uint64_t sfc64_uint64(void* st) noexcept nogil:
|
||||
return sfc64_next64(<sfc64_state *>st)
|
||||
|
||||
-cdef uint32_t sfc64_uint32(void *st) nogil:
|
||||
+cdef uint32_t sfc64_uint32(void *st) noexcept nogil:
|
||||
return sfc64_next32(<sfc64_state *> st)
|
||||
|
||||
-cdef double sfc64_double(void* st) nogil:
|
||||
+cdef double sfc64_double(void* st) noexcept nogil:
|
||||
return uint64_to_double(sfc64_next64(<sfc64_state *>st))
|
||||
|
||||
|
||||
--
|
||||
2.40.1
|
||||
|
||||
From 910aff8c5827e13a7b8bb32e22604cf5e35943fc Mon Sep 17 00:00:00 2001
|
||||
From: Thomas A Caswell <tcaswell@gmail.com>
|
||||
Date: Sat, 13 May 2023 21:33:45 -0400
|
||||
Subject: [PATCH] MNT: compatibility with cython3
|
||||
|
||||
This is fallout from https://github.com/cython/cython/pull/5386
|
||||
---
|
||||
numpy/random/_pcg64.pyx | 11 +++++------
|
||||
numpy/random/_philox.pyx | 4 ++--
|
||||
2 files changed, 7 insertions(+), 8 deletions(-)
|
||||
|
||||
diff --git a/numpy/random/_pcg64.pyx b/numpy/random/_pcg64.pyx
|
||||
index dee38c0..f7891aa 100644
|
||||
--- a/numpy/random/_pcg64.pyx
|
||||
+++ b/numpy/random/_pcg64.pyx
|
||||
@@ -26,8 +26,8 @@ cdef extern from "src/pcg64/pcg64.h":
|
||||
void pcg64_get_state(pcg64_state *state, uint64_t *state_arr, int *has_uint32, uint32_t *uinteger)
|
||||
void pcg64_set_state(pcg64_state *state, uint64_t *state_arr, int has_uint32, uint32_t uinteger)
|
||||
|
||||
- uint64_t pcg64_cm_next64(pcg64_state *state) nogil
|
||||
- uint32_t pcg64_cm_next32(pcg64_state *state) nogil
|
||||
+ uint64_t pcg64_cm_next64(pcg64_state *state) noexcept nogil
|
||||
+ uint32_t pcg64_cm_next32(pcg64_state *state) noexcept nogil
|
||||
void pcg64_cm_advance(pcg64_state *state, uint64_t *step)
|
||||
|
||||
cdef uint64_t pcg64_uint64(void* st) noexcept nogil:
|
||||
@@ -39,13 +39,13 @@ cdef uint32_t pcg64_uint32(void *st) noexcept nogil:
|
||||
cdef double pcg64_double(void* st) noexcept nogil:
|
||||
return uint64_to_double(pcg64_next64(<pcg64_state *>st))
|
||||
|
||||
-cdef uint64_t pcg64_cm_uint64(void* st) nogil:
|
||||
+cdef uint64_t pcg64_cm_uint64(void* st) noexcept nogil:
|
||||
return pcg64_cm_next64(<pcg64_state *>st)
|
||||
|
||||
-cdef uint32_t pcg64_cm_uint32(void *st) nogil:
|
||||
+cdef uint32_t pcg64_cm_uint32(void *st) noexcept nogil:
|
||||
return pcg64_cm_next32(<pcg64_state *> st)
|
||||
|
||||
-cdef double pcg64_cm_double(void* st) nogil:
|
||||
+cdef double pcg64_cm_double(void* st) noexcept nogil:
|
||||
return uint64_to_double(pcg64_cm_next64(<pcg64_state *>st))
|
||||
|
||||
cdef class PCG64(BitGenerator):
|
||||
@@ -515,4 +515,3 @@ cdef class PCG64DXSM(BitGenerator):
|
||||
pcg64_cm_advance(&self.rng_state, <uint64_t *>np.PyArray_DATA(d))
|
||||
self._reset_state_variables()
|
||||
return self
|
||||
-
|
||||
diff --git a/numpy/random/_philox.pyx b/numpy/random/_philox.pyx
|
||||
index e0c0504..e535346 100644
|
||||
--- a/numpy/random/_philox.pyx
|
||||
+++ b/numpy/random/_philox.pyx
|
||||
@@ -36,8 +36,8 @@ cdef extern from 'src/philox/philox.h':
|
||||
|
||||
ctypedef s_philox_state philox_state
|
||||
|
||||
- uint64_t philox_next64(philox_state *state) nogil
|
||||
- uint32_t philox_next32(philox_state *state) nogil
|
||||
+ uint64_t philox_next64(philox_state *state) noexcept nogil
|
||||
+ uint32_t philox_next32(philox_state *state) noexcept nogil
|
||||
void philox_jump(philox_state *state)
|
||||
void philox_advance(uint64_t *step, philox_state *state)
|
||||
|
||||
--
|
||||
2.40.1
|
||||
|
||||
From 83d7c201d7ad01fcacb8a3a8da3206f77a01f274 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= <miro@hroncok.cz>
|
||||
Date: Mon, 31 Jul 2023 11:46:23 +0200
|
||||
Subject: [PATCH] Unpin Cython to allow 3
|
||||
|
||||
---
|
||||
pyproject.toml | 2 +-
|
||||
test_requirements.txt | 2 +-
|
||||
2 files changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/pyproject.toml b/pyproject.toml
|
||||
index 60e7f58..557ae21 100644
|
||||
--- a/pyproject.toml
|
||||
+++ b/pyproject.toml
|
||||
@@ -3,7 +3,7 @@
|
||||
requires = [
|
||||
"setuptools==59.2.0",
|
||||
"wheel==0.37.0",
|
||||
- "Cython>=0.29.30,<3.0",
|
||||
+ "Cython>=0.29.34",
|
||||
]
|
||||
|
||||
|
||||
diff --git a/test_requirements.txt b/test_requirements.txt
|
||||
index 67b6a48..a065e99 100644
|
||||
--- a/test_requirements.txt
|
||||
+++ b/test_requirements.txt
|
||||
@@ -1,4 +1,4 @@
|
||||
-cython>=0.29.30,<3.0
|
||||
+cython>=0.29.34
|
||||
wheel==0.37.0
|
||||
setuptools==59.2.0
|
||||
hypothesis==6.24.1
|
||||
--
|
||||
2.40.1
|
||||
|
@ -1,236 +0,0 @@
|
||||
%global __python3 /usr/bin/python3.12
|
||||
%global python3_pkgversion 3.12
|
||||
|
||||
#uncomment next line for a release candidate or a beta
|
||||
#%%global relc rc1
|
||||
|
||||
# RHEL: Tests disabled due to missing dependencies
|
||||
%bcond_with tests
|
||||
|
||||
%if 0%{?fedora} >= 33 || 0%{?rhel} >= 9
|
||||
%global blaslib flexiblas
|
||||
%global blasvar %{nil}
|
||||
%else
|
||||
%global blaslib openblas
|
||||
%global blasvar p
|
||||
%endif
|
||||
|
||||
%global modname numpy
|
||||
|
||||
Name: python%{python3_pkgversion}-numpy
|
||||
Version: 1.24.4
|
||||
Release: 3%{?dist}
|
||||
Summary: A fast multidimensional array facility for Python
|
||||
|
||||
# Everything is BSD except...
|
||||
# numpy/core/src/multiarray/dragon4.*: MIT
|
||||
# numpy/core/include/numpy/libdivide: zlib
|
||||
# numpy/random/src/mt19937/randomkit.h: MIT
|
||||
# numpy/random/src/pcg64: MIT and ASL 2.0
|
||||
License: BSD and MIT and ASL 2.0 and zlib
|
||||
URL: http://www.numpy.org/
|
||||
Source0: https://github.com/%{modname}/%{modname}/releases/download/v%{version}/%{modname}-%{version}.tar.gz
|
||||
Patch0: https://github.com/numpy/numpy/commit/b0872b858e2e6ebc394e95c81a024dcf1573c690.patch
|
||||
# Cython 3 support, rebased from upstream:
|
||||
# https://github.com/numpy/numpy/commit/c7724ee776f3aa447d89170809aace0461ccacf0
|
||||
# https://github.com/numpy/numpy/commit/888fd7719965719321f160f79051aa5caf42b9ac
|
||||
# Also, Cython unpinned to allow Cython 3
|
||||
Patch1: cython3.patch
|
||||
|
||||
BuildRequires: python%{python3_pkgversion}-devel
|
||||
BuildRequires: python%{python3_pkgversion}-setuptools
|
||||
BuildRequires: python%{python3_pkgversion}-Cython
|
||||
BuildRequires: gcc-gfortran gcc gcc-c++
|
||||
BuildRequires: lapack-devel
|
||||
%if %{with tests}
|
||||
BuildRequires: python%{python3_pkgversion}-hypothesis
|
||||
BuildRequires: python%{python3_pkgversion}-pytest
|
||||
BuildRequires: python%{python3_pkgversion}-test
|
||||
BuildRequires: python%{python3_pkgversion}-typing-extensions
|
||||
%endif
|
||||
BuildRequires: %{blaslib}-devel
|
||||
BuildRequires: chrpath
|
||||
|
||||
%description
|
||||
NumPy is a general-purpose array-processing package designed to
|
||||
efficiently manipulate large multi-dimensional arrays of arbitrary
|
||||
records without sacrificing too much speed for small multi-dimensional
|
||||
arrays. NumPy is built on the Numeric code base and adds features
|
||||
introduced by numarray as well as an extended C-API and the ability to
|
||||
create arrays of arbitrary type.
|
||||
|
||||
There are also basic facilities for discrete fourier transform,
|
||||
basic linear algebra and random number generation. Also included in
|
||||
this package is a version of f2py that works properly with NumPy.
|
||||
|
||||
%package -n python%{python3_pkgversion}-numpy-f2py
|
||||
Summary: f2py for numpy
|
||||
Requires: python%{python3_pkgversion}-numpy%{?_isa} = %{version}-%{release}
|
||||
Requires: python%{python3_pkgversion}-devel
|
||||
Provides: python%{python3_pkgversion}-f2py = %{version}-%{release}
|
||||
|
||||
# Require alternatives version that implements the --keep-foreign flag and fixes rhbz#2203820
|
||||
Requires(postun): alternatives >= 1.19.2-1
|
||||
# python3.12 installs the alternatives master symlink to which we attach a slave
|
||||
Requires: python%{python3_pkgversion}
|
||||
Requires(post): python%{python3_pkgversion}
|
||||
Requires(postun): python%{python3_pkgversion}
|
||||
|
||||
%description -n python%{python3_pkgversion}-numpy-f2py
|
||||
This package includes a version of f2py that works properly with NumPy.
|
||||
|
||||
%prep
|
||||
%autosetup -n %{modname}-%{version} -p1
|
||||
|
||||
# Force re-cythonization (ifed for PKG-INFO presence in setup.py)
|
||||
rm PKG-INFO
|
||||
|
||||
# openblas is provided by flexiblas by default; otherwise,
|
||||
# Use openblas pthreads as recommended by upstream (see comment in site.cfg.example)
|
||||
cat >> site.cfg <<EOF
|
||||
[openblas]
|
||||
libraries = %{blaslib}%{blasvar}
|
||||
library_dirs = %{_libdir}
|
||||
EOF
|
||||
|
||||
%build
|
||||
%set_build_flags
|
||||
|
||||
env OPENBLAS=%{_libdir} \
|
||||
BLAS=%{_libdir} \
|
||||
LAPACK=%{_libdir} CFLAGS="%{optflags}" \
|
||||
%{__python3} setup.py build
|
||||
|
||||
%install
|
||||
|
||||
#%%{__python3} setup.py install -O1 --skip-build --root %%{buildroot}
|
||||
# skip-build currently broken, this works around it for now
|
||||
env OPENBLAS=%{_libdir} \
|
||||
FFTW=%{_libdir} BLAS=%{_libdir} \
|
||||
LAPACK=%{_libdir} CFLAGS="%{optflags}" \
|
||||
%{__python3} setup.py install --root %{buildroot} --prefix=%{_prefix}
|
||||
pushd %{buildroot}%{_bindir} &> /dev/null
|
||||
# Remove unversioned binaries
|
||||
rm f2py
|
||||
rm f2py3
|
||||
popd &> /dev/null
|
||||
|
||||
# All ghost files controlled by alternatives need to exist for the files
|
||||
# section check to succeed
|
||||
touch %{buildroot}%{_bindir}/f2py3
|
||||
|
||||
# distutils from setuptools don't have the patch that was created to avoid standard runpath here
|
||||
# we strip it manually instead
|
||||
# ERROR 0001: file '...' contains a standard runpath '/usr/lib64' in [/usr/lib64]
|
||||
chrpath --delete %{buildroot}%{python3_sitearch}/%{modname}/core/_multiarray_umath.*.so
|
||||
chrpath --delete %{buildroot}%{python3_sitearch}/%{modname}/linalg/lapack_lite.*.so
|
||||
chrpath --delete %{buildroot}%{python3_sitearch}/%{modname}/linalg/_umath_linalg.*.so
|
||||
|
||||
|
||||
%check
|
||||
%if %{with tests}
|
||||
export PYTHONPATH=%{buildroot}%{python3_sitearch}
|
||||
# test_ppc64_ibm_double_double128 is unnecessary now that ppc64le has switched long doubles to IEEE format.
|
||||
# https://github.com/numpy/numpy/issues/21094
|
||||
%ifarch %{ix86}
|
||||
# Weird RuntimeWarnings on i686, similar to https://github.com/numpy/numpy/issues/13173
|
||||
# Some tests also overflow on 32bit
|
||||
%global ix86_k and not test_vector_matrix_values and not test_matrix_vector_values and not test_identityless_reduction_huge_array and not (TestKind and test_all)
|
||||
%endif
|
||||
%ifnarch %{ix86}
|
||||
%{python3} runtests.py --no-build -- -ra -k 'not test_ppc64_ibm_double_double128 %{?ix86_k}' \
|
||||
-W "ignore:pkg_resources is deprecated as an API::pkg_resources"
|
||||
%endif
|
||||
|
||||
%endif
|
||||
|
||||
%post -n python%{python3_pkgversion}-numpy-f2py
|
||||
alternatives --add-slave python3 %{_bindir}/python%{python3_version} \
|
||||
%{_bindir}/f2py3 \
|
||||
f2py3 \
|
||||
%{_bindir}/f2py%{python3_version}
|
||||
|
||||
%postun -n python%{python3_pkgversion}-numpy-f2py
|
||||
# Do this only during uninstall process (not during update)
|
||||
if [ $1 -eq 0 ]; then
|
||||
alternatives --keep-foreign --remove-slave python3 %{_bindir}/python%{python3_version} \
|
||||
f2py3
|
||||
fi
|
||||
|
||||
|
||||
%files -n python%{python3_pkgversion}-numpy
|
||||
%license LICENSE.txt
|
||||
%doc THANKS.txt site.cfg.example
|
||||
%{python3_sitearch}/%{modname}/__pycache__
|
||||
%dir %{python3_sitearch}/%{modname}
|
||||
%{python3_sitearch}/%{modname}/*.py*
|
||||
%{python3_sitearch}/%{modname}/core
|
||||
%{python3_sitearch}/%{modname}/distutils
|
||||
%{python3_sitearch}/%{modname}/doc
|
||||
%{python3_sitearch}/%{modname}/fft
|
||||
%{python3_sitearch}/%{modname}/lib
|
||||
%{python3_sitearch}/%{modname}/linalg
|
||||
%{python3_sitearch}/%{modname}/ma
|
||||
%{python3_sitearch}/%{modname}/random
|
||||
%{python3_sitearch}/%{modname}/testing
|
||||
%{python3_sitearch}/%{modname}/tests
|
||||
%{python3_sitearch}/%{modname}/compat
|
||||
%{python3_sitearch}/%{modname}/matrixlib
|
||||
%{python3_sitearch}/%{modname}/polynomial
|
||||
%{python3_sitearch}/%{modname}-*.egg-info
|
||||
%exclude %{python3_sitearch}/%{modname}/LICENSE.txt
|
||||
%{python3_sitearch}/%{modname}/__init__.pxd
|
||||
%{python3_sitearch}/%{modname}/__init__.cython-30.pxd
|
||||
%{python3_sitearch}/%{modname}/py.typed
|
||||
%{python3_sitearch}/%{modname}/typing/
|
||||
%{python3_sitearch}/%{modname}/array_api/
|
||||
%{python3_sitearch}/%{modname}/_pyinstaller/
|
||||
%{python3_sitearch}/%{modname}/_typing/
|
||||
|
||||
%files -n python%{python3_pkgversion}-numpy-f2py
|
||||
%{_bindir}/f2py%{python3_version}
|
||||
%ghost %{_bindir}/f2py3
|
||||
%{python3_sitearch}/%{modname}/f2py
|
||||
|
||||
%changelog
|
||||
* Tue Jan 23 2024 Miro Hrončok <mhroncok@redhat.com> - 1.24.4-3
|
||||
- Rebuilt for timestamp .pyc invalidation mode
|
||||
|
||||
* Fri Nov 10 2023 Charalampos Stratakis <cstratak@redhat.com> - 1.24.4-2
|
||||
- Initial package
|
||||
- Fedora contributions by:
|
||||
Bill Nottingham <notting@fedoraproject.org>
|
||||
Charalampos Stratakis <cstratak@redhat.com>
|
||||
Christian Dersch <lupinix@mailbox.org>
|
||||
Dan Horák <dan@danny.cz>
|
||||
David Malcolm <dmalcolm@redhat.com>
|
||||
David Tardon <dtardon@redhat.com>
|
||||
Deji Akingunola <deji@fedoraproject.org>
|
||||
Dennis Gilmore <dennis@ausil.us>
|
||||
Elliott Sales de Andrade <quantum.analyst@gmail.com>
|
||||
Gwyn Ciesla <gwync@protonmail.com>
|
||||
Ignacio Vazquez-Abrams <ivazquez@fedoraproject.org>
|
||||
Iñaki Úcar <iucar@fedoraproject.org>
|
||||
Iryna Shcherbina <shcherbina.iryna@gmail.com>
|
||||
Jarod Wilson <jwilson@fedoraproject.org>
|
||||
Jaromir Capik <jcapik@redhat.com>
|
||||
Jef Spaleta <jspaleta@fedoraproject.org>
|
||||
Jesse Keating <jkeating@fedoraproject.org>
|
||||
Kalev Lember <klember@redhat.com>
|
||||
Karolina Surma <ksurma@redhat.com>
|
||||
Lumir Balhar <lbalhar@redhat.com>
|
||||
Merlin Mathesius <mmathesi@redhat.com>
|
||||
Miro Hrončok <miro@hroncok.cz>
|
||||
Nikola Forró <nforro@redhat.com>
|
||||
Orion Poplawski <orion@cora.nwra.com>
|
||||
Pavel Šimovec <psimovec@redhat.com>
|
||||
Peter Robinson <pbrobinson@fedoraproject.org>
|
||||
Robert Kuska <rkuska@redhat.com>
|
||||
Scott Talbert <swt@techie.net>
|
||||
Simone Caronni <negativo17@gmail.com>
|
||||
Thomas Spura <tomspur@fedoraproject.org>
|
||||
Tomáš Hrnčiar <thrnciar@redhat.com>
|
||||
Tomas Orsava <torsava@redhat.com>
|
||||
Tomas Tomecek <ttomecek@redhat.com>
|
||||
Ville Skyttä <scop@fedoraproject.org>
|
||||
Yaakov Selkowitz <yselkowitz@fedoraproject.org>
|
Loading…
Reference in New Issue
Block a user