From 00e4c5e14adca457ef17a84e9924bbdc23d34d7f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jelmer=20Vernoo=C4=B3?= Date: Tue, 23 Mar 2021 16:37:20 +0000 Subject: [PATCH] Install setuptools preemptively. --- ognibuild/buildsystem.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ognibuild/buildsystem.py b/ognibuild/buildsystem.py index 9e3e267..042d563 100644 --- a/ognibuild/buildsystem.py +++ b/ognibuild/buildsystem.py @@ -309,6 +309,10 @@ class SetupPy(BuildSystem): if os.path.exists(os.path.join(self.path, 'tox.ini')): run_with_build_fixers(session, ['tox'], fixers) elif self.has_setup_py: + # Pre-emptively insall setuptools, since distutils doesn't provide + # a 'test' subcommand and some packages fall back to distutils + # if setuptools is not available. + resolver.install([PythonPackageRequirement('setuptools')]) self._run_setup(session, resolver, ["test"], fixers) else: raise NotImplementedError