Blame SPECS/python3.11-scipy.spec

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