-
Notifications
You must be signed in to change notification settings - Fork 4k
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
Comments
@josephjnatale , thanks for reaching out. Have you tried running this using the latest release? |
@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" |
Hi @josephjnatale , looks like this section of code might be causing the issue. |
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.
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*
|
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
The text was updated successfully, but these errors were encountered: