Skip to content

(aws-lambda-python-alpha): Pipenv lock -r is no longer supported #28015

@josephjnatale

Description

@josephjnatale

Describe the bug

When using a custom docker image for a PythonFunction that uses a Pipfile I am getting "Error: No such option: -r" for the ' pipenv lock -r > requirements.txt' command. In my custom docker image I installed the latest version of pipenv which has since replaced 'pipenv lock -r' with 'pipenv requirements'. pypa/pipenv#5253

Expected Behavior

Using a custom docker image to bundle a PythonFunction with the latest version of pipenv successfully bundles the lambda function.

Current Behavior

The CDK synth errors out with "Error: No such option: -r"

Reproduction Steps

Use a custom docker image with the latest version of pipenv installed to bundle the PythonLambda function and try to synth.

Possible Solution

In packaging.ts update withPipenv(): Packaging with pipenv requirements.

Additional Information/Context

The need for a custom docker image came from pytest not being installed on the default bundler image. However, the example on the documentation page (https://docs.aws.amazon.com/cdk/api/v2/docs/@aws-cdk_aws-lambda-python-alpha.ICommandHooks.html) shows the pytest command in beforeBundling.

CDK CLI Version

2.100.0

Framework Version

No response

Node.js Version

v18.16.0

OS

Mac OS

Language

TypeScript, Python

Language Version

No response

Other information

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions