Skip to content

Commit

Permalink
fix(type-safe-api): missing runtime modules in Lambda deployment (#815)
Browse files Browse the repository at this point in the history
Fixes the issue where generated runtime modules were not packaged
in the Lambda deployment, causing ImportModuleError when executing
Python handlers.

The fix modifies the packaging task in GeneratedPythonHandlersBaseProject
to strip the '-e' flag from exported requirements.txt. This ensures runtime
modules are installed as regular packages instead of editable installations.

Changes:
- Update 'poetry export' command to pipe output through 'sed' and remove
  '-e' prefix.
- Update corresponding snapshot tests for new package task command.

Fixes #791

Co-authored-by: Adrian Dimech <51220968+agdimech@users.noreply.github.com>
  • Loading branch information
jstrunk and agdimech authored Jul 25, 2024
1 parent acd3e5c commit 883e782
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ export abstract class GeneratedPythonHandlersBaseProject extends PythonProject {
`cp -r ${this.moduleName} dist/lambda/${this.moduleName}`
);
this.packageTask.exec(
"poetry export --without-hashes --format=requirements.txt > dist/lambda/requirements.txt"
"poetry export --without-hashes --format=requirements.txt | sed -E 's/^-e[[:space:]]+//' > dist/lambda/requirements.txt"
);
// Select the platform based on the specified architecture, defaulting to x86_64
// See: https://docs.aws.amazon.com/lambda/latest/dg/python-package.html#python-package-native-libraries
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 883e782

Please sign in to comment.