Skip to content

Commit 95f8cef

Browse files
authored
fix(lambda-python): poetry bundling is broken after Aug 20 (#26823)
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*
1 parent 00a7f03 commit 95f8cef

File tree

1 file changed

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

1 file changed

+3
-2
lines changed

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

+3-2
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ FROM $IMAGE
66
ARG PIP_INDEX_URL
77
ARG PIP_EXTRA_INDEX_URL
88
ARG HTTPS_PROXY
9+
ARG POETRY_VERSION=1.5.1
910

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

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

0 commit comments

Comments
 (0)