Use wheel-building support to generate BR’s

This commit is contained in:
Benjamin A. Beasley 2022-04-23 10:34:29 -04:00
parent 5bea85db0f
commit cbda5f6a15

View File

@ -13,8 +13,8 @@ Source1: hatchling.1
BuildArch: noarch
BuildRequires: python3-devel
# RHBZ#1985340
BuildRequires: pyproject-rpm-macros >= 1.1.0
# RHBZ#1985340, RHBZ#2076994
BuildRequires: pyproject-rpm-macros >= 1.2.0
%global common_description %{expand:
This is the extensible, standards compliant build backend used by Hatch.}
@ -33,18 +33,7 @@ Summary: %{summary}
%generate_buildrequires
# Cannot use -r (the default) with hatchling: “ValueError: build backend cannot
# provide build metadata (incl. runtime requirements) before build”. We work
# around this by writing the dependencies from src/hatchling/ourobororos.py
# into a text file.
PYTHONPATH="${PWD}/src" '%{python3}' <<EOF
from hatchling.ouroboros import CONFIG
deps = CONFIG['project']['dependencies']
with open('requirements.ouroboros.txt', 'w') as reqfile:
reqfile.writelines(f'{dep}\n' for dep in deps)
EOF
%pyproject_buildrequires -R requirements.ouroboros.txt
%pyproject_buildrequires -w
%build