%global __python3 /usr/bin/python3.12 %global python3_pkgversion 3.12 # Pythran is an optional build dependency. # When used, it makes some modules faster, # but it is usually not available soon enough for new major Python versions. %bcond_with pythran # The code is not safe to build with LTO %global _lto_cflags %{nil} # Set to pre-release version suffix if building pre-release, else %%{nil} %global rcver %{nil} %if 0%{?fedora} >= 33 || 0%{?rhel} >= 9 %global blaslib flexiblas %global blasvar %{nil} %else %global blaslib openblas %global blasvar p %endif %global modname scipy Summary: Scientific Tools for Python Name: python%{python3_pkgversion}-scipy Version: 1.11.1 Release: 2%{?dist} # BSD (3-Clause) -- whole package except: # BSD (2-Clause) -- scipy/_lib/_pep440.py # scipy/_lib/decorator.py # scipy/optimize/lbfgsb_src # scipy/special/_ellip_harm.pxd # MIT -- scipy/cluster/_optimal_leaf_ordering.pyx # scipy/io/_idl.py # scipy/linalg/_basic.py (in part) # scipy/optimize/_highs # scipy/optimize/_lbfgsb_py.py # scipy/optimize/_tnc.py # scipy/optimize/_trlib # scipy/optimize/tnc # scipy/special/Faddeeva.{cc,hh} # Boost -- scipy/_lib/boost_math # scipy/special/cephes # Boehm-GC (MIT) -- scipy/sparse/linalg/_dsolve/SuperLU # Qhull -- scipy/spatial/qhull_src # Public Domain -- scipy/odr/__odrpack.c License: BSD and MIT and Boost and Qhull and Public Domain Url: http://www.scipy.org/scipylib/index.html Source0: https://github.com/scipy/scipy/releases/download/v%{version}/scipy-%{version}.tar.gz # Fix build failure with Cython 3 when scipy is already installed Patch1: https://github.com/scipy/scipy/commit/3c89445b6439f3ce7bffc4cf11c6407c39faedc5.patch BuildRequires: %{blaslib}-devel BuildRequires: gcc-gfortran, gcc-c++ BuildRequires: python%{python3_pkgversion}-pybind11-devel BuildRequires: python%{python3_pkgversion}-pybind11 >= 2.4.0 BuildRequires: python%{python3_pkgversion}-numpy, python%{python3_pkgversion}-devel, python%{python3_pkgversion}-numpy-f2py BuildRequires: python%{python3_pkgversion}-rpm-macros BuildRequires: python%{python3_pkgversion}-setuptools BuildRequires: python%{python3_pkgversion}-Cython BuildRequires: python%{python3_pkgversion}-pytest %if %{with pythran} BuildRequires: pythran %endif Requires: python%{python3_pkgversion}-numpy, python%{python3_pkgversion}-f2py Provides: bundled(arpack) = 3.3.0 Provides: bundled(biasedurn) Provides: bundled(boost-math) Provides: bundled(coin-or-HiGHS) = 1.2 Provides: bundled(Faddeeva) Provides: bundled(id) Provides: bundled(l-bfgs-b) = 3.0 Provides: bundled(LAPJVsp) Provides: bundled(python3-decorator) = 4.0.5 Provides: bundled(python3-pep440) Provides: bundled(python3-pypocketfft) = bf2c431c21213b7c5e23c2f542009b0bd3ec1445 Provides: bundled(qhull) = 2019.1 Provides: bundled(SuperLU) = 5.2.0 Provides: bundled(unuran) = 1.8.1 %global _description %{expand: Scipy is open-source software for mathematics, science, and engineering. The core library is NumPy which provides convenient and fast N-dimensional array manipulation. The SciPy library is built to work with NumPy arrays, and provides many user-friendly and efficient numerical routines such as routines for numerical integration and optimization. Together, they run on all popular operating systems, are quick to install, and are free of charge. NumPy and SciPy are easy to use, but powerful enough to be depended upon by some of the world's leading scientists and engineers.} %description %_description %package -n python%{python3_pkgversion}-scipy-tests Summary: Scientific Tools for Python - test files Requires: python%{python3_pkgversion}-scipy = %{version}-%{release} Requires: python%{python3_pkgversion}-pytest %description -n python%{python3_pkgversion}-scipy-tests Scipy test files %prep %autosetup -p1 -n %{modname}-%{version}%{?rcver} cat > site.cfg << EOF [amd] library_dirs = %{_libdir} include_dirs = /usr/include/suitesparse amd_libs = amd [umfpack] library_dirs = %{_libdir} include_dirs = /usr/include/suitesparse umfpack_libs = umfpack [openblas] libraries = %{blaslib}%{blasvar} library_dirs = %{_libdir} EOF rm $(grep -rl '/\* Generated by Cython') PKG-INFO %build export SCIPY_USE_PYTHRAN=0%{?with_pythran} for PY in %{python3_pkgversion}; do # Adding -fallow-argument-mismatch workaround for https://github.com/scipy/scipy/issues/11611 env CFLAGS="$RPM_OPT_FLAGS -lm" \ FFLAGS="$RPM_OPT_FLAGS -fPIC -cpp" \ LDFLAGS="%{__global_ldflags}" \ %{_bindir}/python$PY setup.py config_fc \ --fcompiler=gnu95 --noarch \ build done %install export SCIPY_USE_PYTHRAN=0%{?with_pythran} %py3_install # Some files got ambiguous python shebangs, we fix them after everything else is done %py3_shebang_fix %{buildroot}%{python3_sitearch} %check # check against the reference BLAS/LAPACK export FLEXIBLAS=netlib # default test timeout TIMEOUT=500 %ifarch aarch64 TIMEOUT=1000 # this is flaky according to the original Fedora spec export PYTEST_ADDOPTS="-k 'not test_concatenate_int32_overflow'" %endif %ifarch ppc64le TIMEOUT=1000 %if 0%{?rhel} == 8 # this fails in rhel8 brew but not in c8s koji # it has already been deselected in python3.11-scipy export PYTEST_ADDOPTS="-k 'not TestFFTConvolve and \ not TestDoubleFFT and \ not TestSingleFFT and \ not TestDoubleIFFT and \ not TestSingleIFFT and \ not test_tpsv and \ not TestLinear and \ not test_various_drivers_standard and \ not test_Mx1_economic and \ not test_hegst and \ not test_tpqrt_tpmqrt and \ not test_pteqr and \ not test_pptrs_pptri_pptrf_ppsv_ppcon and \ not test_against_numpy_convolve and \ not test_convolve_method and \ not test_rank1 and \ not test_splu_smoketest and \ not test_spilu_smoketest and \ not test_threads_parallel and \ not test_hermitian and \ not test_convergence and \ not test_precond_dummy and \ not test_x0_equals_Mb and \ not test_show and \ not test_svdp and \ not test_examples'" %endif %endif %ifarch s390x TIMEOUT=1000 export PYTEST_ADDOPTS="-k 'not test_distance_transform_cdt05 and not (TestZlibInputStream and test_all_data_read_)'" %endif %ifarch x86_64 # this sometimes failed in rhel8 brew, but not in c8s koji or rhel9/c9s # assuming it's flaky or hardware/kernel dependent and disabling unconditionally export PYTEST_ADDOPTS="-k 'not test_large_rank_deficient'" %endif %ifarch i686 export PYTEST_ADDOPTS="-k 'not test_gh12218 and not test_x0_equals_Mb[bicgstab-nonsymposdef-F]'" %endif pushd %{buildroot}/%{python3_sitearch} # Ignoring the datasets tests as we don't have the optional pooch # dependency on RHEL. %{pytest} --ignore=scipy/datasets/tests/test_data.py scipy # Remove test remnants rm -rf gram{A,B} rm -rf scipy/.pytest_cache popd %files -n python%{python3_pkgversion}-scipy %license LICENSE.txt LICENSES_bundled.txt %{python3_sitearch}/scipy/ %{python3_sitearch}/*.egg-info %exclude %{python3_sitearch}/scipy/*/tests/ %exclude %{python3_sitearch}/scipy/*/*/tests/ %exclude %{python3_sitearch}/scipy/*/*/*/tests/ %exclude %{python3_sitearch}/scipy/*/*/*/*/tests/ %files -n python%{python3_pkgversion}-scipy-tests %{python3_sitearch}/scipy/*/tests/ %{python3_sitearch}/scipy/*/*/tests/ %{python3_sitearch}/scipy/*/*/*/tests/ %{python3_sitearch}/scipy/*/*/*/*/tests/ %changelog * Thu Mar 28 2024 MSVSphere Packaging Team - 1.11.1-2 - Rebuilt for MSVSphere 9.4 beta * Tue Jan 23 2024 Miro Hrončok - 1.11.1-2 - Rebuilt for timestamp .pyc invalidation mode * Thu Nov 09 2023 Charalampos Stratakis - 1.11.1-1 - Initial package - Fedora contributions by: Antonio Trande Bill Nottingham Björn Esser Charalampos Stratakis Christian Dersch David Malcolm Deji Akingunola Dennis Gilmore Elliott Sales de Andrade Ignacio Vazquez-Abrams Igor Gnatenko Iñaki Úcar Jef Spaleta Jerry James Jesse Keating Jitka Plesnikova Jonathan Wakely Jon Ciesla Kalev Lember Kevin Fenzi Lumir Balhar Mamoru TASAKA Marcel Plch Miro Hrončok Nikola Forró Nils Philippsen Orion Poplawski Pavel Šimovec Peter Robinson Petr Viktorin Robert Kuska Than Ngo Thomas Spura Tomas Tomecek Toshio Kuratomi Troy Dawson Yaakov Selkowitz Zbigniew Jędrzejewski-Szmek