-
Notifications
You must be signed in to change notification settings - Fork 74
Description
Overview
With the next major release of Runway, I would like to raise the minimum required version of Python to align with Runway's dependencies, Python's release/EoL schedule, and enable our developers to innovate with the newest features of Python.
Context
Currently Runway's minimum required version of Python is 3.9.
Python 3.9 enters it's end of life 2025-10.
Even though 3.9 is still ~1 year from end of life, it is already being dropped from some of Runway's dependencies.
Although it is only used to generate documentation, Sphinx is the most impactful of these.
Python 3.9 also lacks numerous improvements to type annotations.
The gaps are reduced in size by typing_extensions, there are still syntax shortcomings that cannot be overcome.
Goals
- Utilize the latest features of Python to improve Runway's codebase.
- Provide great type annotations in Runway's codebase.
Non-Goals
- Follow macOS system Python as the minimum required version.
- Follow Linux system or package installable Python as the minimum required version.
- Use the absolute latest version of Python (3.13) as the minimum required version.
Proposed Solution
Previous discussions among Runway's maintainers landed us on 3.10 as the version to move forward with.
However, I would like to reopen this discussion as I was recently reminded of some of the drawbacks when attempting to lower the minimum required version of another package I maintain from 3.11 to 3.10 so that it would be usable here.
I would like to propose raising the minimum required version of Python to 3.11.
Some of the key changes in 3.11 that would impact Runway's codebase include:
- PEP 654: Exception Groups and except*
- provides Runway more ways to catch and raise informative errors
- PEP 678: Exceptions can be enriched with notes
- provide Runway additional ways to include information in the errors that it raises
- PEP 680:
tomllib— Support for parsing TOML in the Standard Library- reduces complexity when reading from TOML files & allows Runway to drop a dependency (
tomli)
- reduces complexity when reading from TOML files & allows Runway to drop a dependency (
- PEP 655: Marking individual TypedDict items as required or not-required
- reduces complexity when authoring
TypedDicts
- reduces complexity when authoring
- PEP 673: Self type
- reduces complexity by removing the need to conditionally use
typing_extensions.Selfdepending on Python version
- reduces complexity by removing the need to conditionally use
- various typing improvements turning standard library classes into generics (which raises a
TypeErrorif attempted with older versions of Python)logging.LoggerAdapteris the main one that comes to mind (example)
Alternative Solutions
3.10
Some of the key changes in 3.10 that would impact Runway's codebase include:
- PEP 634: Structural Pattern Matching
- PEP 604: Allow writing union types as
X | Y- allows the use of
|unions inpydanticmodels - allows the use of unions in
isinstance()(e.g.isinstance(value, list | set)vsisinstance(value, (list, set)))
- allows the use of
- PEP 612: Parameter Specification Variables
- PEP 613: Explicit Type Aliases
- PEP 647: User-Defined Type Guards
Note that any of the proposed minimum Python versions benefit from these changes with this being the lowest of the three.
3.12
I am not going to go into detail here because, while I feel using 3.12 > 3.11 is better it may overly limit Runway's user base due to it still being fairly new.
Impact
- users of Runway may need to install a newer version of Python
pyenvprovides an easy way to do this- for those using older versions of Python, dependency management tools (e.g.
pipandpoetry) will not allow the installation of the newest major release of Runway even if explicitly requested
Metadata
Metadata
Assignees
Labels
Type
Projects
Status