Status: Accepted
Lambda adds a Python runtime shortly after each CPython release and deprecates runtimes on its own schedule. Customers move at different speeds, and a library that drops a version early strands people who cannot upgrade yet, while a library that lags blocks early adopters from using the newest runtime.
Our supported Python versions are exactly the Python runtimes Lambda supports.
- We add a version when the Lambda runtime becomes available, and ideally test against pre-release builds so support lands on day one.
- We drop a version only after Lambda deprecates its runtime, following the Lambda runtime deprecation dates.
- The CI matrix (
quality_check) runs the full suite on every supported version. Green on one version is not green. - Syntax and standard-library usage are limited to the oldest supported version. Newer language features arrive when the oldest runtime that lacks them is dropped, never before.
- The Lambda layer is published for every supported version and both architectures (ADR 0004).
requires-pythoninpyproject.tomland the CI matrix move together, in a dedicated maintenance PR, not as a side effect of a feature.- Code that needs a newer feature carries a compatibility path or waits.
- Dependencies we accept must themselves support the whole range (ADR 0007).
Check the oldest version in the matrix before using a new syntax or stdlib API. If CI only ran on the latest version locally, run at least the oldest one too.