Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions MIGRATION_GUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ Looking to upgrade from Sentry SDK 2.x to 3.x? Here's a comprehensive list of wh
- Dropped support for Flask below 2.0.
- Dropped support for Chalice below 1.22.
- Dropped support for aiohttp below 3.7.
- Dropped support for Starlette below 0.20.
- Dropped support for FastAPI below 0.85.
- Dropped support for trytond below 5.4.
- Removed the possibility to supply a specific client to the LaunchDarklyIntegration.
- The `enable_tracing` option was removed. Use `traces_sample_rate=1.0` instead.
Expand Down
7 changes: 5 additions & 2 deletions scripts/populate_tox/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,11 @@
# FastAPI versions we use older httpx which still supports the
# deprecated argument.
"<0.110.1": ["httpx<0.28.0"],
"<0.80": ["anyio<4"],
# Old Starlette (< 0.21, used by FastAPI < 0.95) uses
# anyio.start_blocking_portal (removed in anyio 4) and its
# TestClient _MockOriginalResponse lacks close() (called by
# urllib3 >= 2).
"<0.95.0": ["anyio<4", "urllib3<2"],
},
},
"flask": {
Expand Down Expand Up @@ -468,7 +472,6 @@
],
# See the comment on FastAPI's httpx bound for more info
"<0.37.2": ["httpx<0.28.0"],
"<0.15": ["jinja2<3.1"],

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing Starlette urllib3 pin

Medium Severity

The new FastAPI deps comment says Starlette below 0.21 needs urllib3&lt;2 because _MockOriginalResponse lacks close(), and FastAPI now pins that. The Starlette suite still tests 0.20.4 and installs requests without the same pin, so those envs can still resolve urllib3 2.x and hit the TestClient failure this change is meant to avoid.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 4aa551b. Configure here.

},
},
"starlite": {
Expand Down
90 changes: 15 additions & 75 deletions scripts/populate_tox/package_dependencies.jsonl

Large diffs are not rendered by default.

1,223 changes: 3 additions & 1,220 deletions scripts/populate_tox/releases.jsonl

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions sentry_sdk/integrations/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ def iter_default_integrations(
"django": (2, 0),
"dramatiq": (1, 9),
"falcon": (3, 0),
"fastapi": (0, 79, 0),
"fastapi": (0, 85, 0),
"flask": (2, 0, 0),
"gql": (3, 4, 1),
"graphene": (3, 3),
Expand Down Expand Up @@ -170,7 +170,7 @@ def iter_default_integrations(
"sanic": (0, 8),
"spark": (3, 0), # pyspark
"sqlalchemy": (1, 4),
"starlette": (0, 16),
"starlette": (0, 20),
"starlite": (1, 48),
"statsig": (0, 55, 3),
"strawberry": (0, 209, 5),
Expand Down
8 changes: 1 addition & 7 deletions sentry_sdk/integrations/starlette.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,20 +64,14 @@
from starlette.middleware.authentication import (
AuthenticationMiddleware,
)
from starlette.middleware.exceptions import ExceptionMiddleware
from starlette.requests import Request
from starlette.routing import Match
from starlette.types import ASGIApp, Receive, Send
from starlette.types import Scope as StarletteScope
except ImportError:
raise DidNotEnable("Starlette is not installed")

try:
# Starlette 0.20
from starlette.middleware.exceptions import ExceptionMiddleware
except ImportError:
# Startlette 0.19.1
from starlette.exceptions import ExceptionMiddleware # type: ignore

try:
# Optional dependency of Starlette to parse form data.
try:
Expand Down
Loading
Loading