Compare commits
8 Commits
b8acd8cd2b
...
fcc064a276
Author | SHA1 | Date |
---|---|---|
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 |
|
@ -88,3 +88,6 @@ 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
|
||||
|
|
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
|
||||
|
65
numpy.spec
65
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,8 +19,8 @@
|
|||
%global modname numpy
|
||||
|
||||
Name: numpy
|
||||
Version: 1.22.0
|
||||
Release: 7%{?dist}
|
||||
Version: 1.24.1
|
||||
Release: 2%{?dist}
|
||||
Epoch: 1
|
||||
Summary: A fast multidimensional array facility for Python
|
||||
|
||||
|
@ -28,16 +28,7 @@ Summary: A fast multidimensional array facility for Python
|
|||
License: BSD and Python and ASL 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
|
||||
|
||||
%description
|
||||
NumPy is a general-purpose array-processing package designed to
|
||||
|
@ -75,6 +66,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
|
||||
|
@ -131,7 +123,6 @@ EOF
|
|||
env OPENBLAS=%{_libdir} \
|
||||
BLAS=%{_libdir} \
|
||||
LAPACK=%{_libdir} CFLAGS="%{optflags}" \
|
||||
SETUPTOOLS_USE_DISTUTILS=stdlib
|
||||
%{__python3} setup.py build
|
||||
|
||||
%install
|
||||
|
@ -145,7 +136,6 @@ popd
|
|||
env OPENBLAS=%{_libdir} \
|
||||
FFTW=%{_libdir} BLAS=%{_libdir} \
|
||||
LAPACK=%{_libdir} CFLAGS="%{optflags}" \
|
||||
SETUPTOOLS_USE_DISTUTILS=stdlib
|
||||
%{__python3} setup.py install --root %{buildroot} --prefix=%{_prefix}
|
||||
pushd %{buildroot}%{_bindir} &> /dev/null
|
||||
ln -s f2py3 f2py.numpy
|
||||
|
@ -155,29 +145,25 @@ popd &> /dev/null
|
|||
mkdir -p %{buildroot}%{_includedir}
|
||||
ln -s %{python3_sitearch}/%{name}/core/include/numpy/ %{buildroot}%{_includedir}/numpy
|
||||
|
||||
# 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}/%{name}/core/_multiarray_umath.*.so
|
||||
chrpath --delete %{buildroot}%{python3_sitearch}/%{name}/linalg/lapack_lite.*.so
|
||||
chrpath --delete %{buildroot}%{python3_sitearch}/%{name}/linalg/_umath_linalg.*.so
|
||||
|
||||
|
||||
%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
|
||||
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}'
|
||||
python3 runtests.py --no-build -- -ra -k 'not test_ppc64_ibm_double_double128 %{?ix86_k}'
|
||||
%endif
|
||||
|
||||
|
||||
|
@ -208,6 +194,8 @@ python3 runtests.py --no-build -- -ra -k 'not test_ppc64_ibm_double_double128 an
|
|||
%{python3_sitearch}/%{name}/py.typed
|
||||
%{python3_sitearch}/%{name}/typing/
|
||||
%{python3_sitearch}/%{name}/array_api/
|
||||
%{python3_sitearch}/%{name}/_pyinstaller/
|
||||
%{python3_sitearch}/%{name}/_typing/
|
||||
|
||||
%files -n python3-numpy-f2py
|
||||
%{_bindir}/f2py
|
||||
|
@ -221,6 +209,23 @@ python3 runtests.py --no-build -- -ra -k 'not test_ppc64_ibm_double_double128 an
|
|||
|
||||
|
||||
%changelog
|
||||
* 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.24.1.tar.gz) = 34cafe2b0776f47887e3fa01beb9f4d427deec650d0b1a2658674a9c304e6429fdbea10945ba515431ca3fca5e70c56344220b9f9055de6659666b2df272d0fb
|
||||
SHA512 (numpy-html.zip) = 9c38a65fd33be28cec9a27d2b23b50cb215fe7fd775f467a78a21f4649466868a24b6004ebf1b31e0eca62c2e5582e89923ff2bb4b3ae70dfa9292672e7b1eca
|
||||
|
|
Loading…
Reference in New Issue