Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
josephjnatale opened this issue Nov 15, 2023 · 4 comments · Fixed by #28317
Closed

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

josephjnatale opened this issue Nov 15, 2023 · 4 comments · Fixed by #28317
Labels
@aws-cdk/aws-lambda-python bug This issue is a bug. effort/small Small work item – less than a day of effort p2

Comments

@josephjnatale
Copy link

josephjnatale commented Nov 15, 2023

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

@josephjnatale josephjnatale added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Nov 15, 2023
@khushail
Copy link
Contributor

khushail commented Nov 15, 2023

@josephjnatale , thanks for reaching out. Have you tried running this using the latest release?

@khushail khushail added response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. and removed needs-triage This issue or PR still needs to be triaged. labels Nov 15, 2023
@josephjnatale
Copy link
Author

@khushail Updated to CDK CLI Version: 2.109.0 and "@aws-cdk/aws-lambda-python-alpha": "^2.109.0-alpha.0" and I'm getting the same "Error: No such option: -r"

@github-actions github-actions bot removed the response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. label Nov 16, 2023
@khushail khushail self-assigned this Nov 30, 2023
@khushail
Copy link
Contributor

Hi @josephjnatale , looks like this section of code might be causing the issue.

@khushail khushail added p2 effort/small Small work item – less than a day of effort labels Nov 30, 2023
@khushail khushail removed their assignment Nov 30, 2023
stefanfreitag added a commit to stefanfreitag/aws-cdk that referenced this issue Dec 10, 2023
As part of the pipenv release 2022.8.13 the deprecated way of generating requirements "pipenv install -r" or "pipenv lock -r" has been removed in favor of the "pipenv requirements" command.

* [Reference to pipenv CHANGELOG](https://github.com/pypa/pipenv/blob/main/CHANGELOG.md#2022813-2022-08-13)
* [Refernce to relevant pipenv pull request](pypa/pipenv#5200)

Fixes aws#28015 by implementing the proposed change.
@mergify mergify bot closed this as completed in #28317 Dec 18, 2023
mergify bot pushed a commit that referenced this issue Dec 18, 2023
As part of the pipenv release 2022.8.13 the deprecated way of generating requirements ("pipenv install -r" or "pipenv lock -r") has been removed in favor of the "pipenv requirements" command.

See  #28015 for the motivation behind this change.

* [Reference to pipenv CHANGELOG](https://github.com/pypa/pipenv/blob/main/CHANGELOG.md#2022813-2022-08-13)
* [Refernce to relevant pipenv pull request](pypa/pipenv#5200)

Closes #28015 .

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Copy link

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/aws-lambda-python bug This issue is a bug. effort/small Small work item – less than a day of effort p2
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants