Compare commits
21 Commits
d504c553ac
...
3e0d9645c6
Author | SHA1 | Date |
---|---|---|
David Abdurachmanov | 3e0d9645c6 | |
David Abdurachmanov | 19d4c30608 | |
Gwyn Ciesla | 200eb18e3f | |
Miro Hrončok | d0d0533071 | |
Gwyn Ciesla | a367c1f829 | |
Gwyn Ciesla | 4f441fcf66 | |
Scott Talbert | af3d0b491e | |
Python Maint | 92d66e8423 | |
Python Maint | db6cd203b9 | |
Gwyn Ciesla | 5df0cb11b0 | |
Charalampos Stratakis | 116541d007 | |
Gwyn Ciesla | 4ad487d64c | |
Yaakov Selkowitz | fcc064a276 | |
Pavel Šimovec | f24a8785f0 | |
Pavel Šimovec | 3e29b2e597 | |
Fedora Release Engineering | a289102afa | |
Charalampos Stratakis | bf76c423c4 | |
Miro Hrončok | 7c03db8b97 | |
Miro Hrončok | e742cd26a5 | |
Miro Hrončok | fbe6def60a | |
Kalev Lember | b8acd8cd2b |
|
@ -88,3 +88,9 @@ numpy-1.4.1.tar.gz
|
|||
/numpy-1.21.1.tar.gz
|
||||
/numpy-1.21.5.tar.gz
|
||||
/numpy-1.22.0.tar.gz
|
||||
/numpy-1.23.4.tar.gz
|
||||
/numpy-1.23.5.tar.gz
|
||||
/numpy-1.24.1.tar.gz
|
||||
/numpy-1.24.3.tar.gz
|
||||
/numpy-1.24.4.tar.gz
|
||||
/numpy-1.26.0.tar.gz
|
||||
|
|
54
21543.patch
54
21543.patch
|
@ -1,54 +0,0 @@
|
|||
From 42f3203a45231b338cf1a4c77fe81ca4b7fef4ef Mon Sep 17 00:00:00 2001
|
||||
From: Bas van Beek <43369155+BvB93@users.noreply.github.com>
|
||||
Date: Fri, 20 May 2022 02:42:37 +0200
|
||||
Subject: [PATCH 1/2] TST,TYP: Fix a python 3.11 failure for the `GenericAlias`
|
||||
tests
|
||||
|
||||
---
|
||||
numpy/typing/tests/test_generic_alias.py | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/numpy/typing/tests/test_generic_alias.py b/numpy/typing/tests/test_generic_alias.py
|
||||
index 52d3deae4ed..267230a95d6 100644
|
||||
--- a/numpy/typing/tests/test_generic_alias.py
|
||||
+++ b/numpy/typing/tests/test_generic_alias.py
|
||||
@@ -20,11 +20,11 @@
|
||||
if sys.version_info >= (3, 9):
|
||||
DType_ref = types.GenericAlias(np.dtype, (ScalarType,))
|
||||
NDArray_ref = types.GenericAlias(np.ndarray, (Any, DType_ref))
|
||||
- FuncType = Callable[[Union[_GenericAlias, types.GenericAlias]], Any]
|
||||
+ FuncType = Callable[["_GenericAlias | types.GenericAlias"], Any]
|
||||
else:
|
||||
DType_ref = Any
|
||||
NDArray_ref = Any
|
||||
- FuncType = Callable[[_GenericAlias], Any]
|
||||
+ FuncType = Callable[["_GenericAlias"], Any]
|
||||
|
||||
GETATTR_NAMES = sorted(set(dir(np.ndarray)) - _GenericAlias._ATTR_EXCEPTIONS)
|
||||
|
||||
|
||||
From 7c98e8c18c147bcbf6f9344376ca380a5d8f6c7b Mon Sep 17 00:00:00 2001
|
||||
From: Bas van Beek <b.f.van.beek@vu.nl>
|
||||
Date: Fri, 20 May 2022 19:24:38 +0200
|
||||
Subject: [PATCH 2/2] DOC: Add a note about `npt._GenericAlias` >=3.11
|
||||
stability
|
||||
|
||||
---
|
||||
numpy/typing/tests/test_generic_alias.py | 4 ++++
|
||||
1 file changed, 4 insertions(+)
|
||||
|
||||
diff --git a/numpy/typing/tests/test_generic_alias.py b/numpy/typing/tests/test_generic_alias.py
|
||||
index 267230a95d6..ae55ef43951 100644
|
||||
--- a/numpy/typing/tests/test_generic_alias.py
|
||||
+++ b/numpy/typing/tests/test_generic_alias.py
|
||||
@@ -17,6 +17,10 @@
|
||||
DType = _GenericAlias(np.dtype, (ScalarType,))
|
||||
NDArray = _GenericAlias(np.ndarray, (Any, DType))
|
||||
|
||||
+# NOTE: The `npt._GenericAlias` *class* isn't quite stable on python >=3.11.
|
||||
+# This is not a problem during runtime (as it's 3.8-exclusive), but we still
|
||||
+# need it for the >=3.9 in order to verify its semantics match
|
||||
+# `types.GenericAlias` replacement. xref numpy/numpy#21526
|
||||
if sys.version_info >= (3, 9):
|
||||
DType_ref = types.GenericAlias(np.dtype, (ScalarType,))
|
||||
NDArray_ref = types.GenericAlias(np.ndarray, (Any, DType_ref))
|
284
21605.patch
284
21605.patch
|
@ -1,284 +0,0 @@
|
|||
From 91bd7db8e43724acf947c06a42d4c8b07c8ffca4 Mon Sep 17 00:00:00 2001
|
||||
From: Bas van Beek <b.f.van.beek@vu.nl>
|
||||
Date: Wed, 25 May 2022 15:48:22 +0200
|
||||
Subject: [PATCH] MAINT: Adapt the `npt._GenericAlias` backport to Python 3.11
|
||||
`types.GenericAlias` changes
|
||||
|
||||
---
|
||||
numpy/typing/_generic_alias.py | 49 +++++++++++++++++++++++++++++-----
|
||||
1 file changed, 42 insertions(+), 7 deletions(-)
|
||||
|
||||
diff --git a/numpy/typing/_generic_alias.py b/numpy/typing/_generic_alias.py
|
||||
index 1eb2c8c..cd37dd5 100644
|
||||
--- a/numpy/typing/_generic_alias.py
|
||||
+++ b/numpy/typing/_generic_alias.py
|
||||
@@ -70,7 +70,7 @@ def _reconstruct_alias(alias: _T, parameters: Iterator[TypeVar]) -> _T:
|
||||
args.append(value)
|
||||
|
||||
cls = type(alias)
|
||||
- return cls(alias.__origin__, tuple(args))
|
||||
+ return cls(alias.__origin__, tuple(args), alias.__unpacked__)
|
||||
|
||||
|
||||
class _GenericAlias:
|
||||
@@ -86,7 +86,14 @@ class _GenericAlias:
|
||||
|
||||
"""
|
||||
|
||||
- __slots__ = ("__weakref__", "_origin", "_args", "_parameters", "_hash")
|
||||
+ __slots__ = (
|
||||
+ "__weakref__",
|
||||
+ "_origin",
|
||||
+ "_args",
|
||||
+ "_parameters",
|
||||
+ "_hash",
|
||||
+ "_starred",
|
||||
+ )
|
||||
|
||||
@property
|
||||
def __origin__(self) -> type:
|
||||
@@ -101,14 +108,27 @@ class _GenericAlias:
|
||||
"""Type variables in the ``GenericAlias``."""
|
||||
return super().__getattribute__("_parameters")
|
||||
|
||||
+ @property
|
||||
+ def __unpacked__(self) -> bool:
|
||||
+ return super().__getattribute__("_starred")
|
||||
+
|
||||
+ @property
|
||||
+ def __typing_unpacked_tuple_args__(self) -> tuple[object, ...] | None:
|
||||
+ # NOTE: This should return `__args__` if `__origin__` is a tuple,
|
||||
+ # which should never be the case with how `_GenericAlias` is used
|
||||
+ # within numpy
|
||||
+ return None
|
||||
+
|
||||
def __init__(
|
||||
self,
|
||||
origin: type,
|
||||
args: object | Tuple[object, ...],
|
||||
+ starred: bool = False,
|
||||
) -> None:
|
||||
self._origin = origin
|
||||
self._args = args if isinstance(args, tuple) else (args,)
|
||||
self._parameters = tuple(_parse_parameters(self.__args__))
|
||||
+ self._starred = starred
|
||||
|
||||
@property
|
||||
def __call__(self) -> type:
|
||||
@@ -116,10 +136,10 @@ class _GenericAlias:
|
||||
|
||||
def __reduce__(self: _T) -> Tuple[
|
||||
Type[_T],
|
||||
- Tuple[type, Tuple[object, ...]],
|
||||
+ Tuple[type, Tuple[object, ...], bool],
|
||||
]:
|
||||
cls = type(self)
|
||||
- return cls, (self.__origin__, self.__args__)
|
||||
+ return cls, (self.__origin__, self.__args__, self.__unpacked__)
|
||||
|
||||
def __mro_entries__(self, bases: Iterable[object]) -> Tuple[type]:
|
||||
return (self.__origin__,)
|
||||
@@ -136,7 +156,11 @@ class _GenericAlias:
|
||||
try:
|
||||
return super().__getattribute__("_hash")
|
||||
except AttributeError:
|
||||
- self._hash: int = hash(self.__origin__) ^ hash(self.__args__)
|
||||
+ self._hash: int = (
|
||||
+ hash(self.__origin__) ^
|
||||
+ hash(self.__args__) ^
|
||||
+ hash(self.__unpacked__)
|
||||
+ )
|
||||
return super().__getattribute__("_hash")
|
||||
|
||||
def __instancecheck__(self, obj: object) -> NoReturn:
|
||||
@@ -153,7 +177,8 @@ class _GenericAlias:
|
||||
"""Return ``repr(self)``."""
|
||||
args = ", ".join(_to_str(i) for i in self.__args__)
|
||||
origin = _to_str(self.__origin__)
|
||||
- return f"{origin}[{args}]"
|
||||
+ prefix = "*" if self.__unpacked__ else ""
|
||||
+ return f"{prefix}{origin}[{args}]"
|
||||
|
||||
def __getitem__(self: _T, key: object | Tuple[object, ...]) -> _T:
|
||||
"""Return ``self[key]``."""
|
||||
@@ -175,9 +200,17 @@ class _GenericAlias:
|
||||
return NotImplemented
|
||||
return (
|
||||
self.__origin__ == value.__origin__ and
|
||||
- self.__args__ == value.__args__
|
||||
+ self.__args__ == value.__args__ and
|
||||
+ self.__unpacked__ == getattr(
|
||||
+ value, "__unpacked__", self.__unpacked__
|
||||
+ )
|
||||
)
|
||||
|
||||
+ def __iter__(self: _T) -> Generator[_T, None, None]:
|
||||
+ """Return ``iter(self)``."""
|
||||
+ cls = type(self)
|
||||
+ yield cls(self.__origin__, self.__args__, True)
|
||||
+
|
||||
_ATTR_EXCEPTIONS: ClassVar[FrozenSet[str]] = frozenset({
|
||||
"__origin__",
|
||||
"__args__",
|
||||
@@ -187,6 +220,8 @@ class _GenericAlias:
|
||||
"__reduce_ex__",
|
||||
"__copy__",
|
||||
"__deepcopy__",
|
||||
+ "__unpacked__",
|
||||
+ "__typing_unpacked_tuple_args__",
|
||||
})
|
||||
|
||||
def __getattribute__(self, name: str) -> Any:
|
||||
--
|
||||
2.35.3
|
||||
|
||||
From c26f3389e0010ed7c4f6930b2472961393a44b05 Mon Sep 17 00:00:00 2001
|
||||
From: Bas van Beek <b.f.van.beek@vu.nl>
|
||||
Date: Wed, 25 May 2022 16:53:25 +0200
|
||||
Subject: [PATCH] TST: Add `npt._GenericAlias` tests for (backported) Python
|
||||
3.11 features
|
||||
|
||||
---
|
||||
numpy/typing/tests/test_generic_alias.py | 45 ++++++++++++++++++++++--
|
||||
1 file changed, 42 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/numpy/typing/tests/test_generic_alias.py b/numpy/typing/tests/test_generic_alias.py
|
||||
index 62a8d0b..786ceec 100644
|
||||
--- a/numpy/typing/tests/test_generic_alias.py
|
||||
+++ b/numpy/typing/tests/test_generic_alias.py
|
||||
@@ -10,6 +10,7 @@ from typing import TypeVar, Any, Callable, Tuple, Type, Union
|
||||
import pytest
|
||||
import numpy as np
|
||||
from numpy.typing._generic_alias import _GenericAlias
|
||||
+from typing_extensions import Unpack
|
||||
|
||||
ScalarType = TypeVar("ScalarType", bound=np.generic, covariant=True)
|
||||
T1 = TypeVar("T1")
|
||||
@@ -55,8 +56,8 @@ class TestGenericAlias:
|
||||
("__origin__", lambda n: n.__origin__),
|
||||
("__args__", lambda n: n.__args__),
|
||||
("__parameters__", lambda n: n.__parameters__),
|
||||
- ("__reduce__", lambda n: n.__reduce__()[1:]),
|
||||
- ("__reduce_ex__", lambda n: n.__reduce_ex__(1)[1:]),
|
||||
+ ("__reduce__", lambda n: n.__reduce__()[1][:3]),
|
||||
+ ("__reduce_ex__", lambda n: n.__reduce_ex__(1)[1][:3]),
|
||||
("__mro_entries__", lambda n: n.__mro_entries__([object])),
|
||||
("__hash__", lambda n: hash(n)),
|
||||
("__repr__", lambda n: repr(n)),
|
||||
@@ -66,7 +67,6 @@ class TestGenericAlias:
|
||||
("__getitem__", lambda n: n[Union[T1, T2]][np.float32, np.float64]),
|
||||
("__eq__", lambda n: n == n),
|
||||
("__ne__", lambda n: n != np.ndarray),
|
||||
- ("__dir__", lambda n: dir(n)),
|
||||
("__call__", lambda n: n((1,), np.int64, BUFFER)),
|
||||
("__call__", lambda n: n(shape=(1,), dtype=np.int64, buffer=BUFFER)),
|
||||
("subclassing", lambda n: _get_subclass_mro(n)),
|
||||
@@ -100,6 +100,45 @@ class TestGenericAlias:
|
||||
value_ref = func(NDArray_ref)
|
||||
assert value == value_ref
|
||||
|
||||
+ def test_dir(self) -> None:
|
||||
+ value = dir(NDArray)
|
||||
+ if sys.version_info < (3, 9):
|
||||
+ return
|
||||
+
|
||||
+ # A number attributes only exist in `types.GenericAlias` in >= 3.11
|
||||
+ if sys.version_info < (3, 11, 0, "beta", 3):
|
||||
+ value.remove("__typing_unpacked_tuple_args__")
|
||||
+ if sys.version_info < (3, 11, 0, "beta", 1):
|
||||
+ value.remove("__unpacked__")
|
||||
+ assert value == dir(NDArray_ref)
|
||||
+
|
||||
+ @pytest.mark.parametrize("name,func,dev_version", [
|
||||
+ ("__iter__", lambda n: len(list(n)), ("beta", 1)),
|
||||
+ ("__iter__", lambda n: next(iter(n)), ("beta", 1)),
|
||||
+ ("__unpacked__", lambda n: n.__unpacked__, ("beta", 1)),
|
||||
+ ("Unpack", lambda n: Unpack[n], ("beta", 1)),
|
||||
+
|
||||
+ # The right operand should now have `__unpacked__ = True`,
|
||||
+ # and they are thus now longer equivalent
|
||||
+ ("__ne__", lambda n: n != next(iter(n)), ("beta", 1)),
|
||||
+
|
||||
+ # >= beta3 stuff
|
||||
+ ("__typing_unpacked_tuple_args__",
|
||||
+ lambda n: n.__typing_unpacked_tuple_args__, ("beta", 3)),
|
||||
+ ])
|
||||
+ def test_py311_features(
|
||||
+ self,
|
||||
+ name: str,
|
||||
+ func: FuncType,
|
||||
+ dev_version: tuple[str, int],
|
||||
+ ) -> None:
|
||||
+ """Test Python 3.11 features."""
|
||||
+ value = func(NDArray)
|
||||
+
|
||||
+ if sys.version_info >= (3, 11, 0, *dev_version):
|
||||
+ value_ref = func(NDArray_ref)
|
||||
+ assert value == value_ref
|
||||
+
|
||||
def test_weakref(self) -> None:
|
||||
"""Test ``__weakref__``."""
|
||||
value = weakref.ref(NDArray)()
|
||||
--
|
||||
2.35.3
|
||||
|
||||
From 74868ee9bf08821fef7dc416beba312251b0bd7d Mon Sep 17 00:00:00 2001
|
||||
From: Bas van Beek <b.f.van.beek@vu.nl>
|
||||
Date: Wed, 25 May 2022 16:52:31 +0200
|
||||
Subject: [PATCH] TST: Reintroduce `typing_extensions` as a test requirement
|
||||
|
||||
---
|
||||
environment.yml | 1 +
|
||||
test_requirements.txt | 1 +
|
||||
2 files changed, 2 insertions(+)
|
||||
|
||||
diff --git a/environment.yml b/environment.yml
|
||||
index 58305e6..69c4ca0 100644
|
||||
--- a/environment.yml
|
||||
+++ b/environment.yml
|
||||
@@ -20,6 +20,7 @@ dependencies:
|
||||
- hypothesis
|
||||
# For type annotations
|
||||
- mypy=0.930
|
||||
+ - typing_extensions>=4.2.0
|
||||
# For building docs
|
||||
- sphinx=4.1.1
|
||||
- numpydoc=1.1.0
|
||||
diff --git a/test_requirements.txt b/test_requirements.txt
|
||||
index e33649c..482994a 100644
|
||||
--- a/test_requirements.txt
|
||||
+++ b/test_requirements.txt
|
||||
@@ -10,3 +10,4 @@ cffi; python_version < '3.10'
|
||||
# For testing types. Notes on the restrictions:
|
||||
# - Mypy relies on C API features not present in PyPy
|
||||
mypy==0.930; platform_python_implementation != "PyPy"
|
||||
+typing_extensions>=4.2.0
|
||||
--
|
||||
2.35.3
|
||||
|
||||
From b59d90ef101e7352c1f2e6a53114f399b5179235 Mon Sep 17 00:00:00 2001
|
||||
From: Bas van Beek <43369155+BvB93@users.noreply.github.com>
|
||||
Date: Thu, 26 May 2022 17:35:10 +0200
|
||||
Subject: [PATCH] TST: Remove the `__reduce__` tests
|
||||
|
||||
Deliberate divergence w.r.t. CPython
|
||||
---
|
||||
numpy/typing/tests/test_generic_alias.py | 2 --
|
||||
1 file changed, 2 deletions(-)
|
||||
|
||||
diff --git a/numpy/typing/tests/test_generic_alias.py b/numpy/typing/tests/test_generic_alias.py
|
||||
index 1c09097..55bd059 100644
|
||||
--- a/numpy/typing/tests/test_generic_alias.py
|
||||
+++ b/numpy/typing/tests/test_generic_alias.py
|
||||
@@ -56,8 +56,6 @@ class TestGenericAlias:
|
||||
("__origin__", lambda n: n.__origin__),
|
||||
("__args__", lambda n: n.__args__),
|
||||
("__parameters__", lambda n: n.__parameters__),
|
||||
- ("__reduce__", lambda n: n.__reduce__()[1][:3]),
|
||||
- ("__reduce_ex__", lambda n: n.__reduce_ex__(1)[1][:3]),
|
||||
("__mro_entries__", lambda n: n.__mro_entries__([object])),
|
||||
("__hash__", lambda n: hash(n)),
|
||||
("__repr__", lambda n: repr(n)),
|
||||
--
|
||||
2.35.3
|
||||
|
45
21982.patch
45
21982.patch
|
@ -1,45 +0,0 @@
|
|||
From d3ecbf3db9d4bea1426d5b90a7bcb4838cfa2bca Mon Sep 17 00:00:00 2001
|
||||
From: Bas van Beek <43369155+BvB93@users.noreply.github.com>
|
||||
Date: Thu, 14 Jul 2022 12:44:40 +0200
|
||||
Subject: [PATCH] MAINT: Do not let `_GenericAlias` wrap the underlying classes
|
||||
`__class__` attribute
|
||||
|
||||
Adapt to the 3.11b4 changes introduced in https://github.com/python/cpython/pull/93754
|
||||
---
|
||||
numpy/typing/_generic_alias.py | 1 +
|
||||
numpy/typing/tests/test_generic_alias.py | 5 ++++-
|
||||
2 files changed, 5 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/numpy/typing/_generic_alias.py b/numpy/typing/_generic_alias.py
|
||||
index cd37dd5..16cd893 100644
|
||||
--- a/numpy/typing/_generic_alias.py
|
||||
+++ b/numpy/typing/_generic_alias.py
|
||||
@@ -222,6 +222,7 @@ class _GenericAlias:
|
||||
"__deepcopy__",
|
||||
"__unpacked__",
|
||||
"__typing_unpacked_tuple_args__",
|
||||
+ "__class__",
|
||||
})
|
||||
|
||||
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 786ceec..1c09097 100644
|
||||
--- a/numpy/typing/tests/test_generic_alias.py
|
||||
+++ b/numpy/typing/tests/test_generic_alias.py
|
||||
@@ -122,9 +122,12 @@ class TestGenericAlias:
|
||||
# and they are thus now longer equivalent
|
||||
("__ne__", lambda n: n != next(iter(n)), ("beta", 1)),
|
||||
|
||||
- # >= beta3 stuff
|
||||
+ # >= beta3
|
||||
("__typing_unpacked_tuple_args__",
|
||||
lambda n: n.__typing_unpacked_tuple_args__, ("beta", 3)),
|
||||
+
|
||||
+ # >= beta4
|
||||
+ ("__class__", lambda n: n.__class__ == type(n), ("beta", 4)),
|
||||
])
|
||||
def test_py311_features(
|
||||
self,
|
||||
--
|
||||
2.35.3
|
||||
|
|
@ -0,0 +1,24 @@
|
|||
From 01b83b4d4e54881f68eb6edca6fb65b133825002 Mon Sep 17 00:00:00 2001
|
||||
From: Charles Bousseau <cbousseau@anaconda.com>
|
||||
Date: Thu, 21 Sep 2023 15:24:07 -0400
|
||||
Subject: [PATCH] align test_dispatcher s390x targets with
|
||||
_umath_tests_mtargets
|
||||
|
||||
---
|
||||
numpy/core/tests/test_cpu_dispatcher.py | 3 ++-
|
||||
1 file changed, 2 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/numpy/core/tests/test_cpu_dispatcher.py b/numpy/core/tests/test_cpu_dispatcher.py
|
||||
index 2f7eac7e8e9..41a60d5c395 100644
|
||||
--- a/numpy/core/tests/test_cpu_dispatcher.py
|
||||
+++ b/numpy/core/tests/test_cpu_dispatcher.py
|
||||
@@ -9,7 +9,8 @@ def test_dispatcher():
|
||||
targets = (
|
||||
"SSE2", "SSE41", "AVX2",
|
||||
"VSX", "VSX2", "VSX3",
|
||||
- "NEON", "ASIMD", "ASIMDHP"
|
||||
+ "NEON", "ASIMD", "ASIMDHP",
|
||||
+ "VX", "VXE"
|
||||
)
|
||||
highest_sfx = "" # no suffix for the baseline
|
||||
all_sfx = []
|
|
@ -0,0 +1,22 @@
|
|||
From 8f8a4a4a54d63ce7d9ed8aca024561e6820d8970 Mon Sep 17 00:00:00 2001
|
||||
From: Sayed Adel <seiko@imavr.com>
|
||||
Date: Fri, 22 Sep 2023 11:30:49 +0400
|
||||
Subject: [PATCH] BUG: Fix SIMD f32 trunc test on s390x when baseline is none
|
||||
|
||||
---
|
||||
numpy/core/tests/test_simd_module.py | 2 ++
|
||||
1 file changed, 2 insertions(+)
|
||||
|
||||
diff --git a/numpy/core/tests/test_simd_module.py b/numpy/core/tests/test_simd_module.py
|
||||
index 44dc58dac09..4fbaa9f3008 100644
|
||||
--- a/numpy/core/tests/test_simd_module.py
|
||||
+++ b/numpy/core/tests/test_simd_module.py
|
||||
@@ -86,6 +86,8 @@ def test_signed_overflow(self, sfx):
|
||||
assert lanes == [0] * nlanes
|
||||
|
||||
def test_truncate_f32(self):
|
||||
+ if not npyv.simd_f32:
|
||||
+ pytest.skip("F32 isn't support by the SIMD extension")
|
||||
f32 = npyv.setall_f32(0.1)[0]
|
||||
assert f32 != 0.1
|
||||
assert round(f32, 1) == 0.1
|
|
@ -0,0 +1,46 @@
|
|||
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
|
|
@ -0,0 +1,278 @@
|
|||
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
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
diff --git c/numpy/f2py/tests/test_compile_function.py i/numpy/f2py/tests/test_compile_function.py
|
||||
index 3c16f3198..e38fed898 100644
|
||||
--- c/numpy/f2py/tests/test_compile_function.py
|
||||
+++ i/numpy/f2py/tests/test_compile_function.py
|
||||
@@ -17,6 +17,10 @@ def setup_module():
|
||||
pytest.skip("Needs C compiler")
|
||||
if not util.has_f77_compiler():
|
||||
pytest.skip("Needs FORTRAN 77 compiler")
|
||||
+ if sys.version_info[:2] >= (3, 12):
|
||||
+ pytest.skip(
|
||||
+ "F2PY compilation tests do not work with meson."
|
||||
+ )
|
||||
|
||||
|
||||
# extra_args can be a list (since gh-11937) or string.
|
123
numpy.spec
123
numpy.spec
|
@ -2,7 +2,7 @@
|
|||
#%%global relc rc1
|
||||
|
||||
# Simple way to disable tests
|
||||
%if 0%{?flatpak}
|
||||
%if 0%{?flatpak} || 0%{?rhel}
|
||||
%bcond_with tests
|
||||
%else
|
||||
%bcond_without tests
|
||||
|
@ -19,25 +19,19 @@
|
|||
%global modname numpy
|
||||
|
||||
Name: numpy
|
||||
Version: 1.22.0
|
||||
Release: 7.1.riscv64%{?dist}
|
||||
Version: 1.26.0
|
||||
Release: 1.0.riscv64%{?dist}
|
||||
Epoch: 1
|
||||
Summary: A fast multidimensional array facility for Python
|
||||
|
||||
# Everything is BSD except for class SafeEval in numpy/lib/utils.py which is Python
|
||||
License: BSD and Python and ASL 2.0
|
||||
License: BSD-3-Clause AND Apache-2.0
|
||||
URL: http://www.numpy.org/
|
||||
Source0: https://github.com/%{name}/%{name}/releases/download/v%{version}/%{name}-%{version}.tar.gz
|
||||
Source1: https://numpy.org/doc/1.19/numpy-html.zip
|
||||
# Upstream issue: https://github.com/numpy/numpy/issues/21526
|
||||
Patch: 21543.patch
|
||||
# And a followup, https://github.com/numpy/numpy/pull/21605/commits/4461ec48
|
||||
# https://github.com/numpy/numpy/pull/21605/commits/2bb09680
|
||||
# https://github.com/numpy/numpy/pull/21605/commits/46826998
|
||||
# https://github.com/numpy/numpy/pull/21605/commits/f3fd03f3
|
||||
Patch: 21605.patch
|
||||
# Python 3.11.0b4 fix, https://github.com/numpy/numpy/pull/21982
|
||||
Patch: 21982.patch
|
||||
Source1: https://numpy.org/doc/%(echo %{version} | cut -d. -f1-2)/numpy-html.zip
|
||||
Patch0: f2py_test.patch
|
||||
Patch1: 24772.patch
|
||||
Patch2: 24776.patch
|
||||
|
||||
%description
|
||||
NumPy is a general-purpose array-processing package designed to
|
||||
|
@ -55,7 +49,7 @@ this package is a version of f2py that works properly with NumPy.
|
|||
%package -n python3-numpy
|
||||
Summary: A fast multidimensional array facility for Python
|
||||
|
||||
License: BSD
|
||||
License: BSD-3-Clause
|
||||
%{?python_provide:%python_provide python3-numpy}
|
||||
Provides: libnpymath-static = %{epoch}:%{version}-%{release}
|
||||
Provides: libnpymath-static%{?_isa} = %{epoch}:%{version}-%{release}
|
||||
|
@ -65,9 +59,12 @@ Obsoletes: numpy < 1:1.10.1-3
|
|||
|
||||
BuildRequires: python3-devel
|
||||
BuildRequires: python3-setuptools
|
||||
BuildRequires: python3-pip
|
||||
BuildRequires: python3-Cython
|
||||
BuildRequires: python3-pyproject-metadata
|
||||
BuildRequires: gcc-gfortran gcc gcc-c++
|
||||
BuildRequires: lapack-devel
|
||||
BuildRequires: ninja-build
|
||||
%if %{with tests}
|
||||
BuildRequires: python3-hypothesis
|
||||
BuildRequires: python3-pytest
|
||||
|
@ -75,6 +72,7 @@ BuildRequires: python3-test
|
|||
BuildRequires: python3-typing-extensions
|
||||
%endif
|
||||
BuildRequires: %{blaslib}-devel
|
||||
BuildRequires: chrpath
|
||||
|
||||
%description -n python3-numpy
|
||||
NumPy is a general-purpose array-processing package designed to
|
||||
|
@ -114,9 +112,6 @@ This package provides the complete documentation for NumPy.
|
|||
%prep
|
||||
%autosetup -n %{name}-%{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
|
||||
|
@ -128,11 +123,7 @@ EOF
|
|||
%build
|
||||
%set_build_flags
|
||||
|
||||
env OPENBLAS=%{_libdir} \
|
||||
BLAS=%{_libdir} \
|
||||
LAPACK=%{_libdir} CFLAGS="%{optflags}" \
|
||||
SETUPTOOLS_USE_DISTUTILS=stdlib
|
||||
%{__python3} setup.py build
|
||||
%pyproject_wheel -Csetup-args=-Dblas=flexiblas -Csetup-args=-Dlapack=lapack
|
||||
|
||||
%install
|
||||
mkdir docs
|
||||
|
@ -140,14 +131,10 @@ pushd docs
|
|||
unzip %{SOURCE1}
|
||||
popd
|
||||
|
||||
#%%{__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}" \
|
||||
SETUPTOOLS_USE_DISTUTILS=stdlib
|
||||
%{__python3} setup.py install --root %{buildroot}
|
||||
%pyproject_install
|
||||
pushd %{buildroot}%{_bindir} &> /dev/null
|
||||
ln -s f2py f2py3
|
||||
ln -s f2py f2py3.12
|
||||
ln -s f2py3 f2py.numpy
|
||||
popd &> /dev/null
|
||||
|
||||
|
@ -158,29 +145,22 @@ ln -s %{python3_sitearch}/%{name}/core/include/numpy/ %{buildroot}%{_includedir}
|
|||
|
||||
%check
|
||||
%if %{with tests}
|
||||
# core/tests/test_cython.py and random/tests/test_extending.py
|
||||
# fail due to setuptools-bundled distutils' LooseVersion issue:
|
||||
# https://github.com/pypa/distutils/issues/122
|
||||
# This can be worked around by setting the environment variable to point
|
||||
# to distutils from Python's standard library instead.
|
||||
# The workaround may be removed once numpy includes the commit removing
|
||||
# LooseVersion into release: https://github.com/numpy/numpy/pull/21000
|
||||
export SETUPTOOLS_USE_DISTUTILS=stdlib
|
||||
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
|
||||
# test_to_int_scalar is disabled for compatibility with Python 3.11
|
||||
# Downstream issue: https://bugzilla.redhat.com/show_bug.cgi?id=2046668
|
||||
# Some GenericAlias tests are still failing, even with upstream patch, hence we skip them below.
|
||||
# Upstream issue: https://github.com/numpy/numpy/issues/21526
|
||||
%ifarch %{ix86}
|
||||
# Weird RuntimeWarnings on i686, siilar to https://github.com/numpy/numpy/issues/13173
|
||||
%global ix86_k and not test_vector_matrix_values and not test_matrix_vector_values
|
||||
# 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
|
||||
%ifarch riscv64
|
||||
%global riscv64_k and not test_fpclass and not (TestBoolCmp and test_float)
|
||||
%endif
|
||||
python3 runtests.py --no-build -- -ra -k 'not test_ppc64_ibm_double_double128 and not test_to_int_scalar and not (GenericAlias and test_pass and __dir__) %{?ix86_k} %{?riscv64_k}'
|
||||
%ifnarch %{ix86}
|
||||
python3 runtests.py --no-build -- -ra -k 'not test_ppc64_ibm_double_double128 %{?ix86_k} %{?riscv64_k}' \
|
||||
-W "ignore:pkg_resources is deprecated as an API::pkg_resources"
|
||||
%endif
|
||||
|
||||
%endif
|
||||
|
||||
|
||||
|
@ -191,7 +171,6 @@ python3 runtests.py --no-build -- -ra -k 'not test_ppc64_ibm_double_double128 an
|
|||
%dir %{python3_sitearch}/%{name}
|
||||
%{python3_sitearch}/%{name}/*.py*
|
||||
%{python3_sitearch}/%{name}/core
|
||||
%{python3_sitearch}/%{name}/distutils
|
||||
%{python3_sitearch}/%{name}/doc
|
||||
%{python3_sitearch}/%{name}/fft
|
||||
%{python3_sitearch}/%{name}/lib
|
||||
|
@ -203,14 +182,16 @@ python3 runtests.py --no-build -- -ra -k 'not test_ppc64_ibm_double_double128 an
|
|||
%{python3_sitearch}/%{name}/compat
|
||||
%{python3_sitearch}/%{name}/matrixlib
|
||||
%{python3_sitearch}/%{name}/polynomial
|
||||
%{python3_sitearch}/%{name}-*.egg-info
|
||||
%exclude %{python3_sitearch}/%{name}/LICENSE.txt
|
||||
%{python3_sitearch}/%{name}-*.dist-info
|
||||
%{_includedir}/numpy
|
||||
%{python3_sitearch}/%{name}/__init__.pxd
|
||||
%{python3_sitearch}/%{name}/__init__.cython-30.pxd
|
||||
%{python3_sitearch}/%{name}/py.typed
|
||||
%{python3_sitearch}/%{name}/typing/
|
||||
%{python3_sitearch}/%{name}/array_api/
|
||||
%{python3_sitearch}/%{name}/_pyinstaller/
|
||||
%{python3_sitearch}/%{name}/_typing/
|
||||
%{python3_sitearch}/%{name}/_utils/
|
||||
|
||||
%files -n python3-numpy-f2py
|
||||
%{_bindir}/f2py
|
||||
|
@ -224,11 +205,49 @@ python3 runtests.py --no-build -- -ra -k 'not test_ppc64_ibm_double_double128 an
|
|||
|
||||
|
||||
%changelog
|
||||
* Wed Sep 21 2022 David Abdurachmanov <davidlt@rivosinc.com> - 1:1.22.0-7.1.riscv64
|
||||
- Skips specific failing riscv64 tests only
|
||||
* Sat Oct 21 2023 David Abdurachmanov <davidlt@rivosinc.com> - 1:1.26.0-1.0.riscv64
|
||||
- Skip failing tests on riscv64
|
||||
|
||||
* Wed Sep 21 2022 David Abdurachmanov <davidlt@rivosinc.com> - 1:1.22.0-7.0.riscv64
|
||||
- Ignore testsuite errors for riscv64
|
||||
* Tue Sep 19 2023 Gwyn Ciesla <gwync@protonmail.com> - 1:1.26.0-1
|
||||
- 1.26.0
|
||||
|
||||
* Mon Jul 31 2023 Miro Hrončok <mhroncok@redhat.com> - 1:1.24.4-2
|
||||
- Backport support for Cython 3
|
||||
|
||||
* Tue Jul 18 2023 Gwyn Ciesla <gwync@protonmail.com> - 1:1.24.4-1
|
||||
- 1.24.4
|
||||
|
||||
* Wed Jul 05 2023 Scott Talbert <swt@techie.net> - 1:1.24.3-4
|
||||
- Fix FTBFS with Python 3.12
|
||||
|
||||
* Fri Jun 16 2023 Python Maint <python-maint@redhat.com> - 1:1.24.3-3
|
||||
- Rebuilt for Python 3.12
|
||||
|
||||
* Tue Jun 13 2023 Python Maint <python-maint@redhat.com> - 1:1.24.3-2
|
||||
- Bootstrap for Python 3.12
|
||||
|
||||
* Mon Apr 24 2023 Gwyn Ciesla <gwync@protonmail.com> - 1:1.24.3-1
|
||||
- 1.24.3
|
||||
|
||||
* Wed Mar 08 2023 Gwyn Ciesla <gwync@protonmail.com> - 1:1.24.1-3
|
||||
- migrated to SPDX license
|
||||
|
||||
* Fri Jan 27 2023 Pavel Simovec <psimovec@redhat.com> - 1:1.24.1-2
|
||||
- Generalize documentation Source link
|
||||
- Add forgotten documentation file
|
||||
|
||||
* Thu Jan 26 2023 Pavel Simovec <psimovec@redhat.com> - 1:1.24.1-1
|
||||
- Update to 1.24.1
|
||||
|
||||
* Thu Jan 19 2023 Fedora Release Engineering <releng@fedoraproject.org> - 1:1.23.5-2
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild
|
||||
|
||||
* Fri Dec 02 2022 Charalampos Stratakis <cstratak@redhat.com> - 1:1.23.5-1
|
||||
- Update to 1.23.5
|
||||
|
||||
* Fri Oct 21 2022 Miro Hrončok <mhroncok@redhat.com> - 1:1.23.4-1
|
||||
- Update to 1.23.4
|
||||
- Use distutils from setuptools to build the package
|
||||
|
||||
* Fri Jul 22 2022 Fedora Release Engineering <releng@fedoraproject.org> - 1:1.22.0-7
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
|
||||
|
|
4
sources
4
sources
|
@ -1,2 +1,2 @@
|
|||
SHA512 (numpy-1.22.0.tar.gz) = 368b2cf0bee4dd7fb7d6db96d87984ff4235f0286534149cbe6597e9b690bc8a6643b71d067e43b9190a3186325423b84441c1659a6681adf8a03231c60f51bf
|
||||
SHA512 (numpy-html.zip) = 4a421636523424a0703290b6a0ba53b85a9a9e8a6256363e2481f1c02ae278825c09f2f13d39e99f8aae21f57a4978723f3fc690693520f8c3b45a5b4c5a38ab
|
||||
SHA512 (numpy-1.26.0.tar.gz) = 0d500c623b274a219740c78ae2febb32a2f167016a9ff529678526e6b3e89a5b732c41defa23460a5da6f7f89d4a7d827f44fa9a1334c78e204b00ce164fb40c
|
||||
SHA512 (numpy-html.zip) = 9c38a65fd33be28cec9a27d2b23b50cb215fe7fd775f467a78a21f4649466868a24b6004ebf1b31e0eca62c2e5582e89923ff2bb4b3ae70dfa9292672e7b1eca
|
||||
|
|
Loading…
Reference in New Issue