diff --git a/pyproject-rpm-macros.spec b/pyproject-rpm-macros.spec index 4f70c85..8f638fb 100644 --- a/pyproject-rpm-macros.spec +++ b/pyproject-rpm-macros.spec @@ -179,6 +179,8 @@ export HOSTNAME="rpmbuild" # to speedup tox in network-less mock, see rhbz#1856 - Fixes: rhbz#2244282 - Show a better error message when %%pyproject_install finds no wheel - Fixes: rhbz#2242452 +- Fix %%pyproject_buildrequires -w when the build backend is already installed and pip isn't +- Fixes: rhbz#2169855 * Wed Sep 13 2023 Python Maint - 1.10.0-1 - Add %%_pyproject_check_import_allow_no_modules for automated environments diff --git a/pyproject_buildrequires.py b/pyproject_buildrequires.py index 7b0fc87..e91111f 100644 --- a/pyproject_buildrequires.py +++ b/pyproject_buildrequires.py @@ -328,6 +328,11 @@ def generate_run_requirements_wheel(backend, requirements, wheeldir): # Reuse the wheel from the previous round of %pyproject_buildrequires (if it exists) wheel = find_built_wheel(wheeldir) if not wheel: + # pip is already echoed from the macro + # but we need to explicitly restart if has not yet been installed + # see https://bugzilla.redhat.com/2169855 + requirements.add('pip >= 19', source='%pyproject_buildrequires -w') + requirements.check(source='%pyproject_buildrequires -w') import pyproject_wheel returncode = pyproject_wheel.build_wheel( wheeldir=wheeldir, diff --git a/pyproject_buildrequires_testcases.yaml b/pyproject_buildrequires_testcases.yaml index 2e6e91e..892e3c3 100644 --- a/pyproject_buildrequires_testcases.yaml +++ b/pyproject_buildrequires_testcases.yaml @@ -365,6 +365,7 @@ Run dependencies with extras and build wheel option: setuptools: 50 wheel: 1 pyyaml: 1 + pip: 20 include_runtime: true build_wheel: true extras: @@ -375,6 +376,7 @@ Run dependencies with extras and build wheel option: python3dist(wheel) python3dist(wheel) python3dist(setuptools) >= 40 + python3dist(pip) >= 19 python3dist(py) >= 1.5 python3dist(six) >= 1.10 python3dist(setuptools)