Skip to content

Commit

Permalink
fix(lambda-python): poetry bundling is broken after Aug 20 (#26823)
Browse files Browse the repository at this point in the history
The Dockerfile that builds an executable container to run `poetry` in installs the latest version of `poetry` on a Python 3.7 Docker image.

Unfortunately `poetry 1.6.0`, released August 20, drops support for Python 3.7 which means that all poetry bundling jobs started failing on that date. `1.6.0` also does not work on Python 3.8, which I don't see mentioned in the change log, but our integration tests that use Python 3.8 are also broken.

Lock the poetry version back to `1.5.1` by using a version specifier so the command is not dependent on the date it is run.

This is the last version that supported both Python 3.7 and 3.8.

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
  • Loading branch information
rix0rrr authored Aug 21, 2023
1 parent 00a7f03 commit 95f8cef
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/@aws-cdk/aws-lambda-python-alpha/lib/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ FROM $IMAGE
ARG PIP_INDEX_URL
ARG PIP_EXTRA_INDEX_URL
ARG HTTPS_PROXY
ARG POETRY_VERSION=1.5.1

# Add virtualenv path
ENV PATH="/usr/app/venv/bin:$PATH"
Expand All @@ -17,7 +18,7 @@ ENV PIP_CACHE_DIR=/tmp/pip-cache
ENV POETRY_CACHE_DIR=/tmp/poetry-cache

RUN \
# create a new virtualenv for python to use
# create a new virtualenv for python to use
# so that it isn't using root
python -m venv /usr/app/venv && \
# Create a new location for the pip cache
Expand All @@ -31,7 +32,7 @@ RUN \
# Ensure all users can write to poetry cache
chmod -R 777 /tmp/poetry-cache && \
# pipenv 2022.4.8 is the last version with Python 3.6 support
pip install pipenv==2022.4.8 poetry && \
pip install pipenv==2022.4.8 poetry==$POETRY_VERSION && \
# Ensure no temporary files remain in the caches
rm -rf /tmp/pip-cache/* /tmp/poetry-cache/*

Expand Down

0 comments on commit 95f8cef

Please sign in to comment.