chalice icon indicating copy to clipboard operation
chalice copied to clipboard

Allow using poetry as a dependency management tool as well as pip / requirements.txt (as lambdas support this in the cdk now)

Open mcsheehan opened this issue 3 years ago • 4 comments

Lambdas support using poetry in the cdk now. https://docs.aws.amazon.com/cdk/api/latest/docs/aws-lambda-python-readme.html

It would be really nice if the chalice cdk deployment had a way of allowing this too.

Would this involve an alternative packager? Or is there a cdk only solution?

mcsheehan avatar Jul 22 '21 19:07 mcsheehan

Fwiw I end up doing poetry export for chalice in my poetry projects

kapilt avatar Aug 25 '21 22:08 kapilt

@kapilt - same, but it's not the same as it doesn't actually use pip, just parses the pip file, so some of the features don't work for example the local development mode local-project = {path = "../../data_models", develop=true}

mcsheehan avatar Aug 26 '21 09:08 mcsheehan

This would be awesome!

brno32 avatar Aug 26 '21 14:08 brno32

Any planned support for this?

ghilesmeddour avatar Sep 06 '22 07:09 ghilesmeddour

Waiting for this feature !

baotran2207 avatar Oct 07 '22 04:10 baotran2207

Fwiw I end up doing poetry export for chalice in my poetry projects

@kapilt @mcsheehan Could you give a step by step of this workflow?

Do you simply issue poetry export -f requirements.txt or poetry export --without-hashes --format=requirements.txt > requirements.txt prior to doing the Chalice deployment?

Insighttful avatar Feb 01 '23 14:02 Insighttful

@Insighttful yeah you've got it. The CI pipeline is pretty much poetry export, then chalice package, then cloudformation deploy of it.

poetry install --no-dev
poetry export --without-hashes > requirements.txt
poetry run chalice package --stage << parameters.env >> --template-format yaml packaged/
aws cloudformation package --template-file ./packaged/sam.yaml --s3-bucket template-bucket --output-template-file cfn-output_sam.yml

mcsheehan avatar Feb 01 '23 16:02 mcsheehan