Skip to content

Commit

Permalink
fix: Generates error in plan phase if runtime is not available (#358)
Browse files Browse the repository at this point in the history
  • Loading branch information
lorengordon committed Oct 20, 2022
1 parent 0d26c6f commit f9bf21d
Showing 1 changed file with 16 additions and 6 deletions.
22 changes: 16 additions & 6 deletions package.py
Expand Up @@ -656,9 +656,14 @@ def pip_requirements_step(path, prefix=None, required=False, tmp_dir=None):
if required:
raise RuntimeError(
'File not found: {}'.format(requirements))
else:
step('pip', runtime, requirements, prefix, tmp_dir)
hash(requirements)
if not shutil.which(runtime):
raise RuntimeError(
"Python interpreter version equal "
"to defined lambda runtime ({}) should be "
"available in system PATH".format(runtime))

step('pip', runtime, requirements, prefix, tmp_dir)
hash(requirements)

def npm_requirements_step(path, prefix=None, required=False, tmp_dir=None):
requirements = path
Expand All @@ -668,9 +673,14 @@ def npm_requirements_step(path, prefix=None, required=False, tmp_dir=None):
if required:
raise RuntimeError(
'File not found: {}'.format(requirements))
else:
step('npm', runtime, requirements, prefix, tmp_dir)
hash(requirements)
if not shutil.which(runtime):
raise RuntimeError(
"Nodejs interpreter version equal "
"to defined lambda runtime ({}) should be "
"available in system PATH".format(runtime))

step('npm', runtime, requirements, prefix, tmp_dir)
hash(requirements)

def commands_step(path, commands):
if not commands:
Expand Down

0 comments on commit f9bf21d

Please sign in to comment.