claranet / terraform-aws-lambda

Terraform module for AWS Lambda functions
MIT License
157 stars 127 forks source link

Support pipenv #32

Open nitrocode opened 5 years ago

nitrocode commented 5 years ago

It would be nice if pipenv was supported.

https://pipenv.readthedocs.io/en/latest/

It doesn't have a requirements.txt file, instead it has Pipfile and Pipfile.lock files

pipenv run pip install -r <(pipenv lock -r) --target .

Source: https://github.com/pypa/pipenv/issues/746#issuecomment-388485039

Would be enough to install all of its dependencies

raymondbutcher commented 5 years ago

(shameless copy/paste from #33)

Hi,

Custom build commands were added in v0.11.0. There is an example here which uses Docker: https://github.com/claranet/terraform-aws-lambda/tree/master/tests/build-command

It should be possible to have a build script that runs pipenv directly or in Docker. I don't currently have a pipenv project to test this on.

If you get this working, please update this issue and maybe we can add a test for it.

Cheers!

ruzin commented 5 years ago

something I built to help specifically with packaging up python source code and dependencies for AWS Lambda https://github.com/ruzin/terraform_aws_lambda_python

ruzin commented 5 years ago

In case anyone finds it useful