Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automatically add to sys.path #1

Closed
dschep opened this issue Dec 15, 2016 · 5 comments
Closed

Automatically add to sys.path #1

dschep opened this issue Dec 15, 2016 · 5 comments

Comments

@dschep
Copy link
Collaborator

dschep commented Dec 15, 2016

Maybe there's a way to avoid having to add the import requirements to your Python files...

@tonycapone
Copy link

Agree. This plugin is great in theory but having to modify every file in my code to support it is undesirable.

@tonycapone
Copy link

@dschep why not put the python dependencies in the project root where they would normally be?

@dschep
Copy link
Collaborator Author

dschep commented Feb 3, 2017

@tonycapone that just seems too messy, and there'd be no way to easily git ignore all of them. But yeah. that certainly would take care of it.

@dschep
Copy link
Collaborator Author

dschep commented Feb 3, 2017

Also, it would be incompatible with #4 😢

@tonycapone
Copy link

tonycapone commented Feb 4, 2017

@dschep Yeah that's true, although that messiness is a problem in all Python Aws Lambda projects.

FWIW here's my workaround that mitigated most of the pain:

Put all source code into a local package. Put the Lambda handler file in the project root, and import the package from the handler file. Then you only have to put import requirements in the handler file.

dschep added a commit that referenced this issue Feb 21, 2017
@dschep dschep closed this as completed in a6b9009 Feb 21, 2017
wmarshall referenced this issue in vklab/serverless-python-requirements Nov 8, 2019
allow per-function requirements plus base layer
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants