From d76b278d9be81eeec1f341f73cdb9e7239bad2aa Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Fri, 6 May 2022 09:11:54 -0400 Subject: [PATCH] =?UTF-8?q?Use=20wheel-building=20support=20to=20generate?= =?UTF-8?q?=20BR=E2=80=99s?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- python-hatch-vcs.spec | 27 +++------------------------ 1 file changed, 3 insertions(+), 24 deletions(-) diff --git a/python-hatch-vcs.spec b/python-hatch-vcs.spec index ca208d7..2716c2f 100644 --- a/python-hatch-vcs.spec +++ b/python-hatch-vcs.spec @@ -19,11 +19,8 @@ Source0: %{pypi_source hatch_vcs} BuildArch: noarch BuildRequires: python3-devel -# RHBZ#1985340 -BuildRequires: pyproject-rpm-macros >= 1.1.0 - -# For script in %%generate_buildrequires: -BuildRequires: python3dist(tomli) +# RHBZ#1985340, RHBZ#2076994 +BuildRequires: pyproject-rpm-macros >= 1.2.0 %if %{with tests} BuildRequires: python3dist(pytest) @@ -50,25 +47,7 @@ Summary: %{summary} %generate_buildrequires -# Cannot use %%pyproject_buildrequires -r (the default) with hatchling: -# “ValueError: build backend cannot provide build metadata (incl. runtime -# requirements) before build”. See: https://github.com/ofek/hatch/issues/128 -# -# We work around this by writing the dependencies from pyproject.toml into a -# text file. This may not be necessary in the future; see: -# https://bugzilla.redhat.com/show_bug.cgi?id=2076994 -'%{python3}' <<'EOF' -from tomli import load - -def emit(tomlbase, reqtag, getdeps): - with open(f'{tomlbase}.toml', 'rb') as cfgfile: - deps = getdeps(load(cfgfile)) - with open(f'requirements.{reqtag}.txt', 'w') as reqfile: - reqfile.writelines(f'{dep}\n' for dep in deps) - -emit('pyproject', 'pyproject', lambda cfg: cfg['project']['dependencies']) -EOF -%pyproject_buildrequires -R requirements.pyproject.txt +%pyproject_buildrequires -w %build