Skip to content

Commit 3ecd2af

Browse files
authored
Add support for Python 3.15 (#3688)
1 parent 4b5fe5a commit 3ecd2af

5 files changed

Lines changed: 644 additions & 187 deletions

File tree

‎.github/workflows/shared.yml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ jobs:
5555
strategy:
5656
fail-fast: false
5757
matrix:
58-
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
58+
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14", "3.15"]
5959
dep-resolution:
6060
- name: lowest-direct
6161
install-flags: "--upgrade --resolution lowest-direct"
@@ -72,7 +72,7 @@ jobs:
7272
uses: astral-sh/setup-uv@bec219d24cd3e171d82865faccec33120bb574f4 # v10.1.0
7373
with:
7474
enable-cache: true
75-
version: 0.9.5
75+
version: 0.12.24
7676

7777
- name: Install the project
7878
run: uv sync ${{ matrix.dep-resolution.install-flags }} --all-extras --python ${{ matrix.python-version }}

‎pyproject.toml‎

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ classifiers = [
2323
"Programming Language :: Python :: 3.12",
2424
"Programming Language :: Python :: 3.13",
2525
"Programming Language :: Python :: 3.14",
26+
"Programming Language :: Python :: 3.15",
2627
]
2728
[project.optional-dependencies]
2829
rich = ["rich>=13.9.4"]
@@ -73,11 +74,13 @@ dev = [
7374
"inline-snapshot>=0.23.0",
7475
"dirty-equals>=0.9.0",
7576
"coverage[toml]>=7.10.7,<=7.13",
76-
"pillow>=12.0",
77+
"pillow>=12.3; python_version >= '3.15'",
78+
"pillow>=12.0; python_version < '3.15'",
7779
"strict-no-cover",
7880
"logfire>=3.0.0",
7981
"opentelemetry-sdk>=1.39.1",
80-
"blockbuster>=1.5.27",
82+
"blockbuster>=1.5.29; python_version >= '3.15'",
83+
"blockbuster>=1.5.27; python_version < '3.15'",
8184
]
8285
docs = [
8386
# Zensical is the Material team's successor to MkDocs; it natively
@@ -133,14 +136,16 @@ dependencies = [
133136
"anyio>=4.9; python_version < '3.14'",
134137
"httpx2>=2.10.0",
135138
"mcp-types=={{ version }}",
136-
"pydantic>=2.12.0",
139+
"pydantic>=2.14.0; python_version >= '3.15'",
140+
"pydantic>=2.12.0; python_version < '3.15'",
137141
"starlette>=0.48.0; python_version >= '3.14'",
138142
"starlette>=0.27; python_version < '3.14'",
139143
"python-multipart>=0.0.9",
140144
"sse-starlette>=3.0.0",
141145
"uvicorn>=0.31.1; sys_platform != 'emscripten'",
142146
"jsonschema>=4.20.0",
143-
"pywin32>=311; sys_platform == 'win32'",
147+
"pywin32>=312; sys_platform == 'win32' and python_version >= '3.15'",
148+
"pywin32>=311; sys_platform == 'win32' and python_version < '3.15'",
144149
"pyjwt[crypto]>=2.10.1",
145150
"typing-extensions>=4.13.0",
146151
"typing-inspection>=0.4.1",

‎src/mcp-types/pyproject.toml‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,11 @@ classifiers = [
2323
"Programming Language :: Python :: 3.12",
2424
"Programming Language :: Python :: 3.13",
2525
"Programming Language :: Python :: 3.14",
26+
"Programming Language :: Python :: 3.15",
2627
]
2728
dependencies = [
28-
"pydantic>=2.12.0",
29+
"pydantic>=2.14.0; python_version >= '3.15'",
30+
"pydantic>=2.12.0; python_version < '3.15'",
2931
"typing-extensions>=4.13.0",
3032
]
3133

‎tests/conftest.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ def blockbuster() -> Iterator[None]:
3535
bb.functions["os.stat"].can_block_in("coverage/python.py", "get_python_source")
3636
bb.functions["io.BufferedReader.read"].can_block_in("coverage/python.py", "read_python_source")
3737
# jsonschema discovers its bundled schemas during its first import.
38-
bb.functions["os.listdir"].can_block_in("/jsonschema_specifications/_core.py", "_schemas")
39-
bb.functions["os.scandir"].can_block_in("/jsonschema_specifications/_core.py", "_schemas")
38+
for name in bb.functions.keys() & {"os.listdir", "os.scandir"}:
39+
bb.functions[name].can_block_in("/jsonschema_specifications/_core.py", "_schemas")
4040
bb.functions["io.TextIOWrapper.read"].can_block_in("/jsonschema_specifications/_core.py", "_schemas")
4141
# These public synchronous conversions read the media file by design.
4242
bb.functions["io.BufferedReader.read"].can_block_in(

0 commit comments

Comments
 (0)