Skip to content

Commit 7067c89

Browse files
chore(lambda-python-alpha): make pipenv version a parameter for bundling (#32594)
Make pipenv version a parameter in the Dockerfile for python lambda bundling. It was originally hardcoded to 2022.4.8, which excluded newer features/fixes. ### Issue # (if applicable) None. ### Reason for this change Pipenv version was originally hardcoded to 2022.4.8, which excluded newer features/fixes. And that could not be changed without providing a new Dockerfile from scratch. ### Description of changes Just made the pipenv version a new ARG in the Dockerfile. So that it can be provided from the outside. It has the same default value as it used to have, so that the current behavior won't change. ### Describe any new or updated permissions being added None ### Description of how you validated changes Tested this same Dockerfile in my current project, providing the PIPENV_VERSION variable via CDK: ```typescript import * as python from '@aws-cdk/aws-lambda-python-alpha'; const lambdaProps: python.PythonFunctionProps = { runtime: lambda.Runtime.PYTHON_3_11, // ... bundling: { buildArgs: { 'PIPENV_VERSION': '2024.0.1', }, } }; ``` ### Checklist - [X] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md) ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
1 parent f6ed4be commit 7067c89

File tree

1 file changed

+4
-2
lines changed
  • packages/@aws-cdk/aws-lambda-python-alpha/lib

1 file changed

+4
-2
lines changed

packages/@aws-cdk/aws-lambda-python-alpha/lib/Dockerfile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ FROM $IMAGE
66
ARG PIP_INDEX_URL
77
ARG PIP_EXTRA_INDEX_URL
88
ARG HTTPS_PROXY
9+
# pipenv 2022.4.8 is the last version with Python 3.6 support
10+
ARG PIPENV_VERSION=2022.4.8
911
ARG POETRY_VERSION=1.5.1
1012

1113
# Add virtualenv path
@@ -31,8 +33,8 @@ RUN \
3133
mkdir /tmp/poetry-cache && \
3234
# Ensure all users can write to poetry cache
3335
chmod -R 777 /tmp/poetry-cache && \
34-
# pipenv 2022.4.8 is the last version with Python 3.6 support
35-
pip install pipenv==2022.4.8 poetry==$POETRY_VERSION && \
36+
# Install pipenv and poetry
37+
pip install pipenv==$PIPENV_VERSION poetry==$POETRY_VERSION && \
3638
# Ensure no temporary files remain in the caches
3739
rm -rf /tmp/pip-cache/* /tmp/poetry-cache/*
3840

0 commit comments

Comments
 (0)