-
-
Notifications
You must be signed in to change notification settings - Fork 29
Description
Problem
Python 3.9 reaches end-of-life (EOL) on October 31, 2025 (next week). After this date, Python 3.9 will no longer receive security updates or bug fixes, making it a security risk for projects to continue supporting it.
Additionally, continuing to support Python 3.9 prevents us from leveraging modern Python features, particularly the improved type annotation syntax introduced in Python 3.10. As mentioned in #120, modern Python typing should use the | syntax (e.g., str | None) instead of the older Union syntax from the typing module, but this feature requires Python 3.10+.
Currently, the extension template requires Python 3.9+ and tests against Python 3.9 in CI, which:
- Limits our ability to use modern Python typing features
- Will create a security liability after EOL
- Contradicts the goal of generating modern, best-practice code
Proposed Solution
Update minimum Python version to 3.10 by making the following changes:
-
Update
template/pyproject.toml.jinja:- Change line 9:
requires-python = ">=3.10" - Remove line 21:
"Programming Language :: Python :: 3.9",
- Change line 9:
-
Update
.github/workflows/main.yml:- Remove Python 3.9 from all test matrices:
- Line 162:
settingsjob - Line 210:
serverjob - Line 340:
test_isolatedjob - Line 380:
themejob - Line 424:
mimerendererjob
- Line 162:
- Update all matrices to use
["3.10", "3.13"]instead of["3.9", "3.13"]
- Remove Python 3.9 from all test matrices:
Additional context
- Python 3.9 EOL date: https://endoflife.date/python
- This was suggested by @krassowski in Add Python type annotations and type checking to template #120 (comment)
- Python 3.10 introduced PEP 604 (union types as
X | Y), PEP 612 (Parameter Specification Variables), and PEP 613 (TypeAlias), all of which improve type annotation ergonomics - JupyterLab 4.0+ already requires Python 3.8+, so bumping to 3.10 aligns with keeping dependencies reasonably modern
- Most major Linux distributions now ship with Python 3.10+ by default (Ubuntu 22.04+, Debian 12+, Fedora 35+)