Open imortkz opened 5 months ago
Hey @imortkz, thank you for reaching, marking this as feature-request to upgrade the default python runtime. From https://github.com/aws-amplify/amplify-cli/blob/6340adbb6f02e139128c712719d8054d8fab5ad1/packages/amplify-python-function-runtime-provider/src/util/buildUtils.ts#L10
you should be able to update the runtime in the CloudFormation template and pip file present in the function to 3.10, then run amplify build function
to build the function locally before pushing.
It's supposed to work for new function only?
Tried that with already deployed Python lambda function, didn't work:
Pipfile.lock (a89a07) out of date, updating to (296d86)... Locking [packages] dependencies... Building requirements... Resolving dependencies... ✔ Success! Locking [dev-packages] dependencies... Updated Pipfile.lock (4575da8dd7dda667a455b5ea8c5b6bf1c2a8fde62a8d4b747ada6e2146296d86)! Installing dependencies from Pipfile.lock (296d86)... To activate this project's virtualenv, run pipenv shell. Alternatively, run a command inside the virtualenv with pipenv run. 🛑 Could not find a pipenv site-packages directory at /Users/username/.local/share/virtualenvs/function-yFQL_vgG/lib/python3.10/site-packages
Learn more at: https://docs.amplify.aws/cli/project/troubleshooting/
Session Identifier: e4c545fe-1701-4253-8053-da203153cc0f
I guess the problem is that virtualenv was already built for Python 3.8
Can you please recommend steps to migrate function from 3.8 to 3.10 properly?
@imortkz the information is currently documented here: https://docs.amplify.aws/react/build-a-backend/functions/configure-options/#updating-the-runtime you will need to ensure the python version is installed locally as well for the push to build the function
@ykethan I am having the same issue, updating the runtime in the cloudformation template json does not appear to be sufficient for python. Can you point us to a guide specifically for python (and not node)?
+1. Just want to emphasize these dates for the amplify team:
Starting February 28, 2025, you will no longer be able to create new Lambda functions using the Python 3.8 runtime. Starting March 31, 2025, you will no longer be able to update existing functions using the Python 3.8 runtime.
Amplify CLI Version
12.11.1
Question
The latest Amplify version still generates v3.8 Python runtime, while it will be EOL soon:
I can manually update the CloudFormation for lambda function to use v3.10 runtime, but it still will create a v3.8 venv.
Is there any plans to upgrade a default Python runtime?