From cbc91dfe7103539d8fd0df9ef090171fb2d13efc Mon Sep 17 00:00:00 2001 From: William Douglas Date: Fri, 17 Dec 2021 11:40:44 -0800 Subject: [PATCH] buildreq: Sometimes install requires are also build requires This imporves the ability for pypi ecosystem pyproject packages to build more consistently. Might consider making this a last attempt if build fails instead though to avoid adding spurious buildreqs. Signed-off-by: William Douglas --- autospec/buildreq.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/autospec/buildreq.py b/autospec/buildreq.py index 1b5b3b8..13cbec7 100644 --- a/autospec/buildreq.py +++ b/autospec/buildreq.py @@ -604,7 +604,9 @@ class Requirements(object): if 'options' in setup_f.sections() and (install_reqs := setup_f['options'].get('install_requires')): for req in install_reqs.splitlines(): if dep := clean_python_req(req): - self.add_requires(f"pypi({dep})", packages, subpkg="python3") + req = f"pypi({dep})" + self.add_buildreq(req) + self.add_requires(req, packages, subpkg="python3") def add_setup_py_requires(self, filename, packages): """Detect build requirements listed in setup.py in the install_requires and setup_requires lists.