From 2c91896070a0580eaa7ad233952e2e44c72eb0e6 Mon Sep 17 00:00:00 2001 From: Andrew Morgan <1342360+anoadragon453@users.noreply.github.com> Date: Wed, 12 Nov 2025 12:02:50 +0000 Subject: [PATCH] Run trial tests on Python 3.14 in PRs (#19135) --- .ci/scripts/calculate_jobs.py | 39 +++++++++++++++++++++-------------- changelog.d/19135.misc | 1 + 2 files changed, 25 insertions(+), 15 deletions(-) create mode 100644 changelog.d/19135.misc diff --git a/.ci/scripts/calculate_jobs.py b/.ci/scripts/calculate_jobs.py index 87fbc7a266..810d41bfd4 100755 --- a/.ci/scripts/calculate_jobs.py +++ b/.ci/scripts/calculate_jobs.py @@ -35,46 +35,55 @@ IS_PR = os.environ["GITHUB_REF"].startswith("refs/pull/") # First calculate the various trial jobs. # -# For PRs, we only run each type of test with the oldest Python version supported (which -# is Python 3.10 right now) +# For PRs, we only run each type of test with the oldest and newest Python +# version that's supported. The oldest version ensures we don't accidentally +# introduce syntax or code that's too new, and the newest ensures we don't use +# code that's been dropped in the latest supported Python version. trial_sqlite_tests = [ { "python-version": "3.10", "database": "sqlite", "extras": "all", - } + }, + { + "python-version": "3.14", + "database": "sqlite", + "extras": "all", + }, ] if not IS_PR: + # Otherwise, check all supported Python versions. + # + # Avoiding running all of these versions on every PR saves on CI time. trial_sqlite_tests.extend( { "python-version": version, "database": "sqlite", "extras": "all", } - for version in ("3.11", "3.12", "3.13", "3.14") + for version in ("3.11", "3.12", "3.13") ) +# Only test postgres against the earliest and latest Python versions that we +# support in order to save on CI time. trial_postgres_tests = [ { "python-version": "3.10", "database": "postgres", "postgres-version": "13", "extras": "all", - } + }, + { + "python-version": "3.14", + "database": "postgres", + "postgres-version": "17", + "extras": "all", + }, ] -if not IS_PR: - trial_postgres_tests.append( - { - "python-version": "3.14", - "database": "postgres", - "postgres-version": "17", - "extras": "all", - } - ) - +# Ensure that Synapse passes unit tests even with no extra dependencies installed. trial_no_extra_tests = [ { "python-version": "3.10", diff --git a/changelog.d/19135.misc b/changelog.d/19135.misc new file mode 100644 index 0000000000..8d0c56a7ec --- /dev/null +++ b/changelog.d/19135.misc @@ -0,0 +1 @@ +Run trial tests on Python 3.14 for PRs. \ No newline at end of file