diff --git a/21543.patch b/21543.patch new file mode 100644 index 0000000000000000000000000000000000000000..68c9654e3b44ebe762a8207b73eac2e1d2426a61 --- /dev/null +++ b/21543.patch @@ -0,0 +1,54 @@ +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 +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)) diff --git a/numpy-1.22.0.tar.gz b/numpy-1.22.0.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..ef7c82f769b0056ab3321de9a1ab2aa17cb5b7ec Binary files /dev/null and b/numpy-1.22.0.tar.gz differ diff --git a/numpy-html.zip b/numpy-html.zip new file mode 100644 index 0000000000000000000000000000000000000000..bef3f267502e88670c79b3f582cea08b348d912a Binary files /dev/null and b/numpy-html.zip differ diff --git a/numpy.spec b/numpy.spec new file mode 100644 index 0000000000000000000000000000000000000000..a790d3d80eae7f11d68562cbda121591cce9243f --- /dev/null +++ b/numpy.spec @@ -0,0 +1,198 @@ +%define anolis_release 1 + +%bcond_with tests +%global blaslib flexiblas +%global blasvar %{nil} +%global modname numpy + +Name: numpy +Version: 1.22.0 +Release: %{anolis_release}%{?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 +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 +Patch0: 21543.patch + +%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 python3-numpy +Summary: A fast multidimensional array facility for Python + +License: BSD +%{?python_provide:%python_provide python3-numpy} +Provides: libnpymath-static = %{epoch}:%{version}-%{release} +Provides: numpy = %{epoch}:%{version}-%{release} +Obsoletes: numpy < 1:1.10.1-3 + +BuildRequires: python3-devel +BuildRequires: python3-setuptools +BuildRequires: python3-Cython +BuildRequires: gcc-gfortran gcc gcc-c++ +BuildRequires: lapack-devel +%if %{with tests} +BuildRequires: python3-hypothesis +BuildRequires: python3-pytest +BuildRequires: python3-test +%endif +BuildRequires: %{blaslib}-devel + +%description -n python3-numpy +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 python3-numpy-f2py +Summary: f2py for numpy +Requires: python3-numpy = %{epoch}:%{version}-%{release} +Requires: python3-devel +Provides: python3-f2py = %{version}-%{release} +Obsoletes: python3-f2py <= 2.45.241_1927 +%{?python_provide:%python_provide python3-numpy-f2py} +Provides: f2py = %{epoch}:%{version}-%{release} +Provides: numpy-f2py = %{epoch}:%{version}-%{release} +Obsoletes: numpy-f2py < 1:1.10.1-3 + +%description -n python3-numpy-f2py +This package includes a version of f2py that works properly with NumPy. + +%package -n python3-numpy-doc +Summary: Documentation for numpy +Requires: python3-numpy = %{epoch}:%{version}-%{release} +BuildArch: noarch + +%description -n python3-numpy-doc +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 < /dev/null +ln -s f2py3 f2py.numpy +popd &> /dev/null + +#symlink for includes, BZ 185079 +mkdir -p %{buildroot}%{_includedir} +ln -s %{python3_sitearch}/%{name}/core/include/numpy/ %{buildroot}%{_includedir}/numpy + + +%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 +python3 runtests.py --no-build -- -ra -k 'not test_ppc64_ibm_double_double128 and not test_to_int_scalar' +%endif + + +%files -n python3-numpy +%license LICENSE.txt +%doc THANKS.txt site.cfg.example +%{python3_sitearch}/%{name}/__pycache__ +%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 +%{python3_sitearch}/%{name}/linalg +%{python3_sitearch}/%{name}/ma +%{python3_sitearch}/%{name}/random +%{python3_sitearch}/%{name}/testing +%{python3_sitearch}/%{name}/tests +%{python3_sitearch}/%{name}/compat +%{python3_sitearch}/%{name}/matrixlib +%{python3_sitearch}/%{name}/polynomial +%{python3_sitearch}/%{name}-*.egg-info +%exclude %{python3_sitearch}/%{name}/LICENSE.txt +%{_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/ + +%files -n python3-numpy-f2py +%{_bindir}/f2py +%{_bindir}/f2py3 +%{_bindir}/f2py.numpy +%{_bindir}/f2py%{python3_version} +%{python3_sitearch}/%{name}/f2py + +%files -n python3-numpy-doc +%doc docs/* + + +%changelog +* Tue Jul 12 2022 happy_orange - 1:1.22.0-1 +- Init pcakage from upstream