Blame SPECS/python3.11-scipy.spec

791062
%global __python3 /usr/bin/python3.11
791062
%global python3_pkgversion 3.11
791062
791062
# Pythran is an optional build dependency.
791062
# When used, it makes some modules faster,
791062
# but it is usually not available soon enough for new major Python versions.
791062
%bcond_with pythran
791062
791062
# Set to pre-release version suffix if building pre-release, else %%{nil}
791062
%global rcver %{nil}
791062
791062
%if 0%{?fedora} >= 33 || 0%{?rhel} >= 9
791062
%global blaslib flexiblas
791062
%global blasvar %{nil}
791062
%else
791062
%global blaslib openblas
791062
%global blasvar p
791062
%endif
791062
791062
%global modname scipy
791062
791062
Summary:    Scientific Tools for Python
791062
Name:       python%{python3_pkgversion}-scipy
791062
Version:    1.10.0
791062
Release:    1%{?dist}
791062
791062
# BSD -- whole package except:
791062
# Boost -- scipy/special/cephes/scipy_iv.c
791062
# Public Domain -- scipy/odr/__odrpack.c
791062
License:    BSD and Boost and Public Domain
791062
Url:        http://www.scipy.org/scipylib/index.html
791062
Source0:    https://github.com/scipy/scipy/releases/download/v%{version}/scipy-%{version}.tar.gz
791062
791062
# Fix some test failures on 32 bits
791062
# https://github.com/scipy/scipy/pull/17859
791062
# https://github.com/scipy/scipy/pull/17931
791062
Patch0:     fix-32bit-test-failures.patch
791062
791062
BuildRequires: fftw-devel, suitesparse-devel
791062
BuildRequires: %{blaslib}-devel
791062
BuildRequires: gcc-gfortran, swig, gcc-c++
791062
BuildRequires: qhull-devel
791062
791062
BuildRequires:  python%{python3_pkgversion}-pybind11-devel
791062
BuildRequires:  python%{python3_pkgversion}-pybind11 >= 2.4.0
791062
BuildRequires:  python%{python3_pkgversion}-numpy, python%{python3_pkgversion}-devel, python%{python3_pkgversion}-numpy-f2py
791062
BuildRequires:  python%{python3_pkgversion}-rpm-macros
791062
BuildRequires:  python%{python3_pkgversion}-setuptools
791062
BuildRequires:  python%{python3_pkgversion}-Cython
791062
BuildRequires:  python%{python3_pkgversion}-pytest
791062
791062
%if %{with pythran}
791062
BuildRequires:  pythran
791062
%endif
791062
791062
Requires:   python%{python3_pkgversion}-numpy, python%{python3_pkgversion}-f2py
791062
791062
%global _description %{expand:
791062
Scipy is open-source software for mathematics, science, and
791062
engineering. The core library is NumPy which provides convenient and
791062
fast N-dimensional array manipulation. The SciPy library is built to
791062
work with NumPy arrays, and provides many user-friendly and efficient
791062
numerical routines such as routines for numerical integration and
791062
optimization. Together, they run on all popular operating systems, are
791062
quick to install, and are free of charge. NumPy and SciPy are easy to
791062
use, but powerful enough to be depended upon by some of the world's
791062
leading scientists and engineers.}
791062
791062
%description %_description
791062
791062
%prep
791062
%autosetup -p1 -n %{modname}-%{version}%{?rcver}
791062
cat > site.cfg << EOF
791062
791062
[amd]
791062
library_dirs = %{_libdir}
791062
include_dirs = /usr/include/suitesparse
791062
amd_libs = amd
791062
791062
[umfpack]
791062
library_dirs = %{_libdir}
791062
include_dirs = /usr/include/suitesparse
791062
umfpack_libs = umfpack
791062
791062
[openblas]
791062
libraries = %{blaslib}%{blasvar}
791062
library_dirs = %{_libdir}
791062
EOF
791062
791062
rm $(grep -rl '/\* Generated by Cython') PKG-INFO
791062
791062
%build
791062
export SCIPY_USE_PYTHRAN=0%{?with_pythran}
791062
791062
for PY in %{python3_pkgversion}; do
791062
  # Adding -fallow-argument-mismatch workaround for https://github.com/scipy/scipy/issues/11611
