diff --git a/scipy.spec b/scipy.spec index b1bd0a2..2e4a5ee 100644 --- a/scipy.spec +++ b/scipy.spec @@ -67,7 +67,6 @@ 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 @@ -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. # # 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 +# This could use tomcli, but we want to avoid pulling extra dependencies into ELN/RHEL. +python3 -c ' +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 %pyproject_buildrequires -R _install-requirements.txt _test-requirements.txt