core: make hpi install more defensive, just warn on no requirements

this is useful for backwards compatibility if modules remove their requirements
This commit is contained in:
Dima Gerasimov 2023-02-07 01:39:34 +00:00 committed by karlicoss
parent 5c82d0faa9
commit bb5ad2b6ac

View file

@ -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',