Skip to content

Commit e0838c2

Browse files
authored
Drop Python 3.9, bump tests/builds to Python 3.10 (#19099)
Python 3.9 EOL is on 2025-10-31
1 parent 32998d0 commit e0838c2

File tree

16 files changed

+59
-65
lines changed

16 files changed

+59
-65
lines changed

.ci/scripts/calculate_jobs.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,11 @@ def set_output(key: str, value: str):
3636
# First calculate the various trial jobs.
3737
#
3838
# For PRs, we only run each type of test with the oldest Python version supported (which
39-
# is Python 3.9 right now)
39+
# is Python 3.10 right now)
4040

4141
trial_sqlite_tests = [
4242
{
43-
"python-version": "3.9",
43+
"python-version": "3.10",
4444
"database": "sqlite",
4545
"extras": "all",
4646
}
@@ -53,12 +53,12 @@ def set_output(key: str, value: str):
5353
"database": "sqlite",
5454
"extras": "all",
5555
}
56-
for version in ("3.10", "3.11", "3.12", "3.13")
56+
for version in ("3.11", "3.12", "3.13")
5757
)
5858

5959
trial_postgres_tests = [
6060
{
61-
"python-version": "3.9",
61+
"python-version": "3.10",
6262
"database": "postgres",
6363
"postgres-version": "13",
6464
"extras": "all",
@@ -77,7 +77,7 @@ def set_output(key: str, value: str):
7777

7878
trial_no_extra_tests = [
7979
{
80-
"python-version": "3.9",
80+
"python-version": "3.10",
8181
"database": "sqlite",
8282
"extras": "",
8383
}

.github/workflows/release-artifacts.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ jobs:
145145

146146
- name: Only build a single wheel on PR
147147
if: startsWith(github.ref, 'refs/pull/')
148-
run: echo "CIBW_BUILD="cp39-manylinux_*"" >> $GITHUB_ENV
148+
run: echo "CIBW_BUILD="cp310-manylinux_*"" >> $GITHUB_ENV
149149

150150
- name: Build wheels
151151
run: python -m cibuildwheel --output-dir wheelhouse

.github/workflows/tests.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -470,7 +470,7 @@ jobs:
470470
471471
- uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0
472472
with:
473-
python-version: '3.9'
473+
python-version: '3.10'
474474

475475
- name: Prepare old deps
476476
if: steps.cache-poetry-old-deps.outputs.cache-hit != 'true'
@@ -514,7 +514,7 @@ jobs:
514514
runs-on: ubuntu-latest
515515
strategy:
516516
matrix:
517-
python-version: ["pypy-3.9"]
517+
python-version: ["pypy-3.10"]
518518
extras: ["all"]
519519

520520
steps:
@@ -638,7 +638,7 @@ jobs:
638638
strategy:
639639
matrix:
640640
include:
641-
- python-version: "3.9"
641+
- python-version: "3.10"
642642
postgres-version: "13"
643643

644644
- python-version: "3.13"

build_rust.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,12 @@ def build(setup_kwargs: dict[str, Any]) -> None:
2727
setup_kwargs["zip_safe"] = False
2828

2929
# We look up the minimum supported Python version with
30-
# `python_requires` (e.g. ">=3.9.0,<4.0.0") and finding the first Python
30+
# `python_requires` (e.g. ">=3.10.0,<4.0.0") and finding the first Python
3131
# version that matches. We then convert that into the `py_limited_api` form,
32-
# e.g. cp39 for Python 3.9.
32+
# e.g. cp310 for Python 3.10.
3333
py_limited_api: str
3434
python_bounds = SpecifierSet(setup_kwargs["python_requires"])
35-
for minor_version in itertools.count(start=8):
35+
for minor_version in itertools.count(start=10):
3636
if f"3.{minor_version}.0" in python_bounds:
3737
py_limited_api = f"cp3{minor_version}"
3838
break

changelog.d/19099.removal

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Drop support for Python 3.9.

docker/editable.Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#
44
# Used by `complement.sh`. Not suitable for production use.
55

6-
ARG PYTHON_VERSION=3.9
6+
ARG PYTHON_VERSION=3.10
77

88
###
99
### Stage 0: generate requirements.txt

docs/development/dependencies.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,17 +79,17 @@ phonenumbers = [
7979
We can see this pinned version inside the docker image for that release:
8080

8181
```
82-
$ docker pull vectorim/synapse:v1.97.0
82+
$ docker pull matrixdotorg/synapse:latest
8383
...
84-
$ docker run --entrypoint pip vectorim/synapse:v1.97.0 show phonenumbers
84+
$ docker run --entrypoint pip matrixdotorg/synapse:latest show phonenumbers
8585
Name: phonenumbers
86-
Version: 8.12.44
86+
Version: 9.0.15
8787
Summary: Python version of Google's common library for parsing, formatting, storing and validating international phone numbers.
8888
Home-page: https://github.com/daviddrysdale/python-phonenumbers
8989
Author: David Drysdale
9090
Author-email: [email protected]
9191
License: Apache License 2.0
92-
Location: /usr/local/lib/python3.9/site-packages
92+
Location: /usr/local/lib/python3.12/site-packages
9393
Requires:
9494
Required-by: matrix-synapse
9595
```

docs/setup/installation.md

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ When following this route please make sure that the [Platform-specific prerequis
204204
System requirements:
205205

206206
- POSIX-compliant system (tested on Linux & OS X)
207-
- Python 3.9 or later, up to Python 3.13.
207+
- Python 3.10 or later, up to Python 3.13.
208208
- At least 1GB of free RAM if you want to join large public rooms like #matrix:matrix.org
209209

210210
If building on an uncommon architecture for which pre-built wheels are
@@ -307,11 +307,16 @@ sudo dnf group install "Development Tools"
307307

308308
##### Red Hat Enterprise Linux / Rocky Linux / Oracle Linux
309309

310-
*Note: The term "RHEL" below refers to Red Hat Enterprise Linux, Oracle Linux and Rocky Linux. The distributions are 1:1 binary compatible.*
310+
*Note: The term "RHEL" below refers to Red Hat Enterprise Linux, Oracle Linux and Rocky Linux.
311+
The distributions are 1:1 binary compatible.*
311312

312313
It's recommended to use the latest Python versions.
313314

314-
RHEL 8 in particular ships with Python 3.6 by default which is EOL and therefore no longer supported by Synapse. RHEL 9 ships with Python 3.9 which is still supported by the Python core team as of this writing. However, newer Python versions provide significant performance improvements and they're available in official distributions' repositories. Therefore it's recommended to use them.
315+
RHEL 8 & 9 in particular ship with Python 3.6 & 3.9 respectively by default
316+
which are EOL and therefore no longer supported by Synapse.
317+
However, newer Python versions provide significant performance improvements
318+
and they're available in official distributions' repositories.
319+
Therefore it's recommended to use them.
315320

316321
Python 3.11 and 3.12 are available for both RHEL 8 and 9.
317322

docs/upgrade.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,18 @@ each upgrade are complete before moving on to the next upgrade, to avoid
117117
stacking them up. You can monitor the currently running background updates with
118118
[the Admin API](usage/administration/admin_api/background_updates.html#status).
119119
120+
# Upgrading to v1.142.0
121+
122+
## Minimum supported Python version
123+
124+
The minimum supported Python version has been increased from v3.9 to v3.10.
125+
You will need Python 3.10+ to run Synapse v1.142.0.
126+
127+
If you use current versions of the
128+
[matrixorg/synapse](setup/installation.html#docker-images-and-ansible-playbooks)
129+
Docker images, no action is required.
130+
131+
120132
# Upgrading to v1.141.0
121133
122134
## Docker images now based on Debian `trixie` with Python 3.13

mypy.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ strict_equality = True
3737

3838
# Run mypy type checking with the minimum supported Python version to catch new usage
3939
# that isn't backwards-compatible (types, overloads, etc).
40-
python_version = 3.9
40+
python_version = 3.10
4141

4242
files =
4343
docker/,

0 commit comments

Comments
 (0)