Skip to content

Commit

Permalink
fix: Performs plan-phase runtime check only if building package (#359)
Browse files Browse the repository at this point in the history
  • Loading branch information
lorengordon authored Oct 20, 2022
1 parent c83d201 commit dfc8934
Showing 1 changed file with 17 additions and 15 deletions.
32 changes: 17 additions & 15 deletions package.py
Original file line number Diff line number Diff line change
Expand Up @@ -656,14 +656,15 @@ def pip_requirements_step(path, prefix=None, required=False, tmp_dir=None):
if required:
raise RuntimeError(
'File not found: {}'.format(requirements))
if not shutil.which(runtime):
raise RuntimeError(
"Python interpreter version equal "
"to defined lambda runtime ({}) should be "
"available in system PATH".format(runtime))
else:
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)
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 @@ -673,14 +674,15 @@ def npm_requirements_step(path, prefix=None, required=False, tmp_dir=None):
if required:
raise RuntimeError(
'File not found: {}'.format(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)
else:
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 dfc8934

Please sign in to comment.