791062
  env CFLAGS="$RPM_OPT_FLAGS -lm" \
791062
      FFLAGS="$RPM_OPT_FLAGS -fPIC -cpp" \
791062
      LDFLAGS="$RPM_LD_FLAGS -shared" \
791062
  %if 0%{?rhel} >= 9
791062
  %ifarch x86_64
791062
      # workaround for https://bugzilla.redhat.com/show_bug.cgi?id=2068530
791062
      LDFLAGS="%{__global_ldflags} -Wl,--no-as-needed -lmvec -Wl,--as-needed" \
791062
  %endif
791062
  %endif
791062
    %{_bindir}/python$PY setup.py config_fc \
791062
    --fcompiler=gnu95 --noarch \
791062
    build
791062
791062
done
791062
791062
%install
791062
export SCIPY_USE_PYTHRAN=0%{?with_pythran}
791062
791062
%py3_install
791062
# Some files got ambiguous python shebangs, we fix them after everything else is done
791062
%py3_shebang_fix %{buildroot}%{python3_sitearch}
791062
791062
%check
791062
# check against the reference BLAS/LAPACK
791062
export FLEXIBLAS=netlib
791062
791062
791062
# https://github.com/scipy/scipy/issues/17912
791062
SKIP_ALL_ARCHS="\
791062
not TestDatasets and \
791062
not TestOde and \
791062
not TestComplexOde and \
791062
not TestVODECheckParameterUse and \
791062
not TestZVODECheckParameterUse and \
791062
not test_banded_ode_solvers and \
791062
not test_examples[True-complex64]"
791062
791062
# skip also failing test_sygst for now
791062
SKIP_X86_64="-k '$SKIP_ALL_ARCHS and \
791062
not test_sygst'"
791062
791062
# https://bugzilla.redhat.com/show_bug.cgi?id=1959353
791062
# TestConstructUtils::test_concatenate_int32_overflow is flaky on aarch64
791062
SKIP_AARCH64="-k '$SKIP_ALL_ARCHS and \
791062
not test_solve_discrete_are and \
791062
not test_maxiter_worsening[lgmres] and \
791062
not test_concatenate_int32_overflow'"
791062
791062
# Those tests fail on koji/brew for ppc64le but pass
791062
# locally for that architecture
791062
SKIP_PPC64LE="-k '$SKIP_ALL_ARCHS'"
791062
791062
# https://bugzilla.redhat.com/show_bug.cgi?id=1959353
791062
SKIP_S390X="-k '$SKIP_ALL_ARCHS and \
791062
not test_solve_discrete_are and \
791062
not test_maxiter_worsening[lgmres] and \
791062
not TestInterop and \
791062
not TestSplder and \
791062
not test_dblint and \
791062
not TestUnivariateSpline and \
791062
not TestLSQBivariateSpline and \
791062
not TestPPoly and \
791062
not TestLevyStable'"
791062
791062
# skip also test_cython_api: https://bugzilla.redhat.com/show_bug.cgi?id=2068496
791062
# https://github.com/scipy/scipy/issues/17213
791062
SKIP_32BIT="-k '$SKIP_ALL_ARCHS and \
791062
not test_sygst and \
791062
not test_cython_api and \
791062
not test_examples and \
791062
not test_shifts and \
791062
not test_mu and \
791062
not test_sum and \
791062
not test_svdp and \
791062
not test_resiliency_all_32 and \
791062
not test_resiliency_random[TestCSC-test_sum_dtype] and \
791062
not test_x0_equals_Mb[bicgstab] and \
791062
not test_gh12218'"
791062
791062
export PYTEST_ADDOPTS="-k '$SKIP_ALL_ARCHS'"
791062
# default test timeout
791062
TIMEOUT=500
791062
791062
%ifarch x86_64
791062
export PYTEST_ADDOPTS=$SKIP_X86_64
791062
%endif
791062
791062
%ifarch aarch64
791062
export PYTEST_ADDOPTS=$SKIP_AARCH64
791062
TIMEOUT=1000
791062
%endif
791062
791062
%ifarch ppc64le
791062
export PYTEST_ADDOPTS=$SKIP_PPC64LE
791062
TIMEOUT=1000
791062
%endif
791062
791062
%ifarch s390x
791062
export PYTEST_ADDOPTS=$SKIP_S390X
791062
TIMEOUT=1000
791062
%endif
791062
791062
%ifarch armv7hl
791062
export PYTEST_ADDOPTS=$SKIP_32BIT
791062
%endif
791062
791062
%ifarch i686
791062
export PYTEST_ADDOPTS=$SKIP_32BIT
791062
%endif
791062
791062
pushd %{buildroot}/%{python3_sitearch}
791062
# Ignoring the datasets tests as we don't have the optional pooch
791062
# dependency on RHEL.
791062
%{pytest} --ignore=scipy/datasets/tests/test_data.py scipy
791062
# Remove test remnants
791062
rm -rf gram{A,B}
791062
popd
791062
791062
%files -n python%{python3_pkgversion}-scipy
791062
%doc LICENSE.txt
791062
%{python3_sitearch}/scipy/
791062
%{python3_sitearch}/*.egg-info
791062
791062
%changelog
791062
* Sun Feb 19 2023 Charalampos Stratakis <cstratak@redhat.com> - 1.10.0-1
791062
- Update to 1.10.0
791062
791062
* Thu Dec 01 2022 Charalampos Stratakis <cstratak@redhat.com> - 1.8.1-1
791062
- Initial package
791062
- Fedora contributions by:
791062
      Antonio Trande <anto.trande@gmail.com>
791062
      Bill Nottingham <notting@fedoraproject.org>
791062
      Björn Esser <me@besser82.io>
791062
      Charalampos Stratakis <cstratak@redhat.com>
791062
      Christian Dersch <lupinix@mailbox.org>
791062
      David Malcolm <dmalcolm@redhat.com>
791062
      Deji Akingunola <deji@fedoraproject.org>
791062
      Dennis Gilmore <dennis@ausil.us>
791062
      Elliott Sales de Andrade <quantum.analyst@gmail.com>
791062
      Ignacio Vazquez-Abrams <ivazquez@fedoraproject.org>
791062
      Igor Gnatenko <ignatenkobrain@fedoraproject.org>
791062
      Iñaki Úcar <iucar@fedoraproject.org>
791062
      Jef Spaleta <jspaleta@fedoraproject.org>
791062
      Jesse Keating <jkeating@fedoraproject.org>
791062
      Jitka Plesnikova <jplesnik@redhat.com>
791062
      Jonathan Wakely <jwakely@redhat.com>
791062
      Jon Ciesla <limb@fedoraproject.org>
791062
      Kalev Lember <klember@redhat.com>
791062
      Kevin Fenzi <kevin@scrye.com>
791062
      Lumir Balhar <lbalhar@redhat.com>
791062
      Mamoru TASAKA <mtasaka@fedoraproject.org>
791062
      Marcel Plch <mplch@redhat.com>
791062
      Miro Hrončok <miro@hroncok.cz>
791062
      Nikola Forró <nforro@redhat.com>
791062
      Nils Philippsen <nils@redhat.com>
791062
      Orion Poplawski <orion@nwra.com>
791062
      Pavel Šimovec <psimovec@redhat.com>
791062
      Peter Robinson <pbrobinson@fedoraproject.org>
791062
      Petr Viktorin <pviktori@redhat.com>
791062
      Robert Kuska <rkuska@redhat.com>
791062
      Than Ngo <than@redhat.com>
791062
      Thomas Spura <thomas.spura@gmail.com>
791062
      Tomas Tomecek <ttomecek@redhat.com>
791062
      Toshio Kuratomi <toshio@fedoraproject.org>
791062
      Troy Dawson <tdawson@fedoraproject.org>
791062
      Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>