Skip to content

Commit

Permalink
core: make hpi install more defensive, just warn on no requirements
Browse files Browse the repository at this point in the history
this is useful for backwards compatibility if modules remove their requirements
  • Loading branch information
karlicoss committed Feb 7, 2023
1 parent 5c82d0f commit bb5ad2b
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions my/core/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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',
Expand Down

0 comments on commit bb5ad2b

Please sign in to comment.