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
1 change: 1 addition & 0 deletions MIGRATION_GUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ Looking to upgrade from Sentry SDK 2.x to 3.x? Here's a comprehensive list of wh
- Dropped support for greenlet versions below 0.4.17.
- Dropped support for Falcon versions below 3.0.
- Dropped support for Flask below 2.0.
- Dropped support for Chalice below 1.22.
- Dropped support for aiohttp below 3.7.
- The `enable_tracing` option was removed. Use `traces_sample_rate=1.0` instead.
- The deprecated `push_scope` and `configure_scope` APIs have been removed. Use `with new_scope():` to push a new scope and `scope = get_current_scope()` to retrieve the current scope instead.
Expand Down
5 changes: 4 additions & 1 deletion scripts/populate_tox/package_dependencies.jsonl

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions scripts/populate_tox/releases.jsonl

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion sentry_sdk/integrations/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ def iter_default_integrations(
"boto3": (1, 16), # botocore
"bottle": (0, 12),
"celery": (5, 0, 0),
"chalice": (1, 16, 0),
"chalice": (1, 22, 0),
"clickhouse_driver": (0, 2, 0),
"cohere": (5, 4, 0),
"django": (2, 0),
Expand Down
18 changes: 5 additions & 13 deletions sentry_sdk/integrations/chalice.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,12 @@

try:
import chalice # type: ignore
from chalice import Chalice, ChaliceViewError
from chalice import ChaliceViewError
from chalice import __version__ as CHALICE_VERSION
from chalice.app import ( # type: ignore
EventSourceHandler as ChaliceEventSourceHandler,
)
from chalice.app import RestAPIEventHandler
except ImportError:
raise DidNotEnable("Chalice is not installed")

Expand Down Expand Up @@ -160,14 +161,7 @@ def setup_once() -> None:
if version is None:
return

if version < (1, 20):
old_get_view_function_response = Chalice._get_view_function_response
else:
from chalice.app import RestAPIEventHandler

old_get_view_function_response = (
RestAPIEventHandler._get_view_function_response
)
old_get_view_function_response = RestAPIEventHandler._get_view_function_response

def sentry_event_response(
app: "Any", view_function: "F", function_args: "Dict[str, Any]"
Expand All @@ -180,9 +174,7 @@ def sentry_event_response(
app, wrapped_view_function, function_args
)

if version < (1, 20):
Chalice._get_view_function_response = sentry_event_response
else:
RestAPIEventHandler._get_view_function_response = sentry_event_response
RestAPIEventHandler._get_view_function_response = sentry_event_response

# for everything else (like events)
chalice.app.EventSourceHandler = EventSourceHandler
26 changes: 2 additions & 24 deletions tox.ini

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading