Add pipenv support for build command
It would be cool if SAM CLI could understand Python projects that use pipenv. Right now, sam build only supports dependencies that are specified in a requirements.txt.
SAM Version: 0.8.0
This could be a new workflow in https://github.com/awslabs/aws-lambda-builders. The current worflow is a python_pip workflow. this could be a python_pipenv workflow.
I’ll see if I have capacity to do this next week.
:+1:
Any movement on this?
FWIW using pipenv with PackageType: Image works fine (you can utilize it in your Dockerfile) with sam build. I seem to be having some issues getting that to work with sam local invoke, though (can't seem to find the dependencies even though they exist in my image).
EDIT: ah, this is because of the lambda entrypoint for the public.ecr.aws/lambda/python:3.8 image... it doesn't seem to be running the python commands in the same virtual environment that pipenv is using, and I can't use pipenv run since the entrypoint requires the handler to be the first function argument... I guess I can use pipenv install --system for now, even though it is discouraged.
I'm going to go ahead and close this in favor of using a makefile based builder if one wants additional flexibility.
@sriram-mv is there a chance to have this mentioned in the documentation, perhaps with an example?