Skip to content
This repository was archived by the owner on Oct 24, 2025. It is now read-only.

assume .requirements.zip file is at lambda task root, fall back on the current directory#104

Merged
dschep merged 2 commits intoserverless:masterfrom
tideline:requirements_zip_at_top
Nov 16, 2017
Merged

assume .requirements.zip file is at lambda task root, fall back on the current directory#104
dschep merged 2 commits intoserverless:masterfrom
tideline:requirements_zip_at_top

Conversation

@sumpfork
Copy link
Contributor

We deploy our code to lambda in subdirectories. When importing unzip_requirements.py this results in os.path.split(__file__)[0] being empty, but .requirements.zip actually being higher up in the directory tree.

I believe it's valid to always assume that .requirements.zip is at the path pointed to by the env var LAMBDA_TASK_ROOT or else the current working dir for lambda, at least as long as the lambda code doesn't change this before imports? At least this works for our projects, subdirs or not.

@dschep
Copy link
Contributor

dschep commented Nov 16, 2017

LGTM 👍

@dschep dschep merged commit 9cf3e92 into serverless:master Nov 16, 2017
dschep added a commit that referenced this pull request Nov 16, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants