Skip to content

Add support for Python 3.13 in templates, CI, and codebase #1364

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

Merged
merged 9 commits into from
Apr 24, 2025

Conversation

RemyTinco
Copy link
Contributor

@RemyTinco RemyTinco commented Mar 8, 2025

Description

This PR adds support for Python 3.13 in Zappa, enabling deployments on AWS Lambda with the latest Python runtime.

The following updates have been made:

  • Updated SUPPORTED_VERSIONS in zappa/__init__.py to include Python 3.13.
  • Added Python 3.13 to get_runtime_from_python_version() in zappa/utilities.py.
  • Updated the GitHub CI pipeline (.github/workflows/ci.yml) to test against Python 3.13.
  • Modified setup.py classifiers to reflect Python 3.13 support.
  • Updated README.md and issue templates to mention Python 3.13 compatibility.
  • Added a test case in tests/tests.py for verifying Python 3.13 runtime compatibility.

Testing

This PR was tested by:
🟧 Running CI tests across supported Python versions (3.8 – 3.13).
🟩 Deploying a test Zappa application with Python 3.13 to AWS Lambda.
🟩 : Running unit tests to verify manylinux wheel compatibility with Python 3.13.

GitHub Issue Reference

Closes #1363

@monkut
Copy link
Collaborator

monkut commented Mar 18, 2025

You need to install pre-commit:

pre-commit install

And then re-commit. It's failing on the linter.

@bheemaguli
Copy link

bheemaguli commented Mar 27, 2025

Linting fixed here @RemyTinco

RemyTinco and others added 2 commits April 5, 2025 10:16
@RemyTinco
Copy link
Contributor Author

I successfully deployed a Django REST Framework (DRF) project on Python 3.13 using this branch of Zappa.

Installed the branch locally with pip:

python --version
Python 3.13.2

pip install ../Zappa
...
Successfully installed zappa-0.59.0

Here’s the project repo I used for testing: https://github.com/RemyTinco/drf-zappa-poc-313
It includes a simple view that returns the Python version from the deployed Lambda environment.

The app is live here: https://6fmlmc1r2g.execute-api.eu-west-2.amazonaws.com/dev/api/version/

Here’s the JSON response from the /api/version/ endpoint:

Python Version  
GET /dev/api/version/  
HTTP 200 OK  
Allow: OPTIONS, GET  
Content-Type: application/json  
Vary: Accept

{
    "python_version": "3.13.2 (main, Feb 21 2025, 10:14:07) [GCC 11.4.1 20230605 (Red Hat 11.4.1-2)]"
}

@RemyTinco
Copy link
Contributor Author

Hey @monkut, all the code changes are in and the test deployment to AWS with Python 3.13 looks good (shared above). I'm just waiting on the CI checks to start/finish.

In the meantime, happy to receive any review or thoughts on next steps whenever you have a moment!

@RemyTinco RemyTinco marked this pull request as ready for review April 5, 2025 09:37
@bheemaguli
Copy link

bheemaguli commented Apr 8, 2025

I Can attest to Remy. I have deployed my app TallyOnWheels with Python 3.13 without any hiccups. All lamda invocation seems to be happening without any issue.

@RemyTinco RemyTinco requested a review from eviltwin April 11, 2025 10:39
@monkut monkut enabled auto-merge (squash) April 14, 2025 07:17
@monkut
Copy link
Collaborator

monkut commented Apr 15, 2025

@RemyTinco

Looks like the version of django used in the testcase requires cgi which was removed in python 3.13.
Can you update the django version used in testing?

@monkut
Copy link
Collaborator

monkut commented Apr 16, 2025

@RemyTinco

Sorry about the delays, we've had some org/project issues that recently got sorted out.
Once this passes and get's merged, I'll issue a release!

🔨 add legacy-cgi to dev-packages to resolve testcase FAILURE: FAILED tests/tests_utilities.py::GeneralUtilitiesTestCase::test_dj_wsgi - ModuleNotFoundError: No module named 'cgi'
:arrow_up: update pip min version dependency
:arrow_up: update requests min version dependency
:arrow_up: update tqdm min version dependency
:arrow_up: update django min version dev dependency
:arrow_up: update black min version dev dependency
@coveralls
Copy link

Coverage Status

coverage: 74.824% (+0.03%) from 74.797%
when pulling 572bc8b on RemyTinco:feature/python313
into b83a1da on zappa:master.

Copy link

@maruryota maruryota left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@monkut monkut merged commit 71b82d7 into zappa:master Apr 24, 2025
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add Python 3.13 Support
7 participants