From 3b95c7d66c21877d768a6f72cc690b4bc8a4aa46 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Wed, 23 Sep 2020 11:10:30 +0200 Subject: [PATCH] Check the requirements after installing "requires_for_build_wheel" If not checked, installing runtime requirements might fail. When a requirement is specified in setuptools' setup_requires: setup( ... setup_requires=["pytest-runner"], ) It is part of the get_requires_for_build_wheel hook output. When runtime requirements are parsed with setuptools without all setup_requires present, it tries to get them from the internet (at least on Fedora 33). By checking the requirements after installing "requires_for_build_wheel", we make sure all setup_requires are already installed. When runtime requirements are not installed, this adds an unneeded check, but the script would end at that point anyway, so there is no real difference. --- pyproject-rpm-macros.spec | 6 +++++- pyproject_buildrequires.py | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/pyproject-rpm-macros.spec b/pyproject-rpm-macros.spec index d851810..77dd6a9 100644 --- a/pyproject-rpm-macros.spec +++ b/pyproject-rpm-macros.spec @@ -6,7 +6,7 @@ License: MIT # Keep the version at zero and increment only release Version: 0 -Release: 28%{?dist} +Release: 29%{?dist} # Macro files Source001: macros.pyproject @@ -91,6 +91,10 @@ export HOSTNAME="rpmbuild" # to speedup tox in network-less mock, see rhbz#1856 %license LICENSE %changelog +* Wed Sep 23 2020 Miro HronĨok - 0-29 +- Check the requirements after installing "requires_for_build_wheel" +- If not checked, installing runtime requirements might fail + * Tue Sep 08 2020 Gordon Messmer - 0-28 - Support more Python version specifiers in generated BuildRequires - This adds support for the '~=' operator and wildcards diff --git a/pyproject_buildrequires.py b/pyproject_buildrequires.py index ca52252..34ccbd0 100644 --- a/pyproject_buildrequires.py +++ b/pyproject_buildrequires.py @@ -193,6 +193,7 @@ def generate_build_requirements(backend, requirements): with hook_call(): new_reqs = get_requires() requirements.extend(new_reqs, source='get_requires_for_build_wheel') + requirements.check(source='get_requires_for_build_wheel') def generate_run_requirements(backend, requirements):