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:
parent
7c7457ab08
commit
efdc06ba23
1 changed files with 6 additions and 2 deletions
|
@ -344,8 +344,8 @@ def _requires(modules: Sequence[str]) -> Sequence[str]:
|
||||||
|
|
||||||
reqs = mod.requires
|
reqs = mod.requires
|
||||||
if reqs is None:
|
if reqs is None:
|
||||||
error(f"Module {mod.name} has no REQUIRES specification")
|
warning(f"Module {mod.name} has no REQUIRES specification")
|
||||||
sys.exit(1)
|
continue
|
||||||
for r in reqs:
|
for r in reqs:
|
||||||
if r not in res:
|
if r not in res:
|
||||||
res.append(r)
|
res.append(r)
|
||||||
|
@ -369,6 +369,10 @@ def module_install(*, user: bool, module: Sequence[str], parallel: bool=False) -
|
||||||
|
|
||||||
requirements = _requires(module)
|
requirements = _requires(module)
|
||||||
|
|
||||||
|
if len(requirements) == 0:
|
||||||
|
warning('requirements list is empty, no need to install anything')
|
||||||
|
return
|
||||||
|
|
||||||
pre_cmd = [
|
pre_cmd = [
|
||||||
sys.executable, '-m', 'pip',
|
sys.executable, '-m', 'pip',
|
||||||
'install',
|
'install',
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue