Blame SPECS/python3.11-numpy.spec

70a5f8
%global __python3 /usr/bin/python3.11
70a5f8
%global python3_pkgversion 3.11
70a5f8
70a5f8
#uncomment next line for a release candidate or a beta
70a5f8
#%%global relc rc1
70a5f8
70a5f8
# RHEL: Tests disabled due to missing dependencies
70a5f8
%bcond_with tests
70a5f8
70a5f8
%if 0%{?fedora} >= 33 || 0%{?rhel} >= 9
70a5f8
%global blaslib flexiblas
70a5f8
%global blasvar %{nil}
70a5f8
%else
70a5f8
%global blaslib openblas
70a5f8
%global blasvar p
70a5f8
%endif
70a5f8
70a5f8
%global modname numpy
70a5f8
70a5f8
Name:           python%{python3_pkgversion}-numpy
70a5f8
Version:        1.23.5
70a5f8
Release:        1%{?dist}
70a5f8
Summary:        A fast multidimensional array facility for Python
70a5f8
70a5f8
# Everything is BSD except for class SafeEval in numpy/lib/utils.py which is Python
70a5f8
License:        BSD and Python and ASL 2.0
70a5f8
URL:            http://www.numpy.org/
70a5f8
Source0:        https://github.com/%{modname}/%{modname}/releases/download/v%{version}/%{modname}-%{version}.tar.gz
70a5f8
70a5f8
BuildRequires:  python%{python3_pkgversion}-devel
70a5f8
BuildRequires:  python%{python3_pkgversion}-rpm-macros
70a5f8
BuildRequires:  python%{python3_pkgversion}-setuptools
70a5f8
BuildRequires:  python%{python3_pkgversion}-Cython
70a5f8
BuildRequires:  gcc-gfortran gcc gcc-c++
70a5f8
BuildRequires:  lapack-devel
70a5f8
%if %{with tests}
70a5f8
BuildRequires:  python%{python3_pkgversion}-hypothesis
70a5f8
BuildRequires:  python%{python3_pkgversion}-pytest
70a5f8
BuildRequires:  python%{python3_pkgversion}-test
70a5f8
BuildRequires:  python%{python3_pkgversion}-typing-extensions
70a5f8
%endif
70a5f8
BuildRequires: %{blaslib}-devel
70a5f8
BuildRequires: chrpath
70a5f8
70a5f8
%description
70a5f8
NumPy is a general-purpose array-processing package designed to
70a5f8
efficiently manipulate large multi-dimensional arrays of arbitrary
70a5f8
records without sacrificing too much speed for small multi-dimensional
70a5f8
arrays.  NumPy is built on the Numeric code base and adds features
70a5f8
introduced by numarray as well as an extended C-API and the ability to
70a5f8
create arrays of arbitrary type.
70a5f8
70a5f8
There are also basic facilities for discrete fourier transform,
70a5f8
basic linear algebra and random number generation. Also included in
70a5f8
this package is a version of f2py that works properly with NumPy.
70a5f8
70a5f8
70a5f8
%package -n python%{python3_pkgversion}-numpy-f2py
70a5f8
Summary:        f2py for numpy
70a5f8
Requires:       python%{python3_pkgversion}-numpy%{?_isa} = %{version}-%{release}
70a5f8
Requires:       python%{python3_pkgversion}-devel
70a5f8
Provides:       python%{python3_pkgversion}-f2py = %{version}-%{release}
70a5f8
70a5f8
%description -n python%{python3_pkgversion}-numpy-f2py
70a5f8
This package includes a version of f2py that works properly with NumPy.
70a5f8
70a5f8
%prep
70a5f8
%autosetup -n %{modname}-%{version} -p1
70a5f8
70a5f8
# Force re-cythonization (ifed for PKG-INFO presence in setup.py)
70a5f8
rm PKG-INFO
70a5f8
70a5f8
# openblas is provided by flexiblas by default; otherwise,
70a5f8
# Use openblas pthreads as recommended by upstream (see comment in site.cfg.example)
70a5f8
cat >> site.cfg <
70a5f8
[openblas]
70a5f8
libraries = %{blaslib}%{blasvar}
70a5f8
library_dirs = %{_libdir}
70a5f8
EOF
70a5f8
70a5f8
%build
70a5f8
%set_build_flags
70a5f8
70a5f8
env OPENBLAS=%{_libdir} \
70a5f8
    BLAS=%{_libdir} \
