Skip to content

Commit 7a4a9b7

Browse files
committed
add Python 3.15
Add 3.15 to the noxfile Python matrix and to the trove classifiers. Also drop 3.13t from the matrix. The free threaded 3.13 build has been retired from the CI build followers, and no pipeline places py313t on an axis, so the entry was inert. Widen the supported interpreter range in tools/write_pyi.py to admit 3.15. The script refused to run outside of 3.14, so under 3.15 it raised before writing anything and tests/test_stubs.py compared the checked-in stubs against empty output. 3.15 renders annotations identically to 3.14, and regenerating under 3.15 reproduces alembic/op.pyi and alembic/context.pyi byte for byte, so no stub changes accompany this. A workaround in the test suite warning filters is needed for a Mako issue under 3.15. Mako compiles in-memory templates into a bare types.ModuleType, whose globals carry __spec__ = None together with __loader__ = None, and Python 3.15's linecache._bless_my_loader emits a DeprecationWarning for exactly that shape. In TemplateArgsTest::test_bad_render in tests/test_script_production.py the warning is raised while the traceback for the deliberately-broken template is being formatted, and as warnings are errors here that surfaces as a pytest INTERNALERROR, which under xdist aborts the whole run. That specific warning is therefore ignored for now; the filter can be dropped once a Mako release carrying the fix is required. See sqlalchemy/mako#437. With these in place the suite under 3.15 matches 3.14 exactly. py315: yes Change-Id: If4aad3366ab278ce01eba03b31e2cd3897cc7d7c
1 parent a281d78 commit 7a4a9b7

4 files changed

Lines changed: 15 additions & 2 deletions

File tree

‎alembic/testing/warnings.py‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,18 @@ def setup_filters():
2121

2222
# some selected deprecations...
2323
warnings.filterwarnings("error", category=DeprecationWarning)
24+
25+
# Python 3.15 emits this from linecache when a traceback is formatted
26+
# for a frame belonging to a module that has no __spec__, which is the
27+
# case for Mako's string-based template modules. Fixed in Mako via
28+
# https://github.com/sqlalchemy/mako/issues/437; remove this filter
29+
# once a Mako release including that fix is required.
30+
warnings.filterwarnings(
31+
"ignore",
32+
r"Module globals is missing a __spec__\.loader",
33+
DeprecationWarning,
34+
)
35+
2436
try:
2537
import pytest
2638
except ImportError:

‎noxfile.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@
2727
"3.11",
2828
"3.12",
2929
"3.13",
30-
"3.13t",
3130
"3.14",
3231
"3.14t",
32+
"3.15",
3333
]
3434
DATABASES = ["sqlite", "postgresql", "mysql", "oracle", "mssql"]
3535
SQLALCHEMY_VERSIONS = ["default", "sqla14", "sqla20", "sqlamain"]

‎pyproject.toml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ classifiers = [
2121
"Programming Language :: Python :: 3.12",
2222
"Programming Language :: Python :: 3.13",
2323
"Programming Language :: Python :: 3.14",
24+
"Programming Language :: Python :: 3.15",
2425
"Programming Language :: Python :: Implementation :: CPython",
2526
"Programming Language :: Python :: Implementation :: PyPy",
2627
"Topic :: Database :: Front-Ends",

‎tools/write_pyi.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
import sqlalchemy as sa
3535

3636
BLACK_VERSION = (25, 9, 0)
37-
PYTHON_VERSIONS = (3, 14), (3, 15)
37+
PYTHON_VERSIONS = (3, 14), (3, 16)
3838

3939

4040
TRIM_MODULE = [

0 commit comments

Comments
 (0)