python3.12-scipy/python3.12-scipy.spec
Jerry James 7192fcfe49 Add missing licenses to the License tag, use %license
Cherry-picked from Fedora:
1999f77f84

Amended to de-SPDX it.

Amended to package LICENSES_bundled.txt, proposed in:
https://src.fedoraproject.org/rpms/scipy/pull-request/35

Co-Authored-By: Miro Hrončok <miro@hroncok.cz>
2024-01-16 20:25:07 +01:00

285 lines
9.2 KiB
RPMSpec

%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: 1%{?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
# https://github.com/scipy/scipy/issues/17912
SKIP_ALL="\
not TestDatasets and \
not TestOde and \
not TestComplexOde and \
not TestVODECheckParameterUse and \
not TestZVODECheckParameterUse and \
not test_banded_ode_solvers and \
not test_examples[True-complex64]"
export PYTEST_ADDOPTS="-k '$SKIP_ALL'"
# TestConstructUtils::test_concatenate_int32_overflow is flaky on aarch64
%ifarch aarch64 ppc64le
# https://bugzilla.redhat.com/show_bug.cgi?id=1959353
export PYTEST_ADDOPTS="-k '$SKIP_ALL and \
not test_solve_discrete_are and \
not test_maxiter_worsening[lgmres] and \
not test_concatenate_int32_overflow and \
not test_expm_multiply_dtype'"
TIMEOUT=1000
%endif
%ifarch s390x
# https://bugzilla.redhat.com/show_bug.cgi?id=1959353
export PYTEST_ADDOPTS="-k '$SKIP_ALL and \
not test_solve_discrete_are and \
not test_maxiter_worsening[lgmres] and \
not TestInterop and \
not TestSplder and \
not test_dblint and \
not TestUnivariateSpline and \
not TestLSQBivariateSpline and \
not TestPPoly and \
not TestLevyStable and \
not test_distance_transform_cdt05'"
TIMEOUT=1000
%endif
%ifarch x86_64
# skip also failing test_sygst for now
export PYTEST_ADDOPTS="-k '$SKIP_ALL and \
%{?rhel:not TestPPoly and \
not TestLinprogIPSparse and \
not test_axis_nan_policy_full and} \
not test_sygst'"
%endif
%ifarch i686 armv7hl
# skip also test_cython_api: https://bugzilla.redhat.com/show_bug.cgi?id=2068496
# https://github.com/scipy/scipy/issues/17213
export PYTEST_ADDOPTS="-k '$SKIP_ALL and \
not test_sygst and \
not test_cython_api and \
not test_examples and \
not test_shifts and \
not test_mu and \
not test_sum and \
not test_svdp and \
not test_resiliency_all_32 and \
not test_resiliency_random[TestCSC-test_sum_dtype]'"
%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 Nov 09 2023 Charalampos Stratakis <cstratak@redhat.com> - 1.11.1-1
- Initial package
- Fedora contributions by:
Antonio Trande <anto.trande@gmail.com>
Bill Nottingham <notting@fedoraproject.org>
Björn Esser <me@besser82.io>
Charalampos Stratakis <cstratak@redhat.com>
Christian Dersch <lupinix@mailbox.org>
David Malcolm <dmalcolm@redhat.com>
Deji Akingunola <deji@fedoraproject.org>
Dennis Gilmore <dennis@ausil.us>
Elliott Sales de Andrade <quantum.analyst@gmail.com>
Ignacio Vazquez-Abrams <ivazquez@fedoraproject.org>
Igor Gnatenko <ignatenkobrain@fedoraproject.org>
Iñaki Úcar <iucar@fedoraproject.org>
Jef Spaleta <jspaleta@fedoraproject.org>
Jerry James <loganjerry@gmail.com>
Jesse Keating <jkeating@fedoraproject.org>
Jitka Plesnikova <jplesnik@redhat.com>
Jonathan Wakely <jwakely@redhat.com>
Jon Ciesla <limb@fedoraproject.org>
Kalev Lember <klember@redhat.com>
Kevin Fenzi <kevin@scrye.com>
Lumir Balhar <lbalhar@redhat.com>
Mamoru TASAKA <mtasaka@fedoraproject.org>
Marcel Plch <mplch@redhat.com>
Miro Hrončok <miro@hroncok.cz>
Nikola Forró <nforro@redhat.com>
Nils Philippsen <nils@redhat.com>
Orion Poplawski <orion@cora.nwra.com>
Pavel Šimovec <psimovec@redhat.com>
Peter Robinson <pbrobinson@fedoraproject.org>
Petr Viktorin <pviktori@redhat.com>
Robert Kuska <rkuska@redhat.com>
Than Ngo <than@redhat.com>
Thomas Spura <thomas.spura@gmail.com>
Tomas Tomecek <ttomecek@redhat.com>
Toshio Kuratomi <toshio@fedoraproject.org>
Troy Dawson <tdawson@fedoraproject.org>
Yaakov Selkowitz <yselkowi@redhat.com>
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>