70a5f8
    LAPACK=%{_libdir} CFLAGS="%{optflags}" \
70a5f8
    %{__python3} setup.py build
70a5f8
70a5f8
%install
70a5f8
#%%{__python3} setup.py install -O1 --skip-build --root %%{buildroot}
70a5f8
# skip-build currently broken, this works around it for now
70a5f8
env OPENBLAS=%{_libdir} \
70a5f8
    FFTW=%{_libdir} BLAS=%{_libdir} \
70a5f8
    LAPACK=%{_libdir} CFLAGS="%{optflags}" \
70a5f8
    %{__python3} setup.py install --root %{buildroot} --prefix=%{_prefix}
70a5f8
pushd %{buildroot}%{_bindir} &> /dev/null
70a5f8
# Remove unversioned binaries
70a5f8
rm f2py
70a5f8
rm f2py3
70a5f8
popd &> /dev/null
70a5f8
70a5f8
70a5f8
# distutils from setuptools don't have the patch that was created to avoid standard runpath here
70a5f8
# we strip it manually instead
70a5f8
# ERROR   0001: file '...' contains a standard runpath '/usr/lib64' in [/usr/lib64]
70a5f8
chrpath --delete %{buildroot}%{python3_sitearch}/%{modname}/core/_multiarray_umath.*.so
70a5f8
chrpath --delete %{buildroot}%{python3_sitearch}/%{modname}/linalg/lapack_lite.*.so
70a5f8
chrpath --delete %{buildroot}%{python3_sitearch}/%{modname}/linalg/_umath_linalg.*.so
70a5f8
70a5f8
%check
70a5f8
%if %{with tests}
70a5f8
export PYTHONPATH=%{buildroot}%{python3_sitearch}
70a5f8
# test_ppc64_ibm_double_double128 is unnecessary now that ppc64le has switched long doubles to IEEE format.
70a5f8
# https://github.com/numpy/numpy/issues/21094
70a5f8
%ifarch %{ix86}
70a5f8
# Weird RuntimeWarnings on i686, similar to https://github.com/numpy/numpy/issues/13173
70a5f8
# Some tests also overflow on 32bit
70a5f8
%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)
70a5f8
%endif
70a5f8
%{__python3} runtests.py -v --no-build -- -ra -k 'not test_ppc64_ibm_double_double128 %{?ix86_k}'
70a5f8
%endif
70a5f8
70a5f8
70a5f8
%files -n python%{python3_pkgversion}-numpy
70a5f8
%license LICENSE.txt
70a5f8
%doc THANKS.txt site.cfg.example
70a5f8
%{python3_sitearch}/%{modname}/__pycache__/
70a5f8
%dir %{python3_sitearch}/%{modname}
70a5f8
%{python3_sitearch}/%{modname}/*.py*
70a5f8
%{python3_sitearch}/%{modname}/core
70a5f8
%{python3_sitearch}/%{modname}/distutils
70a5f8
%{python3_sitearch}/%{modname}/doc
70a5f8
%{python3_sitearch}/%{modname}/fft
70a5f8
%{python3_sitearch}/%{modname}/lib
70a5f8
%{python3_sitearch}/%{modname}/linalg
70a5f8
%{python3_sitearch}/%{modname}/ma
70a5f8
%{python3_sitearch}/%{modname}/random
70a5f8
%{python3_sitearch}/%{modname}/testing
70a5f8
%{python3_sitearch}/%{modname}/tests
70a5f8
%{python3_sitearch}/%{modname}/compat
70a5f8
%{python3_sitearch}/%{modname}/matrixlib
70a5f8
%{python3_sitearch}/%{modname}/polynomial
70a5f8
%{python3_sitearch}/%{modname}-*.egg-info
70a5f8
%exclude %{python3_sitearch}/%{modname}/LICENSE.txt
70a5f8
%{python3_sitearch}/%{modname}/__init__.pxd
70a5f8
%{python3_sitearch}/%{modname}/__init__.cython-30.pxd
70a5f8
%{python3_sitearch}/%{modname}/py.typed
70a5f8
%{python3_sitearch}/%{modname}/typing/
70a5f8
%{python3_sitearch}/%{modname}/array_api/
70a5f8
%{python3_sitearch}/%{modname}/_pyinstaller/
70a5f8
%{python3_sitearch}/%{modname}/_typing/
70a5f8
70a5f8
%files -n python%{python3_pkgversion}-numpy-f2py
70a5f8
%{_bindir}/f2py%{python3_pkgversion}
70a5f8
%{python3_sitearch}/%{modname}/f2py
70a5f8
70a5f8
70a5f8
%changelog
70a5f8
* Fri Dec 02 2022 Charalampos Stratakis <cstratak@redhat.com> - 1.23.5-1
70a5f8
- Initial package
70a5f8
- Fedora contributions by:
70a5f8
      Bill Nottingham <notting@fedoraproject.org>
70a5f8
      Charalampos Stratakis <cstratak@redhat.com>
70a5f8
      Christian Dersch <lupinix@mailbox.org>
70a5f8
      Dan Horák <sharkcz@fedoraproject.org>
70a5f8
      David Malcolm <dmalcolm@redhat.com>
70a5f8
      David Tardon <dtardon@redhat.com>
70a5f8
      Deji Akingunola <deji@fedoraproject.org>
70a5f8
      Dennis Gilmore <dennis@ausil.us>
70a5f8
      Elliott Sales de Andrade <quantum.analyst@gmail.com>
70a5f8
      Gwyn Ciesla <limburgher@gmail.com>
70a5f8
      Ignacio Vazquez-Abrams <ivazquez@fedoraproject.org>
70a5f8
      Iñaki Úcar <iucar@fedoraproject.org>
70a5f8
      Iryna Shcherbina <shcherbina.iryna@gmail.com>
70a5f8
      Jarod Wilson <jwilson@fedoraproject.org>
70a5f8
      Jaromir Capik <jcapik@redhat.com>
70a5f8
      Jef Spaleta <jspaleta@fedoraproject.org>
70a5f8
      Jesse Keating <jkeating@fedoraproject.org>
70a5f8
      Jon Ciesla <limb@fedoraproject.org>
70a5f8
      Kalev Lember <klember@redhat.com>
70a5f8
      Karolina Surma <ksurma@redhat.com>
70a5f8
      Lumir Balhar <lbalhar@redhat.com>
70a5f8
      Merlin Mathesius <mmathesi@redhat.com>
70a5f8
      Miro Hrončok <miro@hroncok.cz>
70a5f8
      Nikola Forró <nforro@redhat.com>
70a5f8
      Orion Poplawski <orion@nwra.com>
70a5f8
      Pavel Šimovec <psimovec@redhat.com>
70a5f8
      Peter Robinson <pbrobinson@fedoraproject.org>
70a5f8
      Robert Kuska <rkuska@redhat.com>
70a5f8
      Simone Caronni <negativo17@gmail.com>
70a5f8
      Thomas Spura <tomspur@fedoraproject.org>
70a5f8
      Tomáš Hrnčiar <thrnciar@redhat.com>
70a5f8
      Tomas Orsava <torsava@redhat.com>
70a5f8
      Tomas Tomecek <ttomecek@redhat.com>
70a5f8
      Ville Skyttä <scop@fedoraproject.org>