Blame SPECS/python3.11-scipy.spec

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