aws / aws-lambda-builders

Python library to compile, build & package AWS Lambda functions for several runtimes & framework
Apache License 2.0
334 stars 139 forks source link

Feature request: Allow ignoring dependencies when building with python pip #496

Open mew1033 opened 1 year ago

mew1033 commented 1 year ago

I'd like some way to set a flag, preferably per library, that disables downloading dependencies. The example I have is that I'm using the pynamodb library to interact with dynamodb, and when installing the library, it pulls in the entire botocore as a dependency. This pushes the lambda function over the size limit for editing in the console, which is quite annoying. Botocore is built into the lambda runtime, so pynamo doesn't need to install its own copy.

See https://github.com/pynamodb/PynamoDB/issues/1166

hnnasit commented 1 year ago

Hi @mew1033, you can use Makefile builder to build with sam build instead of using the bundled builder. Here's the docs link with more info. In the Makefile, you can include --no-deps flag for the pip install command to get what you are looking for.

mew1033 commented 1 year ago

That could work. I'd love to realize the full benefits of the pip builder, but in the meantime that would probably work. Thanks!