From 1c5e401d094bde1090932db43a25c997d3ec035d Mon Sep 17 00:00:00 2001 From: Heng Qi Date: Tue, 11 Apr 2023 19:13:11 +0800 Subject: [PATCH] Refactor the spec file Signed-off-by: Heng Qi --- numpy.spec | 153 +++++++++++++++++++++-------------------------------- 1 file changed, 61 insertions(+), 92 deletions(-) diff --git a/numpy.spec b/numpy.spec index 8d96d9f..279d9e0 100644 --- a/numpy.spec +++ b/numpy.spec @@ -1,34 +1,26 @@ -%define anolis_release 2 +%define anolis_release 3 %bcond_with tests %global blaslib flexiblas %global blasvar %{nil} -%global modname numpy Name: numpy +Summary: A fast multidimensional array facility for Python Version: 1.24.2 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/ +URL: http://www.%{name}.org/ Source0: https://github.com/%{name}/%{name}/releases/download/v%{version}/%{name}-%{version}.tar.gz -Source1: https://numpy.org/doc/1.24/numpy-html.zip +Source1: https://%{name}.org/doc/1.24/%{name}-html.zip %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. - +NumPy is a community-driven open source project developed by +a diverse group of contributors. The NumPy leadership has made a +strong commitment to creating an open, inclusive, and positive +community. Please read the NumPy Code of Conduct for guidance on +how to interact with others in a way that makes our community thrive. %package -n python3-numpy Summary: A fast multidimensional array facility for Python @@ -39,61 +31,53 @@ 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 >= 0.29.30 -BuildRequires: gcc-gfortran gcc gcc-c++ -BuildRequires: lapack-devel +BuildRequires: gcc gcc-c++ gcc-gfortran +BuildRequires: python3-devel python3-setuptools lapack-devel %{blaslib}-devel python3-Cython >= 0.29.30 %if %{with tests} -BuildRequires: python3-hypothesis -BuildRequires: python3-pytest -BuildRequires: python3-test +BuildRequires: python3-pytest python3-hypothesis 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. +Python3-numpy is a Python package that provides support for the creation +and manipulation of arrays and matrices. It is designed to be efficient +and can handle large, multi-dimensional arrays and matrices with ease. +It also includes mathematical functions for performing operations on these arrays. %package -n python3-numpy-f2py -Summary: f2py for numpy -Requires: python3-numpy = %{epoch}:%{version}-%{release} -Requires: python3-devel +Summary: f2py for %{name} +Requires: python3-%{name} = %{epoch}:%{version}-%{release} Provides: python3-f2py = %{version}-%{release} +Requires: python3-devel 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. +%description -n python3-%{name}-f2py +python3-numpy-f2py is a package in Python 3 that provides the f2py utility for NumPy. +f2py is a tool that is used to wrap Fortran code in Python. It is often used for +numerical and scientific computing tasks, as Fortran is a high-performance language +that is particularly well-suited for these types of calculations. -%package -n python3-numpy-doc -Summary: Documentation for numpy +The python3-numpy-f2py package is a dependency of NumPy, which is a popular Python +library for numerical computing. It is used to interface with existing Fortran code, +making it easier to use with Python. By using f2py, users can call Fortran routines +in their Python code, and pass data back and forth between the two languages. + +%package -n python3-%{name}-doc +Summary: Documentation for %{name} Requires: python3-numpy = %{epoch}:%{version}-%{release} BuildArch: noarch -%description -n python3-numpy-doc -This package provides the complete documentation for NumPy. - +%description -n python3-%{name}-doc +Document package for %{EVR} %prep -%autosetup -n %{name}-%{version} -p1 +%autosetup -p1 -n %{name}-%{version} -# 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 +ln -s %{python3_sitearch}/%{name}/core/include/%{name}/ \ + %{buildroot}%{_includedir}/%{name} %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 -# 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' +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 +%files -n python3-%{name} +%license LICENSE.* %{python3_sitearch}/%{name}/__pycache__ %dir %{python3_sitearch}/%{name} +%{_includedir}/%{name} +%{python3_sitearch}/%{name}/ma +%{python3_sitearch}/%{name}/random +%{python3_sitearch}/%{name}/testing +%{python3_sitearch}/%{name}/tests +%{python3_sitearch}/%{name}/compat %{python3_sitearch}/%{name}/*.py* %{python3_sitearch}/%{name}/core %{python3_sitearch}/%{name}/distutils @@ -163,16 +136,9 @@ python3 runtests.py --no-build -- -ra -k 'not test_ppc64_ibm_double_double128 an %{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 @@ -180,19 +146,22 @@ python3 runtests.py --no-build -- -ra -k 'not test_ppc64_ibm_double_double128 an %{python3_sitearch}/%{name}/array_api/ %{python3_sitearch}/%{name}/_pyinstaller/ %{python3_sitearch}/%{name}/_typing/ +%exclude %{python3_sitearch}/%{name}/LICENSE.txt -%files -n python3-numpy-f2py +%files -n python3-%{name}-f2py +%{python3_sitearch}/%{name}/f2py %{_bindir}/f2py %{_bindir}/f2py3 -%{_bindir}/f2py.numpy +%{_bindir}/f2py.%{name} %{_bindir}/f2py%{python3_version} -%{python3_sitearch}/%{name}/f2py - -%files -n python3-numpy-doc -%doc docs/* +%files -n python3-%{name}-doc +%doc docs/* THANKS.* site.cfg.example %changelog +* Tue Apr 11 2023 Heng Qi - 1:1.24.2-3 +- Refactor the spec file + * Wed Mar 29 2023 mgb01105731 - 1:1.24.2-2 - Del Specific Fields -- Gitee