Use inline python mini script instead of tomcli

This commit is contained in:
Maxwell G 2024-02-02 18:06:02 +00:00
parent f77aeeb563
commit 7d8ddcb20c
No known key found for this signature in database
GPG Key ID: F79E4E25E8C661F8

View File

@ -67,7 +67,6 @@ Patch: https://github.com/scipy/scipy/pull/19443.patch
BuildRequires: %{blaslib}-devel BuildRequires: %{blaslib}-devel
BuildRequires: gcc-gfortran, gcc-c++ BuildRequires: gcc-gfortran, gcc-c++
BuildRequires: tomcli
BuildRequires: pybind11-devel BuildRequires: pybind11-devel
BuildRequires: python3-devel, python3-numpy-f2py BuildRequires: python3-devel, python3-numpy-f2py
@ -189,13 +188,17 @@ sed -i "s/\('has_openmemstream', \)'0'/\1'1'/" scipy/_lib/meson.build
# static deps from pyproject.toml to a file, and use that with %%pyproject_buildrequires. # 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. # 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 # This could use tomcli, but we want to avoid pulling extra dependencies into ELN/RHEL.
tomcli-get pyproject.toml -F newline-list \ python3 -c '
project.optional-dependencies.test > _test-requirements.txt import tomllib
from pathlib import Path
with open("pyproject.toml", "rb") as fp:
data = tomllib.load(fp)
Path("_install-requirements.txt").write_text("\n".join(data["project"]["dependencies"]))
Path("_test-requirements.txt").write_text("\n".join(data["project"]["optional-dependencies"]["test"]))
'
%generate_buildrequires %generate_buildrequires
%pyproject_buildrequires -R _install-requirements.txt _test-requirements.txt %pyproject_buildrequires -R _install-requirements.txt _test-requirements.txt