Use dynamic BuildRequires for python runtime dependencies

This commit is contained in:
Maxwell G 2024-02-01 21:38:40 +00:00
parent a48fc60993
commit 8904f985ff
No known key found for this signature in database
GPG Key ID: F79E4E25E8C661F8

View File

@ -30,7 +30,7 @@
Summary: Scientific Tools for Python
Name: scipy
Version: 1.11.3
Release: 6%{?dist}
Release: 7%{?dist}
# BSD-3-Clause -- whole package except:
# BSD-2-Clause -- scipy/_lib/_pep440.py
@ -67,17 +67,11 @@ Patch: https://github.com/scipy/scipy/pull/19443.patch
BuildRequires: %{blaslib}-devel
BuildRequires: gcc-gfortran, gcc-c++
BuildRequires: tomcli
BuildRequires: pybind11-devel
BuildRequires: python3-devel, python3-numpy-f2py
BuildRequires: python3-pytest
BuildRequires: python3-pytest-timeout
%if ! 0%{?rhel}
BuildRequires: python3-pytest-xdist
%endif
BuildRequires: python3-pooch
%if %{with doc}
BuildRequires: python3-sphinx
BuildRequires: python3-matplotlib
@ -189,8 +183,22 @@ sed -i '/pybind11/s/2\.11\.1/2.12.0/' pyproject.toml
# not a real function. It is a weak alias to __open_memstream.
sed -i "s/\('has_openmemstream', \)'0'/\1'1'/" scipy/_lib/meson.build
# meson-python does not implement the prepare_metadata_for_build_wheel hook :(.
# Instead of using -w and compiling the wheel, an expensive process, twice
# (once to extract metadata, one for the final package), we can write the
# static deps from pyproject.toml to a file, and use that with %%pyproject_buildrequires.
#
# See https://github.com/mesonbuild/meson-python/issues/236 for more discussion.
tomcli-get pyproject.toml -F newline-list \
project.dependencies > _install-requirements.txt
# Do the same for test dependencies
tomcli-get pyproject.toml -F newline-list \
project.optional-dependencies.test > _test-requirements.txt
%generate_buildrequires
%pyproject_buildrequires -R
%pyproject_buildrequires -R _install-requirements.txt _test-requirements.txt
%build
%pyproject_wheel
@ -287,6 +295,9 @@ popd
%endif
%changelog
* Fri Feb 02 2024 Maxwell G <maxwell@gtmx.me> - 1.11.3-7
- Use dynamic BuildRequires for python runtime dependencies
* Tue Jan 30 2024 Miro Hrončok <mhroncok@redhat.com> - 1.11.3-6
- Skip fewer tests during build