Don't generate a dependency on pip when %pyproject_buildrequires -N is used

- Fixes: rhbz#2294510

(cherry picked from commit 8a41ec5715)
This commit is contained in:
Miro Hrončok 2024-09-23 14:19:54 +02:00
parent a1488d18df
commit a33eda232e
3 changed files with 11 additions and 9 deletions

View File

@ -185,9 +185,9 @@ fi
%{-e:%{expand:%global toxenv %(%{__python3} -s %{_rpmconfigdir}/redhat/pyproject_construct_toxenv.py %{?**})}}
echo 'pyproject-rpm-macros' # first stdout line matches the implementation in macros.aaa-pyproject-srpm
echo 'python%{python3_pkgversion}-devel'
echo 'python%{python3_pkgversion}dist(pip) >= 19'
echo 'python%{python3_pkgversion}dist(packaging)'
%{!-N:if [ -f pyproject.toml ]; then
%{!-N:echo 'python%{python3_pkgversion}dist(pip) >= 19'
if [ -f pyproject.toml ]; then
%["%{python3_pkgversion}" == "3"
? "echo '(python%{python3_pkgversion}dist(tomli) if python%{python3_pkgversion}-devel < 3.11)'"
: "%[v"%{python3_pkgversion}" < v"3.11"

View File

@ -196,9 +196,11 @@ export HOSTNAME="rpmbuild" # to speedup tox in network-less mock, see rhbz#1856
%changelog
* Tue Sep 17 2024 Karolina Surma <ksurma@redhat.com> - 1.15.0-1
* Tue Sep 17 2024 Python Maint <python-maint@redhat.com> - 1.15.0-1
- Add a possibility to read runtime requirements from pyproject.toml [project] table
- Fixes: rhbz#2261939
- Don't generate a dependency on pip when %%pyproject_buildrequires -N is used
- Fixes: rhbz#2294510
* Tue Jul 23 2024 Miro Hrončok <mhroncok@redhat.com> - 1.14.0-1
- Add a provisional RPM Declarative Buildsystem (RPM 4.20+)

View File

@ -22,9 +22,9 @@ EOF
%check
pip show tomli click
%if 0%{?fedora} || 0%{?rhel} > 9
# On RHEL 9, python3-devel requires (python3-setuptools if rpm-build)
pip show setuptools && exit 1 || true
%endif
pip show wheel && exit 1 || true
grep '^((python3dist(click) < 5 or python3dist(click) > 5) with python3dist(click) >= 4.1)$' %{_pyproject_buildrequires}
grep '^python3dist(tomli) >= 0.10$' %{_pyproject_buildrequires}
grep 'python3dist(pip)' %{_pyproject_buildrequires} && exit 1 || true
grep 'python3dist(wheel)' %{_pyproject_buildrequires} && exit 1 || true
test -f /usr/bin/pip && exit 1 || true