|
|
@ -19,11 +19,8 @@ Source0: %{pypi_source hatch_vcs}
|
|
|
|
BuildArch: noarch
|
|
|
|
BuildArch: noarch
|
|
|
|
|
|
|
|
|
|
|
|
BuildRequires: python3-devel
|
|
|
|
BuildRequires: python3-devel
|
|
|
|
# RHBZ#1985340
|
|
|
|
# RHBZ#1985340, RHBZ#2076994
|
|
|
|
BuildRequires: pyproject-rpm-macros >= 1.1.0
|
|
|
|
BuildRequires: pyproject-rpm-macros >= 1.2.0
|
|
|
|
|
|
|
|
|
|
|
|
# For script in %%generate_buildrequires:
|
|
|
|
|
|
|
|
BuildRequires: python3dist(tomli)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
%if %{with tests}
|
|
|
|
%if %{with tests}
|
|
|
|
BuildRequires: python3dist(pytest)
|
|
|
|
BuildRequires: python3dist(pytest)
|
|
|
@ -50,25 +47,7 @@ Summary: %{summary}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
%generate_buildrequires
|
|
|
|
%generate_buildrequires
|
|
|
|
# Cannot use %%pyproject_buildrequires -r (the default) with hatchling:
|
|
|
|
%pyproject_buildrequires -w
|
|
|
|
# “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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
%build
|
|
|
|
%build
|
|
|
|