Skip to content

Commit 5ea5b95

Browse files
committed
fix: resolve CI failures by bumping starlette and fixing linting/formatting
1 parent 62b21d6 commit 5ea5b95

File tree

6 files changed

+13
-16
lines changed

6 files changed

+13
-16
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ dependencies = [
3030
"httpx-sse>=0.4",
3131
"pydantic>=2.12.0",
3232
"starlette>=0.48.0; python_version >= '3.14'",
33-
"starlette>=0.27; python_version < '3.14'",
33+
"starlette>=0.40.0; python_version < '3.14'",
3434
"python-multipart>=0.0.9",
3535
"sse-starlette>=1.6.1",
3636
"pydantic-settings>=2.5.2",

scripts/update_readme_snippets.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
#!/usr/bin/env python3
21
"""Update README.md with live code snippets from example files.
32
43
This script finds specially marked code blocks in README.md and updates them
@@ -9,6 +8,8 @@
98
python scripts/update_readme_snippets.py --check # Check mode for CI
109
"""
1110

11+
from __future__ import annotations
12+
1213
import argparse
1314
import re
1415
import sys

src/mcp/server/mcpserver/server.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -869,7 +869,6 @@ async def handle_sse(scope: Scope, receive: Receive, send: Send): # pragma: no
869869
else:
870870
# Auth is disabled, no need for RequireAuthMiddleware
871871

872-
873872
# Use an ASGI-compatible wrapper to avoid Starlette's high-level route wrapping
874873
# which expects a Response object and causes double-sending.
875874
class HandleSseAsgi:

src/mcp/shared/jupyter.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
1-
2-
31
def is_jupyter() -> bool:
42
"""Check if we are running in a Jupyter notebook environment."""
53
try:
6-
shell = get_ipython().__class__.__name__ # type: ignore
7-
if shell == 'ZMQInteractiveShell':
8-
return True # Jupyter notebook or qtconsole
9-
elif shell == 'TerminalInteractiveShell':
4+
shell = get_ipython().__class__.__name__ # type: ignore
5+
if shell == "ZMQInteractiveShell":
6+
return True # Jupyter notebook or qtconsole
7+
elif shell == "TerminalInteractiveShell":
108
return False # Terminal running IPython
119
else:
1210
return False # Other type (?)
1311
except NameError:
14-
return False # Probably standard Python interpreter
12+
return False # Probably standard Python interpreter

tests/issues/test_883_middleware.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,10 @@ def test_883_middleware_post_accepted():
4444
client = TestClient(app)
4545

4646
# POST to /messages/ (with invalid session, but should not AssertionError)
47-
response = client.post("/messages/?session_id=00000000000000000000000000000000", json={
48-
"jsonrpc": "2.0",
49-
"method": "notifications/initialized",
50-
"params": {}
51-
})
47+
response = client.post(
48+
"/messages/?session_id=00000000000000000000000000000000",
49+
json={"jsonrpc": "2.0", "method": "notifications/initialized", "params": {}},
50+
)
5251

5352
# 404 is expected here as we didn't establish a real session
5453
assert response.status_code == 404

uv.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)