From bb5ad2b6ac61b402d5b73e921f11df3d99f9a802 Mon Sep 17 00:00:00 2001 From: Dima Gerasimov Date: Tue, 7 Feb 2023 01:39:34 +0000 Subject: [PATCH] core: make hpi install more defensive, just warn on no requirements this is useful for backwards compatibility if modules remove their requirements --- my/core/__main__.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/my/core/__main__.py b/my/core/__main__.py index d8e9ebd..11f32fc 100644 --- a/my/core/__main__.py +++ b/my/core/__main__.py @@ -344,8 +344,8 @@ def _requires(modules: Sequence[str]) -> Sequence[str]: reqs = mod.requires if reqs is None: - error(f"Module {mod.name} has no REQUIRES specification") - sys.exit(1) + warning(f"Module {mod.name} has no REQUIRES specification") + continue for r in reqs: if r not in res: res.append(r) @@ -369,6 +369,10 @@ def module_install(*, user: bool, module: Sequence[str], parallel: bool=False) - requirements = _requires(module) + if len(requirements) == 0: + warning('requirements list is empty, no need to install anything') + return + pre_cmd = [ sys.executable, '-m', 'pip', 'install',