sentry-sdk 0.18.0__py2.py3-none-any.whl → 2.46.0__py2.py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- sentry_sdk/__init__.py +48 -6
- sentry_sdk/_compat.py +64 -56
- sentry_sdk/_init_implementation.py +84 -0
- sentry_sdk/_log_batcher.py +172 -0
- sentry_sdk/_lru_cache.py +47 -0
- sentry_sdk/_metrics_batcher.py +167 -0
- sentry_sdk/_queue.py +81 -19
- sentry_sdk/_types.py +311 -11
- sentry_sdk/_werkzeug.py +98 -0
- sentry_sdk/ai/__init__.py +7 -0
- sentry_sdk/ai/monitoring.py +137 -0
- sentry_sdk/ai/utils.py +144 -0
- sentry_sdk/api.py +409 -67
- sentry_sdk/attachments.py +75 -0
- sentry_sdk/client.py +849 -103
- sentry_sdk/consts.py +1389 -34
- sentry_sdk/crons/__init__.py +10 -0
- sentry_sdk/crons/api.py +62 -0
- sentry_sdk/crons/consts.py +4 -0
- sentry_sdk/crons/decorator.py +135 -0
- sentry_sdk/debug.py +12 -15
- sentry_sdk/envelope.py +112 -61
- sentry_sdk/feature_flags.py +71 -0
- sentry_sdk/hub.py +442 -386
- sentry_sdk/integrations/__init__.py +228 -58
- sentry_sdk/integrations/_asgi_common.py +108 -0
- sentry_sdk/integrations/_wsgi_common.py +131 -40
- sentry_sdk/integrations/aiohttp.py +221 -72
- sentry_sdk/integrations/anthropic.py +439 -0
- sentry_sdk/integrations/argv.py +4 -6
- sentry_sdk/integrations/ariadne.py +161 -0
- sentry_sdk/integrations/arq.py +247 -0
- sentry_sdk/integrations/asgi.py +237 -135
- sentry_sdk/integrations/asyncio.py +144 -0
- sentry_sdk/integrations/asyncpg.py +208 -0
- sentry_sdk/integrations/atexit.py +13 -18
- sentry_sdk/integrations/aws_lambda.py +233 -80
- sentry_sdk/integrations/beam.py +27 -35
- sentry_sdk/integrations/boto3.py +137 -0
- sentry_sdk/integrations/bottle.py +91 -69
- sentry_sdk/integrations/celery/__init__.py +529 -0
- sentry_sdk/integrations/celery/beat.py +293 -0
- sentry_sdk/integrations/celery/utils.py +43 -0
- sentry_sdk/integrations/chalice.py +35 -28
- sentry_sdk/integrations/clickhouse_driver.py +177 -0
- sentry_sdk/integrations/cloud_resource_context.py +280 -0
- sentry_sdk/integrations/cohere.py +274 -0
- sentry_sdk/integrations/dedupe.py +32 -8
- sentry_sdk/integrations/django/__init__.py +343 -89
- sentry_sdk/integrations/django/asgi.py +201 -22
- sentry_sdk/integrations/django/caching.py +204 -0
- sentry_sdk/integrations/django/middleware.py +80 -32
- sentry_sdk/integrations/django/signals_handlers.py +91 -0
- sentry_sdk/integrations/django/templates.py +69 -2
- sentry_sdk/integrations/django/transactions.py +39 -14
- sentry_sdk/integrations/django/views.py +69 -16
- sentry_sdk/integrations/dramatiq.py +226 -0
- sentry_sdk/integrations/excepthook.py +19 -13
- sentry_sdk/integrations/executing.py +5 -6
- sentry_sdk/integrations/falcon.py +128 -65
- sentry_sdk/integrations/fastapi.py +141 -0
- sentry_sdk/integrations/flask.py +114 -75
- sentry_sdk/integrations/gcp.py +67 -36
- sentry_sdk/integrations/gnu_backtrace.py +14 -22
- sentry_sdk/integrations/google_genai/__init__.py +301 -0
- sentry_sdk/integrations/google_genai/consts.py +16 -0
- sentry_sdk/integrations/google_genai/streaming.py +155 -0
- sentry_sdk/integrations/google_genai/utils.py +576 -0
- sentry_sdk/integrations/gql.py +162 -0
- sentry_sdk/integrations/graphene.py +151 -0
- sentry_sdk/integrations/grpc/__init__.py +168 -0
- sentry_sdk/integrations/grpc/aio/__init__.py +7 -0
- sentry_sdk/integrations/grpc/aio/client.py +95 -0
- sentry_sdk/integrations/grpc/aio/server.py +100 -0
- sentry_sdk/integrations/grpc/client.py +91 -0
- sentry_sdk/integrations/grpc/consts.py +1 -0
- sentry_sdk/integrations/grpc/server.py +66 -0
- sentry_sdk/integrations/httpx.py +178 -0
- sentry_sdk/integrations/huey.py +174 -0
- sentry_sdk/integrations/huggingface_hub.py +378 -0
- sentry_sdk/integrations/langchain.py +1132 -0
- sentry_sdk/integrations/langgraph.py +337 -0
- sentry_sdk/integrations/launchdarkly.py +61 -0
- sentry_sdk/integrations/litellm.py +287 -0
- sentry_sdk/integrations/litestar.py +315 -0
- sentry_sdk/integrations/logging.py +261 -85
- sentry_sdk/integrations/loguru.py +213 -0
- sentry_sdk/integrations/mcp.py +566 -0
- sentry_sdk/integrations/modules.py +6 -33
- sentry_sdk/integrations/openai.py +725 -0
- sentry_sdk/integrations/openai_agents/__init__.py +61 -0
- sentry_sdk/integrations/openai_agents/consts.py +1 -0
- sentry_sdk/integrations/openai_agents/patches/__init__.py +5 -0
- sentry_sdk/integrations/openai_agents/patches/agent_run.py +140 -0
- sentry_sdk/integrations/openai_agents/patches/error_tracing.py +77 -0
- sentry_sdk/integrations/openai_agents/patches/models.py +50 -0
- sentry_sdk/integrations/openai_agents/patches/runner.py +45 -0
- sentry_sdk/integrations/openai_agents/patches/tools.py +77 -0
- sentry_sdk/integrations/openai_agents/spans/__init__.py +5 -0
- sentry_sdk/integrations/openai_agents/spans/agent_workflow.py +21 -0
- sentry_sdk/integrations/openai_agents/spans/ai_client.py +42 -0
- sentry_sdk/integrations/openai_agents/spans/execute_tool.py +48 -0
- sentry_sdk/integrations/openai_agents/spans/handoff.py +19 -0
- sentry_sdk/integrations/openai_agents/spans/invoke_agent.py +86 -0
- sentry_sdk/integrations/openai_agents/utils.py +199 -0
- sentry_sdk/integrations/openfeature.py +35 -0
- sentry_sdk/integrations/opentelemetry/__init__.py +7 -0
- sentry_sdk/integrations/opentelemetry/consts.py +5 -0
- sentry_sdk/integrations/opentelemetry/integration.py +58 -0
- sentry_sdk/integrations/opentelemetry/propagator.py +117 -0
- sentry_sdk/integrations/opentelemetry/span_processor.py +391 -0
- sentry_sdk/integrations/otlp.py +82 -0
- sentry_sdk/integrations/pure_eval.py +20 -11
- sentry_sdk/integrations/pydantic_ai/__init__.py +47 -0
- sentry_sdk/integrations/pydantic_ai/consts.py +1 -0
- sentry_sdk/integrations/pydantic_ai/patches/__init__.py +4 -0
- sentry_sdk/integrations/pydantic_ai/patches/agent_run.py +215 -0
- sentry_sdk/integrations/pydantic_ai/patches/graph_nodes.py +110 -0
- sentry_sdk/integrations/pydantic_ai/patches/model_request.py +40 -0
- sentry_sdk/integrations/pydantic_ai/patches/tools.py +98 -0
- sentry_sdk/integrations/pydantic_ai/spans/__init__.py +3 -0
- sentry_sdk/integrations/pydantic_ai/spans/ai_client.py +246 -0
- sentry_sdk/integrations/pydantic_ai/spans/execute_tool.py +49 -0
- sentry_sdk/integrations/pydantic_ai/spans/invoke_agent.py +112 -0
- sentry_sdk/integrations/pydantic_ai/utils.py +223 -0
- sentry_sdk/integrations/pymongo.py +214 -0
- sentry_sdk/integrations/pyramid.py +71 -60
- sentry_sdk/integrations/quart.py +237 -0
- sentry_sdk/integrations/ray.py +165 -0
- sentry_sdk/integrations/redis/__init__.py +48 -0
- sentry_sdk/integrations/redis/_async_common.py +116 -0
- sentry_sdk/integrations/redis/_sync_common.py +119 -0
- sentry_sdk/integrations/redis/consts.py +19 -0
- sentry_sdk/integrations/redis/modules/__init__.py +0 -0
- sentry_sdk/integrations/redis/modules/caches.py +118 -0
- sentry_sdk/integrations/redis/modules/queries.py +65 -0
- sentry_sdk/integrations/redis/rb.py +32 -0
- sentry_sdk/integrations/redis/redis.py +69 -0
- sentry_sdk/integrations/redis/redis_cluster.py +107 -0
- sentry_sdk/integrations/redis/redis_py_cluster_legacy.py +50 -0
- sentry_sdk/integrations/redis/utils.py +148 -0
- sentry_sdk/integrations/rq.py +62 -52
- sentry_sdk/integrations/rust_tracing.py +284 -0
- sentry_sdk/integrations/sanic.py +248 -114
- sentry_sdk/integrations/serverless.py +13 -22
- sentry_sdk/integrations/socket.py +96 -0
- sentry_sdk/integrations/spark/spark_driver.py +115 -62
- sentry_sdk/integrations/spark/spark_worker.py +42 -50
- sentry_sdk/integrations/sqlalchemy.py +82 -37
- sentry_sdk/integrations/starlette.py +737 -0
- sentry_sdk/integrations/starlite.py +292 -0
- sentry_sdk/integrations/statsig.py +37 -0
- sentry_sdk/integrations/stdlib.py +100 -58
- sentry_sdk/integrations/strawberry.py +394 -0
- sentry_sdk/integrations/sys_exit.py +70 -0
- sentry_sdk/integrations/threading.py +142 -38
- sentry_sdk/integrations/tornado.py +68 -53
- sentry_sdk/integrations/trytond.py +15 -20
- sentry_sdk/integrations/typer.py +60 -0
- sentry_sdk/integrations/unleash.py +33 -0
- sentry_sdk/integrations/unraisablehook.py +53 -0
- sentry_sdk/integrations/wsgi.py +126 -125
- sentry_sdk/logger.py +96 -0
- sentry_sdk/metrics.py +81 -0
- sentry_sdk/monitor.py +120 -0
- sentry_sdk/profiler/__init__.py +49 -0
- sentry_sdk/profiler/continuous_profiler.py +730 -0
- sentry_sdk/profiler/transaction_profiler.py +839 -0
- sentry_sdk/profiler/utils.py +195 -0
- sentry_sdk/scope.py +1542 -112
- sentry_sdk/scrubber.py +177 -0
- sentry_sdk/serializer.py +152 -210
- sentry_sdk/session.py +177 -0
- sentry_sdk/sessions.py +202 -179
- sentry_sdk/spotlight.py +242 -0
- sentry_sdk/tracing.py +1202 -294
- sentry_sdk/tracing_utils.py +1236 -0
- sentry_sdk/transport.py +693 -189
- sentry_sdk/types.py +52 -0
- sentry_sdk/utils.py +1395 -228
- sentry_sdk/worker.py +30 -17
- sentry_sdk-2.46.0.dist-info/METADATA +268 -0
- sentry_sdk-2.46.0.dist-info/RECORD +189 -0
- {sentry_sdk-0.18.0.dist-info → sentry_sdk-2.46.0.dist-info}/WHEEL +1 -1
- sentry_sdk-2.46.0.dist-info/entry_points.txt +2 -0
- sentry_sdk-2.46.0.dist-info/licenses/LICENSE +21 -0
- sentry_sdk/_functools.py +0 -66
- sentry_sdk/integrations/celery.py +0 -275
- sentry_sdk/integrations/redis.py +0 -103
- sentry_sdk-0.18.0.dist-info/LICENSE +0 -9
- sentry_sdk-0.18.0.dist-info/METADATA +0 -66
- sentry_sdk-0.18.0.dist-info/RECORD +0 -65
- {sentry_sdk-0.18.0.dist-info → sentry_sdk-2.46.0.dist-info}/top_level.txt +0 -0
sentry_sdk/worker.py
CHANGED
|
@@ -2,13 +2,13 @@ import os
|
|
|
2
2
|
import threading
|
|
3
3
|
|
|
4
4
|
from time import sleep, time
|
|
5
|
-
from sentry_sdk.
|
|
6
|
-
from sentry_sdk._queue import Queue, Full
|
|
5
|
+
from sentry_sdk._queue import Queue, FullError
|
|
7
6
|
from sentry_sdk.utils import logger
|
|
7
|
+
from sentry_sdk.consts import DEFAULT_QUEUE_SIZE
|
|
8
8
|
|
|
9
|
-
from
|
|
9
|
+
from typing import TYPE_CHECKING
|
|
10
10
|
|
|
11
|
-
if
|
|
11
|
+
if TYPE_CHECKING:
|
|
12
12
|
from typing import Any
|
|
13
13
|
from typing import Optional
|
|
14
14
|
from typing import Callable
|
|
@@ -17,10 +17,9 @@ if MYPY:
|
|
|
17
17
|
_TERMINATOR = object()
|
|
18
18
|
|
|
19
19
|
|
|
20
|
-
class BackgroundWorker
|
|
21
|
-
def __init__(self, queue_size=
|
|
20
|
+
class BackgroundWorker:
|
|
21
|
+
def __init__(self, queue_size=DEFAULT_QUEUE_SIZE):
|
|
22
22
|
# type: (int) -> None
|
|
23
|
-
check_thread_support()
|
|
24
23
|
self._queue = Queue(queue_size) # type: Queue
|
|
25
24
|
self._lock = threading.Lock()
|
|
26
25
|
self._thread = None # type: Optional[threading.Thread]
|
|
@@ -63,11 +62,17 @@ class BackgroundWorker(object):
|
|
|
63
62
|
with self._lock:
|
|
64
63
|
if not self.is_alive:
|
|
65
64
|
self._thread = threading.Thread(
|
|
66
|
-
target=self._target, name="
|
|
65
|
+
target=self._target, name="sentry-sdk.BackgroundWorker"
|
|
67
66
|
)
|
|
68
|
-
self._thread.
|
|
69
|
-
|
|
70
|
-
|
|
67
|
+
self._thread.daemon = True
|
|
68
|
+
try:
|
|
69
|
+
self._thread.start()
|
|
70
|
+
self._thread_for_pid = os.getpid()
|
|
71
|
+
except RuntimeError:
|
|
72
|
+
# At this point we can no longer start because the interpreter
|
|
73
|
+
# is already shutting down. Sadly at this point we can no longer
|
|
74
|
+
# send out events.
|
|
75
|
+
self._thread = None
|
|
71
76
|
|
|
72
77
|
def kill(self):
|
|
73
78
|
# type: () -> None
|
|
@@ -80,7 +85,7 @@ class BackgroundWorker(object):
|
|
|
80
85
|
if self._thread:
|
|
81
86
|
try:
|
|
82
87
|
self._queue.put_nowait(_TERMINATOR)
|
|
83
|
-
except
|
|
88
|
+
except FullError:
|
|
84
89
|
logger.debug("background worker queue full, kill failed")
|
|
85
90
|
|
|
86
91
|
self._thread = None
|
|
@@ -94,23 +99,31 @@ class BackgroundWorker(object):
|
|
|
94
99
|
self._wait_flush(timeout, callback)
|
|
95
100
|
logger.debug("background worker flushed")
|
|
96
101
|
|
|
102
|
+
def full(self):
|
|
103
|
+
# type: () -> bool
|
|
104
|
+
return self._queue.full()
|
|
105
|
+
|
|
97
106
|
def _wait_flush(self, timeout, callback):
|
|
98
107
|
# type: (float, Optional[Any]) -> None
|
|
99
108
|
initial_timeout = min(0.1, timeout)
|
|
100
109
|
if not self._timed_queue_join(initial_timeout):
|
|
101
|
-
pending = self._queue.qsize()
|
|
110
|
+
pending = self._queue.qsize() + 1
|
|
102
111
|
logger.debug("%d event(s) pending on flush", pending)
|
|
103
112
|
if callback is not None:
|
|
104
113
|
callback(pending, timeout)
|
|
105
|
-
|
|
114
|
+
|
|
115
|
+
if not self._timed_queue_join(timeout - initial_timeout):
|
|
116
|
+
pending = self._queue.qsize() + 1
|
|
117
|
+
logger.error("flush timed out, dropped %s events", pending)
|
|
106
118
|
|
|
107
119
|
def submit(self, callback):
|
|
108
|
-
# type: (Callable[[], None]) ->
|
|
120
|
+
# type: (Callable[[], None]) -> bool
|
|
109
121
|
self._ensure_thread()
|
|
110
122
|
try:
|
|
111
123
|
self._queue.put_nowait(callback)
|
|
112
|
-
|
|
113
|
-
|
|
124
|
+
return True
|
|
125
|
+
except FullError:
|
|
126
|
+
return False
|
|
114
127
|
|
|
115
128
|
def _target(self):
|
|
116
129
|
# type: () -> None
|
|
@@ -0,0 +1,268 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: sentry-sdk
|
|
3
|
+
Version: 2.46.0
|
|
4
|
+
Summary: Python client for Sentry (https://sentry.io)
|
|
5
|
+
Home-page: https://github.com/getsentry/sentry-python
|
|
6
|
+
Author: Sentry Team and Contributors
|
|
7
|
+
Author-email: hello@sentry.io
|
|
8
|
+
License: MIT
|
|
9
|
+
Project-URL: Documentation, https://docs.sentry.io/platforms/python/
|
|
10
|
+
Project-URL: Changelog, https://github.com/getsentry/sentry-python/blob/master/CHANGELOG.md
|
|
11
|
+
Classifier: Development Status :: 5 - Production/Stable
|
|
12
|
+
Classifier: Environment :: Web Environment
|
|
13
|
+
Classifier: Intended Audience :: Developers
|
|
14
|
+
Classifier: License :: OSI Approved :: BSD License
|
|
15
|
+
Classifier: Operating System :: OS Independent
|
|
16
|
+
Classifier: Programming Language :: Python
|
|
17
|
+
Classifier: Programming Language :: Python :: 3
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.6
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.7
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
22
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
23
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
24
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
25
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
26
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
27
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
28
|
+
Requires-Python: >=3.6
|
|
29
|
+
Description-Content-Type: text/markdown
|
|
30
|
+
License-File: LICENSE
|
|
31
|
+
Requires-Dist: urllib3>=1.26.11
|
|
32
|
+
Requires-Dist: certifi
|
|
33
|
+
Provides-Extra: aiohttp
|
|
34
|
+
Requires-Dist: aiohttp>=3.5; extra == "aiohttp"
|
|
35
|
+
Provides-Extra: anthropic
|
|
36
|
+
Requires-Dist: anthropic>=0.16; extra == "anthropic"
|
|
37
|
+
Provides-Extra: arq
|
|
38
|
+
Requires-Dist: arq>=0.23; extra == "arq"
|
|
39
|
+
Provides-Extra: asyncpg
|
|
40
|
+
Requires-Dist: asyncpg>=0.23; extra == "asyncpg"
|
|
41
|
+
Provides-Extra: beam
|
|
42
|
+
Requires-Dist: apache-beam>=2.12; extra == "beam"
|
|
43
|
+
Provides-Extra: bottle
|
|
44
|
+
Requires-Dist: bottle>=0.12.13; extra == "bottle"
|
|
45
|
+
Provides-Extra: celery
|
|
46
|
+
Requires-Dist: celery>=3; extra == "celery"
|
|
47
|
+
Provides-Extra: celery-redbeat
|
|
48
|
+
Requires-Dist: celery-redbeat>=2; extra == "celery-redbeat"
|
|
49
|
+
Provides-Extra: chalice
|
|
50
|
+
Requires-Dist: chalice>=1.16.0; extra == "chalice"
|
|
51
|
+
Provides-Extra: clickhouse-driver
|
|
52
|
+
Requires-Dist: clickhouse-driver>=0.2.0; extra == "clickhouse-driver"
|
|
53
|
+
Provides-Extra: django
|
|
54
|
+
Requires-Dist: django>=1.8; extra == "django"
|
|
55
|
+
Provides-Extra: falcon
|
|
56
|
+
Requires-Dist: falcon>=1.4; extra == "falcon"
|
|
57
|
+
Provides-Extra: fastapi
|
|
58
|
+
Requires-Dist: fastapi>=0.79.0; extra == "fastapi"
|
|
59
|
+
Provides-Extra: flask
|
|
60
|
+
Requires-Dist: flask>=0.11; extra == "flask"
|
|
61
|
+
Requires-Dist: blinker>=1.1; extra == "flask"
|
|
62
|
+
Requires-Dist: markupsafe; extra == "flask"
|
|
63
|
+
Provides-Extra: grpcio
|
|
64
|
+
Requires-Dist: grpcio>=1.21.1; extra == "grpcio"
|
|
65
|
+
Requires-Dist: protobuf>=3.8.0; extra == "grpcio"
|
|
66
|
+
Provides-Extra: http2
|
|
67
|
+
Requires-Dist: httpcore[http2]==1.*; extra == "http2"
|
|
68
|
+
Provides-Extra: httpx
|
|
69
|
+
Requires-Dist: httpx>=0.16.0; extra == "httpx"
|
|
70
|
+
Provides-Extra: huey
|
|
71
|
+
Requires-Dist: huey>=2; extra == "huey"
|
|
72
|
+
Provides-Extra: huggingface-hub
|
|
73
|
+
Requires-Dist: huggingface_hub>=0.22; extra == "huggingface-hub"
|
|
74
|
+
Provides-Extra: langchain
|
|
75
|
+
Requires-Dist: langchain>=0.0.210; extra == "langchain"
|
|
76
|
+
Provides-Extra: langgraph
|
|
77
|
+
Requires-Dist: langgraph>=0.6.6; extra == "langgraph"
|
|
78
|
+
Provides-Extra: launchdarkly
|
|
79
|
+
Requires-Dist: launchdarkly-server-sdk>=9.8.0; extra == "launchdarkly"
|
|
80
|
+
Provides-Extra: litellm
|
|
81
|
+
Requires-Dist: litellm>=1.77.5; extra == "litellm"
|
|
82
|
+
Provides-Extra: litestar
|
|
83
|
+
Requires-Dist: litestar>=2.0.0; extra == "litestar"
|
|
84
|
+
Provides-Extra: loguru
|
|
85
|
+
Requires-Dist: loguru>=0.5; extra == "loguru"
|
|
86
|
+
Provides-Extra: mcp
|
|
87
|
+
Requires-Dist: mcp>=1.15.0; extra == "mcp"
|
|
88
|
+
Provides-Extra: openai
|
|
89
|
+
Requires-Dist: openai>=1.0.0; extra == "openai"
|
|
90
|
+
Requires-Dist: tiktoken>=0.3.0; extra == "openai"
|
|
91
|
+
Provides-Extra: openfeature
|
|
92
|
+
Requires-Dist: openfeature-sdk>=0.7.1; extra == "openfeature"
|
|
93
|
+
Provides-Extra: opentelemetry
|
|
94
|
+
Requires-Dist: opentelemetry-distro>=0.35b0; extra == "opentelemetry"
|
|
95
|
+
Provides-Extra: opentelemetry-experimental
|
|
96
|
+
Requires-Dist: opentelemetry-distro; extra == "opentelemetry-experimental"
|
|
97
|
+
Provides-Extra: opentelemetry-otlp
|
|
98
|
+
Requires-Dist: opentelemetry-distro[otlp]>=0.35b0; extra == "opentelemetry-otlp"
|
|
99
|
+
Provides-Extra: pure-eval
|
|
100
|
+
Requires-Dist: pure_eval; extra == "pure-eval"
|
|
101
|
+
Requires-Dist: executing; extra == "pure-eval"
|
|
102
|
+
Requires-Dist: asttokens; extra == "pure-eval"
|
|
103
|
+
Provides-Extra: pydantic-ai
|
|
104
|
+
Requires-Dist: pydantic-ai>=1.0.0; extra == "pydantic-ai"
|
|
105
|
+
Provides-Extra: pymongo
|
|
106
|
+
Requires-Dist: pymongo>=3.1; extra == "pymongo"
|
|
107
|
+
Provides-Extra: pyspark
|
|
108
|
+
Requires-Dist: pyspark>=2.4.4; extra == "pyspark"
|
|
109
|
+
Provides-Extra: quart
|
|
110
|
+
Requires-Dist: quart>=0.16.1; extra == "quart"
|
|
111
|
+
Requires-Dist: blinker>=1.1; extra == "quart"
|
|
112
|
+
Provides-Extra: rq
|
|
113
|
+
Requires-Dist: rq>=0.6; extra == "rq"
|
|
114
|
+
Provides-Extra: sanic
|
|
115
|
+
Requires-Dist: sanic>=0.8; extra == "sanic"
|
|
116
|
+
Provides-Extra: sqlalchemy
|
|
117
|
+
Requires-Dist: sqlalchemy>=1.2; extra == "sqlalchemy"
|
|
118
|
+
Provides-Extra: starlette
|
|
119
|
+
Requires-Dist: starlette>=0.19.1; extra == "starlette"
|
|
120
|
+
Provides-Extra: starlite
|
|
121
|
+
Requires-Dist: starlite>=1.48; extra == "starlite"
|
|
122
|
+
Provides-Extra: statsig
|
|
123
|
+
Requires-Dist: statsig>=0.55.3; extra == "statsig"
|
|
124
|
+
Provides-Extra: tornado
|
|
125
|
+
Requires-Dist: tornado>=6; extra == "tornado"
|
|
126
|
+
Provides-Extra: unleash
|
|
127
|
+
Requires-Dist: UnleashClient>=6.0.1; extra == "unleash"
|
|
128
|
+
Provides-Extra: google-genai
|
|
129
|
+
Requires-Dist: google-genai>=1.29.0; extra == "google-genai"
|
|
130
|
+
Dynamic: author
|
|
131
|
+
Dynamic: author-email
|
|
132
|
+
Dynamic: classifier
|
|
133
|
+
Dynamic: description
|
|
134
|
+
Dynamic: description-content-type
|
|
135
|
+
Dynamic: home-page
|
|
136
|
+
Dynamic: license
|
|
137
|
+
Dynamic: license-file
|
|
138
|
+
Dynamic: project-url
|
|
139
|
+
Dynamic: provides-extra
|
|
140
|
+
Dynamic: requires-dist
|
|
141
|
+
Dynamic: requires-python
|
|
142
|
+
Dynamic: summary
|
|
143
|
+
|
|
144
|
+
<a href="https://sentry.io/?utm_source=github&utm_medium=logo" target="_blank">
|
|
145
|
+
<img src="https://sentry-brand.storage.googleapis.com/github-banners/github-sdk-python.png" alt="Sentry for Python">
|
|
146
|
+
</a>
|
|
147
|
+
<div align="center">
|
|
148
|
+
|
|
149
|
+
_Bad software is everywhere, and we're tired of it. Sentry is on a mission to help developers write better software faster, so we can get back to enjoying technology. If you want to join us
|
|
150
|
+
[<kbd>**Check out our open positions**</kbd>](https://sentry.io/careers/)_.
|
|
151
|
+
|
|
152
|
+
[](https://discord.com/invite/Ww9hbqr)
|
|
153
|
+
[](https://x.com/intent/follow?screen_name=sentry)
|
|
154
|
+
[](https://pypi.python.org/pypi/sentry-sdk)
|
|
155
|
+
<img src="https://img.shields.io/badge/python-3.7 | 3.8 | 3.9 | 3.10 | 3.11 | 3.12 | 3.13-blue.svg" alt="python">
|
|
156
|
+
[](https://github.com/getsentry/sentry-python/actions/workflows/ci.yml)
|
|
157
|
+
|
|
158
|
+
<br/>
|
|
159
|
+
|
|
160
|
+
</div>
|
|
161
|
+
|
|
162
|
+
|
|
163
|
+
# Official Sentry SDK for Python
|
|
164
|
+
|
|
165
|
+
Welcome to the official Python SDK for **[Sentry](http://sentry.io/)**.
|
|
166
|
+
|
|
167
|
+
|
|
168
|
+
## 📦 Getting Started
|
|
169
|
+
|
|
170
|
+
### Prerequisites
|
|
171
|
+
|
|
172
|
+
You need a Sentry [account](https://sentry.io/signup/) and [project](https://docs.sentry.io/product/projects/).
|
|
173
|
+
|
|
174
|
+
### Installation
|
|
175
|
+
|
|
176
|
+
Getting Sentry into your project is straightforward. Just run this command in your terminal:
|
|
177
|
+
|
|
178
|
+
```bash
|
|
179
|
+
pip install --upgrade sentry-sdk
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
### Basic Configuration
|
|
183
|
+
|
|
184
|
+
Here's a quick configuration example to get Sentry up and running:
|
|
185
|
+
|
|
186
|
+
```python
|
|
187
|
+
import sentry_sdk
|
|
188
|
+
|
|
189
|
+
sentry_sdk.init(
|
|
190
|
+
"https://12927b5f211046b575ee51fd8b1ac34f@o1.ingest.sentry.io/1", # Your DSN here
|
|
191
|
+
|
|
192
|
+
# Set traces_sample_rate to 1.0 to capture 100%
|
|
193
|
+
# of traces for performance monitoring.
|
|
194
|
+
traces_sample_rate=1.0,
|
|
195
|
+
)
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
With this configuration, Sentry will monitor for exceptions and performance issues.
|
|
199
|
+
|
|
200
|
+
### Quick Usage Example
|
|
201
|
+
|
|
202
|
+
To generate some events that will show up in Sentry, you can log messages or capture errors:
|
|
203
|
+
|
|
204
|
+
```python
|
|
205
|
+
import sentry_sdk
|
|
206
|
+
sentry_sdk.init(...) # same as above
|
|
207
|
+
|
|
208
|
+
sentry_sdk.capture_message("Hello Sentry!") # You'll see this in your Sentry dashboard.
|
|
209
|
+
|
|
210
|
+
raise ValueError("Oops, something went wrong!") # This will create an error event in Sentry.
|
|
211
|
+
```
|
|
212
|
+
|
|
213
|
+
|
|
214
|
+
## 📚 Documentation
|
|
215
|
+
|
|
216
|
+
For more details on advanced usage, integrations, and customization, check out the full documentation on [https://docs.sentry.io](https://docs.sentry.io/).
|
|
217
|
+
|
|
218
|
+
|
|
219
|
+
## 🧩 Integrations
|
|
220
|
+
|
|
221
|
+
Sentry integrates with a ton of popular Python libraries and frameworks, including [FastAPI](https://docs.sentry.io/platforms/python/integrations/fastapi/), [Django](https://docs.sentry.io/platforms/python/integrations/django/), [Celery](https://docs.sentry.io/platforms/python/integrations/celery/), [OpenAI](https://docs.sentry.io/platforms/python/integrations/openai/) and many, many more. Check out the [full list of integrations](https://docs.sentry.io/platforms/python/integrations/) to get the full picture.
|
|
222
|
+
|
|
223
|
+
|
|
224
|
+
## 🚧 Migrating Between Versions?
|
|
225
|
+
|
|
226
|
+
### From `1.x` to `2.x`
|
|
227
|
+
|
|
228
|
+
If you're using the older `1.x` version of the SDK, now's the time to upgrade to `2.x`. It includes significant upgrades and new features. Check our [migration guide](https://docs.sentry.io/platforms/python/migration/1.x-to-2.x) for assistance.
|
|
229
|
+
|
|
230
|
+
### From `raven-python`
|
|
231
|
+
|
|
232
|
+
Using the legacy `raven-python` client? It's now in maintenance mode, and we recommend migrating to the new SDK for an improved experience. Get all the details in our [migration guide](https://docs.sentry.io/platforms/python/migration/raven-to-sentry-sdk/).
|
|
233
|
+
|
|
234
|
+
|
|
235
|
+
## 🙌 Want to Contribute?
|
|
236
|
+
|
|
237
|
+
We'd love your help in improving the Sentry SDK! Whether it's fixing bugs, adding features, writing new integrations, or enhancing documentation, every contribution is valuable.
|
|
238
|
+
|
|
239
|
+
For details on how to contribute, please read our [contribution guide](CONTRIBUTING.md) and explore the [open issues](https://github.com/getsentry/sentry-python/issues).
|
|
240
|
+
|
|
241
|
+
|
|
242
|
+
## 🛟 Need Help?
|
|
243
|
+
|
|
244
|
+
If you encounter issues or need help setting up or configuring the SDK, don't hesitate to reach out to the [Sentry Community on Discord](https://discord.com/invite/Ww9hbqr). There is a ton of great people there ready to help!
|
|
245
|
+
|
|
246
|
+
|
|
247
|
+
## 🔗 Resources
|
|
248
|
+
|
|
249
|
+
Here are all resources to help you make the most of Sentry:
|
|
250
|
+
|
|
251
|
+
- [Documentation](https://docs.sentry.io/platforms/python/) - Official documentation to get started.
|
|
252
|
+
- [Discord](https://discord.com/invite/Ww9hbqr) - Join our Discord community.
|
|
253
|
+
- [X/Twitter](https://x.com/intent/follow?screen_name=sentry) - Follow us on X (Twitter) for updates.
|
|
254
|
+
- [Stack Overflow](https://stackoverflow.com/questions/tagged/sentry) - Questions and answers related to Sentry.
|
|
255
|
+
|
|
256
|
+
<a name="license"></a>
|
|
257
|
+
## 📃 License
|
|
258
|
+
|
|
259
|
+
The SDK is open-source and available under the MIT license. Check out the [LICENSE](LICENSE) file for more information.
|
|
260
|
+
|
|
261
|
+
|
|
262
|
+
## 😘 Contributors
|
|
263
|
+
|
|
264
|
+
Thanks to everyone who has helped improve the SDK!
|
|
265
|
+
|
|
266
|
+
<a href="https://github.com/getsentry/sentry-python/graphs/contributors">
|
|
267
|
+
<img src="https://contributors-img.web.app/image?repo=getsentry/sentry-python" />
|
|
268
|
+
</a>
|
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
sentry_sdk/__init__.py,sha256=cnZoQ9y329brs-cdzIVtxbO1-o9AIrKk8VTVyZNJs1A,1410
|
|
2
|
+
sentry_sdk/_compat.py,sha256=Pxcg6cUYPiOoXIFfLI_H3ATb7SfrcXOeZdzpeWv3umI,3116
|
|
3
|
+
sentry_sdk/_init_implementation.py,sha256=WL54d8nggjRunBm3XlG-sWSx4yS5lpYYggd7YBWpuVk,2559
|
|
4
|
+
sentry_sdk/_log_batcher.py,sha256=p0CK0Ao3VO2yPAVfenotM41X4lF40CvUGl9aUaj4ubo,5500
|
|
5
|
+
sentry_sdk/_lru_cache.py,sha256=phZMBm9EKU1m67OOApnKCffnlWAlVz9bYjig7CglQuk,1229
|
|
6
|
+
sentry_sdk/_metrics_batcher.py,sha256=dcnwkBIMOJGdvo59NGywRzGmHQMSaCzH_t03YzmWlHQ,5042
|
|
7
|
+
sentry_sdk/_queue.py,sha256=UUzbmliDYmdVYiDA32NMYkX369ElWMFNSj5kodqVQZE,11250
|
|
8
|
+
sentry_sdk/_types.py,sha256=ld5Y0yMsLxd6P6tPifw3IqUg8bpFE0hgxPDUmn6B9Xg,10422
|
|
9
|
+
sentry_sdk/_werkzeug.py,sha256=m3GPf-jHd8v3eVOfBHaKw5f0uHoLkXrSO1EcY-8EisY,3734
|
|
10
|
+
sentry_sdk/api.py,sha256=OkwQ2tA5YASJ77wLOteUdv_woPF4wL_JTOAMxe9z8k4,15282
|
|
11
|
+
sentry_sdk/attachments.py,sha256=0Dylhm065O6hNFjB40fWCd5Hg4qWSXndmi1TPWglZkI,3109
|
|
12
|
+
sentry_sdk/client.py,sha256=jWLzqpWroCPfGUYAAy2RFUVd4wJc7hqyOiIKCw4f5lY,42099
|
|
13
|
+
sentry_sdk/consts.py,sha256=3kKt5xra-FIxJ2fPfQwAk5s7jyi3_QUK88SlrxnN9Hs,53733
|
|
14
|
+
sentry_sdk/debug.py,sha256=ddBehQlAuQC1sg1XO-N4N3diZ0x0iT5RWJwFdrtcsjw,1019
|
|
15
|
+
sentry_sdk/envelope.py,sha256=1nqp_DMw66MYtrszRiiCuodyi3JKcOiQodEMkD6uZ_c,10473
|
|
16
|
+
sentry_sdk/feature_flags.py,sha256=savtmWAHjAvgw2m_KWW8mUagjLhAXCm3jjscmBlfIJ4,2232
|
|
17
|
+
sentry_sdk/hub.py,sha256=jg7UqYiJFJ1dknVCNT4_E5lIBfrCFQdWwnJrhgScVNg,25748
|
|
18
|
+
sentry_sdk/logger.py,sha256=NslsNdFyMgZpH4K7QD1bXjgW3AmSecIPtFF-gbe_Pj8,2797
|
|
19
|
+
sentry_sdk/metrics.py,sha256=ov1aCqPvcmnDba43HHjWT2flqNPfA5Fa0O0iopcnZpI,2044
|
|
20
|
+
sentry_sdk/monitor.py,sha256=52CG1m2e8okFDVoTpbqfm9zeeaLa0ciC_r9x2RiXuDg,3639
|
|
21
|
+
sentry_sdk/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
22
|
+
sentry_sdk/scope.py,sha256=4lMsiJq_TSwpeY4ZxpHq2SZK1TcDIhsoCD_pROp9axo,65420
|
|
23
|
+
sentry_sdk/scrubber.py,sha256=rENmQ35buugDl269bRZuIAtgr27B9SzisJYUF-691pc,6064
|
|
24
|
+
sentry_sdk/serializer.py,sha256=0-WdtKYwmGEM7nVxmOeRAXjC0DVdIHCymQpRuIHDBX0,13534
|
|
25
|
+
sentry_sdk/session.py,sha256=BXWHf5Opg9yx7jKe-_iHxF6LDJw9Jnu7NfHxo3UQRpw,5589
|
|
26
|
+
sentry_sdk/sessions.py,sha256=e7Jv8McW3QZp3H1GuI_CA_ezq_G0ZWY6nK0ZLqJRdNI,9172
|
|
27
|
+
sentry_sdk/spotlight.py,sha256=93kdd8KxdLfcPaxFnFuqHgYAAL4FCfpK1hiiPoD7Ac4,8678
|
|
28
|
+
sentry_sdk/tracing.py,sha256=lJG5TmA7mz7-RfJEr34ydgBf-lebRegejHkhdNsHH08,51747
|
|
29
|
+
sentry_sdk/tracing_utils.py,sha256=1jwVbHzL4aTT5BzkSdmWtfoL9feYaxszdj2AZKCG37I,40540
|
|
30
|
+
sentry_sdk/transport.py,sha256=NzlBS5liRSh0Fm7Zi7sPdZG82uECw9myECs_JrClqkg,31878
|
|
31
|
+
sentry_sdk/types.py,sha256=A92AqvfrGQZ9KY6FaUjKfL9F1HK7Ui3heQilVzfzYCs,1269
|
|
32
|
+
sentry_sdk/utils.py,sha256=iXZnPvx3Up6OeLdowdnQTGNTjmNTii4qKVjyRIkXPh8,63900
|
|
33
|
+
sentry_sdk/worker.py,sha256=VSMaigRMbInVyupSFpBC42bft2oIViea-0C_d9ThnIo,4464
|
|
34
|
+
sentry_sdk/ai/__init__.py,sha256=I7GRMQEYTV0bXzEIE0iAJjAn6Te-dPM5uGyJ9KS-6hI,193
|
|
35
|
+
sentry_sdk/ai/monitoring.py,sha256=bS_KneWCAL9ehml5XiyficoPVx4DUUG6acbH3cjP3I8,5057
|
|
36
|
+
sentry_sdk/ai/utils.py,sha256=heWnJdwB-aKtxTfqqggtrHEGZQkPNxcCy6oA_U0oqmQ,4925
|
|
37
|
+
sentry_sdk/crons/__init__.py,sha256=3Zt6g1-pZZ12uRKKsC8QLm3XgJ4K1VYxgVpNNUygOZY,221
|
|
38
|
+
sentry_sdk/crons/api.py,sha256=mk-UB8Im2LU2rJFdE-TV302EaKnf8kAjwEL0bIV0Hzc,1767
|
|
39
|
+
sentry_sdk/crons/consts.py,sha256=dXqJk5meBSu5rjlGpqAOlkpACnuUi7svQnAFoy1ZNUU,87
|
|
40
|
+
sentry_sdk/crons/decorator.py,sha256=UrjeIqBCbvsuKrfjGkKJbbLBvjw2TQvDWcTO7WwAmrI,3913
|
|
41
|
+
sentry_sdk/integrations/__init__.py,sha256=re-xBSsOfOFx8Eh6mMFvup7h2HGbm3esjyS-AzjHCoI,12735
|
|
42
|
+
sentry_sdk/integrations/_asgi_common.py,sha256=Ypg7IctB3iPPY60ebVlzChzgT8GeGpZ0YH8VvJNDlEY,3187
|
|
43
|
+
sentry_sdk/integrations/_wsgi_common.py,sha256=A1-X7l1pZCcrbUhRHkmdKiK_EemEZjn7xToJIvlEuFM,7558
|
|
44
|
+
sentry_sdk/integrations/aiohttp.py,sha256=FynazdaPWCanC91KKVba8yl0UwWnVJcJxWNPzSu64x0,13007
|
|
45
|
+
sentry_sdk/integrations/anthropic.py,sha256=VNdvg9mZJkBcNGyvlDz1cRGEiGmEsxAFnjD9wXf8amA,14512
|
|
46
|
+
sentry_sdk/integrations/argv.py,sha256=GIY7TBFETF8Z0fDzqTXEJldt5XXCDdFNZxpGxP7EPaU,911
|
|
47
|
+
sentry_sdk/integrations/ariadne.py,sha256=C-zKlOrU7jvTWmQHZx0M0tAZNkPPo7Z5-5jXDD92LiU,5834
|
|
48
|
+
sentry_sdk/integrations/arq.py,sha256=yDPdWJa3ZgnGLwFzavIylIafEVN0qqSSgL4kUHxQF70,7881
|
|
49
|
+
sentry_sdk/integrations/asgi.py,sha256=b3zE8Om_yP7SDxcD8MMCdDthYhLLgOB3LC3ZZCf94hw,12800
|
|
50
|
+
sentry_sdk/integrations/asyncio.py,sha256=RGthzQkgw4ZsILzwjwojs_o4zBHNPnZsooibfAEWqkQ,4610
|
|
51
|
+
sentry_sdk/integrations/asyncpg.py,sha256=fbBTi5bEERK3c9o43LBLtS5wPaSVq_qIl3Y50NPmr5Y,6521
|
|
52
|
+
sentry_sdk/integrations/atexit.py,sha256=sY46N2hEvtGuT1DBQhirUXHbjgXjXAm7R_sgiectVKw,1652
|
|
53
|
+
sentry_sdk/integrations/aws_lambda.py,sha256=uEue-fu2ZTaXYFJdS9vVQp34Wld5U_KOBg7rbkwvyDo,18071
|
|
54
|
+
sentry_sdk/integrations/beam.py,sha256=qt35UmkA0ng4VNzmwqH9oz7SESU-is9IjFbTJ21ad4U,5182
|
|
55
|
+
sentry_sdk/integrations/boto3.py,sha256=1ItKUX7EL9MHXS1H8VSn6IfZSFLeqaUqeWg-OKBm_Ik,4411
|
|
56
|
+
sentry_sdk/integrations/bottle.py,sha256=aC5OsitlsRUEWBlpkNjxvH0m6UEG3OfAJ9jFyPCbzqQ,6615
|
|
57
|
+
sentry_sdk/integrations/chalice.py,sha256=A4K_9FmNUu131El0ctkTmjtyYd184I4hQTlidZcEC54,4699
|
|
58
|
+
sentry_sdk/integrations/clickhouse_driver.py,sha256=2qpRznwSNuRSzrCA1R5bmpgiehDmzbG7yZe6hN-61Wg,6098
|
|
59
|
+
sentry_sdk/integrations/cloud_resource_context.py,sha256=_gFldMeVHs5pxP5sm8uP7ZKmm6s_5hw3UsnXek9Iw8A,7780
|
|
60
|
+
sentry_sdk/integrations/cohere.py,sha256=VI5mLukp_CQDt-OFVNgtVqpbY-j-d5UOfD7iPBKu0FU,9401
|
|
61
|
+
sentry_sdk/integrations/dedupe.py,sha256=FMdGQOlL86r4AjiSf4MfzyfEIjkI5b_v3Ko2gOZKkBE,1975
|
|
62
|
+
sentry_sdk/integrations/dramatiq.py,sha256=P0j732DU4pkUQi_CRtY4DxvhcalXN8jQVX6gdHl6yPw,7455
|
|
63
|
+
sentry_sdk/integrations/excepthook.py,sha256=tfwpSQuo1b_OmJbNKPPRh90EUjD_OSE4DqqgYY9PVQI,2408
|
|
64
|
+
sentry_sdk/integrations/executing.py,sha256=5lxBAxO5FypY-zTV03AHncGmolmaHd327-3Vrjzskcc,1994
|
|
65
|
+
sentry_sdk/integrations/falcon.py,sha256=uhjqFPKa8bWRQr0za4pVXGYaPr-LRdICw2rUO-laKCo,9501
|
|
66
|
+
sentry_sdk/integrations/fastapi.py,sha256=kicdigHM3MG-GlpLUN6wwH8jOVu4dTuoQD6RBFrlXgo,4589
|
|
67
|
+
sentry_sdk/integrations/flask.py,sha256=t7q73JoJT46RWDtrNImtIloGyDg7CnsNFKpS4gOuBIw,8740
|
|
68
|
+
sentry_sdk/integrations/gcp.py,sha256=LAjalaMug1VRNcKsr2nvox6x67uvKsTGF2cyq2-auDg,8462
|
|
69
|
+
sentry_sdk/integrations/gnu_backtrace.py,sha256=FL7WkRfHT6idYCSLIrtFQ2G5ZTGoYudCKvBcjR5hqsI,2812
|
|
70
|
+
sentry_sdk/integrations/gql.py,sha256=lN5LJNZwUHs_1BQcIrR0adIkgb9YiOh6UtoUG8vCO_Y,4801
|
|
71
|
+
sentry_sdk/integrations/graphene.py,sha256=I6ZJ8Apd9dO9XPVvZY7I46-v1eXOW1C1rAkWwasF3gU,5042
|
|
72
|
+
sentry_sdk/integrations/httpx.py,sha256=HK0Nbxc4TAFesTz6gegz6tAHcIXKlOckFWrBHMBB0VM,6086
|
|
73
|
+
sentry_sdk/integrations/huey.py,sha256=wlyxjeWqqJp1X5S3neD5FiZjXcyznm1dl8_u1wIo76U,5443
|
|
74
|
+
sentry_sdk/integrations/huggingface_hub.py,sha256=B5z0--bC2tEDtWl5V7xAqM4234yhY_RYbnkZGgqC8PA,14952
|
|
75
|
+
sentry_sdk/integrations/langchain.py,sha256=DSCJ7krulpTEMJVRDAPesMkD1GLgDRCfzRV3oQ7AGEY,39957
|
|
76
|
+
sentry_sdk/integrations/langgraph.py,sha256=YQK8-d124XDoDrE1eTN4q3Sbr8v9P4tzyqk06F1-2IE,11835
|
|
77
|
+
sentry_sdk/integrations/launchdarkly.py,sha256=L5yE9NBRon8JPYzO6XT-dA4YkvNcrUfK4nD5fycSXM0,1934
|
|
78
|
+
sentry_sdk/integrations/litellm.py,sha256=OhQ00oNOifv-f6CcmerHwWacgFBbrzeMUiub8kA1FNI,10228
|
|
79
|
+
sentry_sdk/integrations/litestar.py,sha256=0BkfynHkxERshbxycwHDnpjzGx31c5ipYvBYqprAoHY,11830
|
|
80
|
+
sentry_sdk/integrations/logging.py,sha256=zfag3g8yJ82ji_wn8oYL7uDqscchaE6Aczc-7cd12zg,13892
|
|
81
|
+
sentry_sdk/integrations/loguru.py,sha256=bCmrAguKuJ2jqAbT5g2LUrComFpiP23CAXg7OPSrFp4,6534
|
|
82
|
+
sentry_sdk/integrations/mcp.py,sha256=Ac2tlAeoxUwu81ezFPaMxP9InBEery0CNjo5PRP9iXE,20052
|
|
83
|
+
sentry_sdk/integrations/modules.py,sha256=vzLx3Erg77Vl4mnUvAgTg_3teAuWy7zylFpAidBI9I0,820
|
|
84
|
+
sentry_sdk/integrations/openai.py,sha256=dWlV4su1KTLJWV_at01QoIL7RJQjrbm7HcHvF7GG24A,25131
|
|
85
|
+
sentry_sdk/integrations/openfeature.py,sha256=-vvdrN4fK0Xhu2ip41bkPIPEqdzv8xzmLu9wRlI2xPA,1131
|
|
86
|
+
sentry_sdk/integrations/otlp.py,sha256=jvrlH8Xwi1AF6JQO4JO2LU6NkLKXvGztmWdHIqbEpe4,3129
|
|
87
|
+
sentry_sdk/integrations/pure_eval.py,sha256=R2UuFCtQ_ShTIZJKPn9RUD06lbc6mug4Mv8S1_mo1j0,4605
|
|
88
|
+
sentry_sdk/integrations/pymongo.py,sha256=cPpMGEbXHlV6HTHgmIDL1F-x3w7ZMROXVb4eUhLs3bw,6380
|
|
89
|
+
sentry_sdk/integrations/pyramid.py,sha256=IDonzoZvLrH18JL-i_Qpbztc4T3iZNQhWFFv6SAXac8,7364
|
|
90
|
+
sentry_sdk/integrations/quart.py,sha256=7h4BuGNWzZabVIIOKm194gMKDlIvS-dmWFW4iZXsmF4,7413
|
|
91
|
+
sentry_sdk/integrations/ray.py,sha256=gzyjDqc9THINu0R5FCYa-f8YPA5cS6XE0JFR-G5RwpQ,5323
|
|
92
|
+
sentry_sdk/integrations/rq.py,sha256=2Cidur0yL_JtdpOtBup6D6aYyN4T9mgshebEc-kvp-E,5307
|
|
93
|
+
sentry_sdk/integrations/rust_tracing.py,sha256=fQ0eG09w3IPZe8ecgeUoQTPoGFThkkarUyGC8KJj35o,9078
|
|
94
|
+
sentry_sdk/integrations/sanic.py,sha256=Z7orxkX9YhU9YSX4Oidsi3n46J0qlVG7Ajog-fnUreo,12960
|
|
95
|
+
sentry_sdk/integrations/serverless.py,sha256=npiKJuIy_sEkWT_x0Eu2xSEMiMh_aySqGYlnvIROsYk,1804
|
|
96
|
+
sentry_sdk/integrations/socket.py,sha256=hlJDYlspzOy3UNjsd7qXPUoqJl5s1ShF3iijTRWpVaU,3169
|
|
97
|
+
sentry_sdk/integrations/sqlalchemy.py,sha256=rzOK3yFLrRE3V7q-wVcAUhq5iSTrqGPW5ytbGU9lXkk,4344
|
|
98
|
+
sentry_sdk/integrations/starlette.py,sha256=cLmbx_KgdZZFLE4prx6PV5S4XOdnlbdV5c1iwZXxDVQ,26238
|
|
99
|
+
sentry_sdk/integrations/starlite.py,sha256=hSiVB6KZr8pxsQVRSGGP-9UQBLsBl-3DmrK_5CPebB8,10559
|
|
100
|
+
sentry_sdk/integrations/statsig.py,sha256=-e57hxHfHo1S13YQKObV65q_UvREyxbR56fnf7bkC9o,1227
|
|
101
|
+
sentry_sdk/integrations/stdlib.py,sha256=4EeLQeU3yjPyjPORX6K0B5N8D5ZXT3eDAFIwjDckUj8,8968
|
|
102
|
+
sentry_sdk/integrations/strawberry.py,sha256=6eOvI9rxl_w84BWxHmveExfB3HIberCiVKV8o06ugv4,14155
|
|
103
|
+
sentry_sdk/integrations/sys_exit.py,sha256=AwShgGBWPdiY25aOWDLRAs2RBUKm5T3CrL-Q-zAk0l4,2493
|
|
104
|
+
sentry_sdk/integrations/threading.py,sha256=0lNxcMLN7Z5DwLg9d1Of7lgGcMOggsM76bU35hIOGXA,7109
|
|
105
|
+
sentry_sdk/integrations/tornado.py,sha256=Qcft8FZxdVICnaa1AhsDB262sInEQZPf-pvgI-Agjmc,7206
|
|
106
|
+
sentry_sdk/integrations/trytond.py,sha256=BaLCNqQeRWDbHHDEelS5tmj-p_CrbmtGEHIn6JfzEFE,1651
|
|
107
|
+
sentry_sdk/integrations/typer.py,sha256=FQrFgpR9t6yQWF-oWCI9KJLFioEnA2c_1BEtYV-mPAs,1815
|
|
108
|
+
sentry_sdk/integrations/unleash.py,sha256=6JshqyuAY_kbu9Nr20tMOhtgx-ryqPHCrq_EQIzeqm4,1058
|
|
109
|
+
sentry_sdk/integrations/unraisablehook.py,sha256=8IW8Ia9t2hKgPLh8WS8WkmeAsyjJ6Al4qi8sM6vGrpU,1753
|
|
110
|
+
sentry_sdk/integrations/wsgi.py,sha256=M3lExlLqQ_J-vEZPmv5HI7vRf8T7DvPicbNZiypUvmE,10809
|
|
111
|
+
sentry_sdk/integrations/celery/__init__.py,sha256=FNmrLL0Cs95kv6yUCpJGu9X8Cpw20mMYGmnkBC4IL4Y,18699
|
|
112
|
+
sentry_sdk/integrations/celery/beat.py,sha256=WHEdKetrDJgtZGNp1VUMa6BG1q-MhsLZMefUmVrPu3w,8953
|
|
113
|
+
sentry_sdk/integrations/celery/utils.py,sha256=CMWQOpg9yniEkm3WlXe7YakJfVnLwaY0-jyeo2GX-ZI,1208
|
|
114
|
+
sentry_sdk/integrations/django/__init__.py,sha256=KqAgBKkuyJGw0lqNZBj0otqZGy_YHqPsisgPZLCN8mQ,25247
|
|
115
|
+
sentry_sdk/integrations/django/asgi.py,sha256=R5wQYS6HAaSM9rmO5bnTHNt6pClthM6LsrgSioTSZSM,8349
|
|
116
|
+
sentry_sdk/integrations/django/caching.py,sha256=c36y2wL4t-ZPIJgMI_gZ4kZ_-IFmVkdehch3fbR7JL0,7010
|
|
117
|
+
sentry_sdk/integrations/django/middleware.py,sha256=UVKq134w_TyOVPV7WwBW0QjHY-ziDipcZBIDQmjqceE,6009
|
|
118
|
+
sentry_sdk/integrations/django/signals_handlers.py,sha256=iudWetTlzNr5-kx_ew1YwW_vZ0yDChoonwPZB7AYGPo,3098
|
|
119
|
+
sentry_sdk/integrations/django/templates.py,sha256=k3PQrNICGS4wqmFxK3o8KwOlqip7rSIryyc4oa1Wexc,5725
|
|
120
|
+
sentry_sdk/integrations/django/transactions.py,sha256=Axyh3l4UvM96R3go2anVhew3JbrEZ4FSYd1r3UXEcw4,4951
|
|
121
|
+
sentry_sdk/integrations/django/views.py,sha256=bjHwt6TVfYY7yfGUa2Rat9yowkUbQ2bYCcJaXJxP2Ik,3137
|
|
122
|
+
sentry_sdk/integrations/google_genai/__init__.py,sha256=smYAekNn-Q2toS1l2cwZ4qfczGYw211O8JY-eFVvzOE,11417
|
|
123
|
+
sentry_sdk/integrations/google_genai/consts.py,sha256=nqHKKSyGixrSoozA06BGVBFaUCsvZlvGoubUZGI1kB8,559
|
|
124
|
+
sentry_sdk/integrations/google_genai/streaming.py,sha256=cRRbVD2Xv3ncoS2ICYhoPGVpHaOK_HHjXhCIij9Kos0,5191
|
|
125
|
+
sentry_sdk/integrations/google_genai/utils.py,sha256=zxrt7GluvQfG5r9EniRCFbtJGKnaeQtePKR0jc7hskQ,20066
|
|
126
|
+
sentry_sdk/integrations/grpc/__init__.py,sha256=zukyRYtaxRGcDuQSXBbVcpa7ZMAYdLQ-laRQqqHsHgc,5620
|
|
127
|
+
sentry_sdk/integrations/grpc/client.py,sha256=4MCY24tqZAU6OzNC_0pphyCLnR_SrfBC-xh8Kb-i8LU,3373
|
|
128
|
+
sentry_sdk/integrations/grpc/consts.py,sha256=NpsN5gKWDmtGtVK_L5HscgFZBHqjOpmLJLGKyh8GZBA,31
|
|
129
|
+
sentry_sdk/integrations/grpc/server.py,sha256=oo79zjfGaJtCSwtxaJeCFRA6UWoH1PDzjR6SDMtt398,2474
|
|
130
|
+
sentry_sdk/integrations/grpc/aio/__init__.py,sha256=2rgrliowpPfLLw40_2YU6ixSzIu_3f8NN3TRplzc8S8,141
|
|
131
|
+
sentry_sdk/integrations/grpc/aio/client.py,sha256=3zfF3XkpzR717BpY1ehxi72jDUvT8Xntx8vkD78kCXc,3327
|
|
132
|
+
sentry_sdk/integrations/grpc/aio/server.py,sha256=SCkdikPZRdWyrlnZewsSGpPk4v6AsdSApVAbO-lf_Lk,4019
|
|
133
|
+
sentry_sdk/integrations/openai_agents/__init__.py,sha256=1pgEdwep-lVUwnw6gdmo98Xhm_x0rjMhR7V_FNuVgj8,1892
|
|
134
|
+
sentry_sdk/integrations/openai_agents/consts.py,sha256=PTb3vlqkuMPktu21ALK72o5WMIX4-cewTEiTRdHKFdQ,38
|
|
135
|
+
sentry_sdk/integrations/openai_agents/utils.py,sha256=fa3r6iHLjTtrU2dHM_7D_0lDQAHR3CUSutIa6Wf7efg,6808
|
|
136
|
+
sentry_sdk/integrations/openai_agents/patches/__init__.py,sha256=w8SAe7cBFf5JL58lZK-yp5a8vDYgVRH-qMIsxq3kClk,293
|
|
137
|
+
sentry_sdk/integrations/openai_agents/patches/agent_run.py,sha256=GPBV-j8YnHOrJAhdhu_tphe14z7G0-riFVmjFNDgy0s,5773
|
|
138
|
+
sentry_sdk/integrations/openai_agents/patches/error_tracing.py,sha256=lHfDQGjfHBH9fEn92gs2RTDDjL1pln4uTrylb2bsML8,2629
|
|
139
|
+
sentry_sdk/integrations/openai_agents/patches/models.py,sha256=DtwqCmSsYFlhRZquKM2jiTOnnAg97eyCTtJYZkWqdww,1405
|
|
140
|
+
sentry_sdk/integrations/openai_agents/patches/runner.py,sha256=Fr5tflgadu3fnEThSZauAhrT7BbvemuZelDVGZjleqA,1483
|
|
141
|
+
sentry_sdk/integrations/openai_agents/patches/tools.py,sha256=uAx1GgsiDJBP7jpYW8r_kOImdgzXlwYqK-uhkyP3icI,3255
|
|
142
|
+
sentry_sdk/integrations/openai_agents/spans/__init__.py,sha256=RlVi781zGsvCJBciDO_EbBbwkakwbP9DoFQBbo4VAEE,353
|
|
143
|
+
sentry_sdk/integrations/openai_agents/spans/agent_workflow.py,sha256=fdRSThD31TcoMXFg-2vmqK2YcSws8Yhd0oC6fxOnysM,469
|
|
144
|
+
sentry_sdk/integrations/openai_agents/spans/ai_client.py,sha256=eqmS-PoF8aJ7YlXM7YouTxbuFYhaKQv7-kF8SwVZ-II,1292
|
|
145
|
+
sentry_sdk/integrations/openai_agents/spans/execute_tool.py,sha256=tqtDIzaxhxJUE-XEvm2dSyJV65UXJ7Mr23C6NTt6ZJE,1411
|
|
146
|
+
sentry_sdk/integrations/openai_agents/spans/handoff.py,sha256=MBhzy7MpvPGwQTPT5TFcOnmSPiSH_uadQ5wvksueIik,525
|
|
147
|
+
sentry_sdk/integrations/openai_agents/spans/invoke_agent.py,sha256=AXiXuJjcvgj_M6NWxHg-OVWld7-nb8VQe3Iq1IEIxOk,2493
|
|
148
|
+
sentry_sdk/integrations/opentelemetry/__init__.py,sha256=emNL5aAq_NhK0PZmfX_g4GIdvBS6nHqGrjrIgrdC5m8,229
|
|
149
|
+
sentry_sdk/integrations/opentelemetry/consts.py,sha256=fYL6FIAEfnGZGBhFn5X7aRyHxihSPqAKKqMLhf5Gniw,143
|
|
150
|
+
sentry_sdk/integrations/opentelemetry/integration.py,sha256=CWp6hFFMqoR7wcuwTRbRO-1iVch4A6oOB3RuHWeX9GQ,1791
|
|
151
|
+
sentry_sdk/integrations/opentelemetry/propagator.py,sha256=NpCgv2Ibq1LUrv8-URayZaPGSzz0f1tJsf7aaxAZ5pc,3720
|
|
152
|
+
sentry_sdk/integrations/opentelemetry/span_processor.py,sha256=IBF75ld9zJLNF1-4EYnNBoAS00_XTXjPio86zPX9DLQ,13276
|
|
153
|
+
sentry_sdk/integrations/pydantic_ai/__init__.py,sha256=milAmxTbyxof1IYLuZwuEMiqRcXcslyfZdhD0nnodhc,1232
|
|
154
|
+
sentry_sdk/integrations/pydantic_ai/consts.py,sha256=fxOQ5n_Do8EqqqxtOJm5zyvhQmOV75HACNrt_-zGngs,36
|
|
155
|
+
sentry_sdk/integrations/pydantic_ai/utils.py,sha256=U3ya0Lp-XxuweBfAM1rvK1ktecHNVcFfv9MKz5yI3N8,7172
|
|
156
|
+
sentry_sdk/integrations/pydantic_ai/patches/__init__.py,sha256=_RHvjc3436KSwPjzrAdnyascgggxg5e0MQpdHhmiS-U,229
|
|
157
|
+
sentry_sdk/integrations/pydantic_ai/patches/agent_run.py,sha256=H7CCCs6FbH_10qvmGFpZftEY7_hBef6WxgLSO1IEqQ4,7443
|
|
158
|
+
sentry_sdk/integrations/pydantic_ai/patches/graph_nodes.py,sha256=9plhCihm4hB0fdKw3ImQvdJLM5ZExD2JlF6zhLJ2yBg,3839
|
|
159
|
+
sentry_sdk/integrations/pydantic_ai/patches/model_request.py,sha256=CFafS2iPUZjJ_JVZwvuQkpaJtpGMLIrMwLHyGlfqlcI,1247
|
|
160
|
+
sentry_sdk/integrations/pydantic_ai/patches/tools.py,sha256=_wGOS78NbWNiMvaG0-ZII31j5Aeutj6KvpkC0fgVZQ8,2944
|
|
161
|
+
sentry_sdk/integrations/pydantic_ai/spans/__init__.py,sha256=dTUjvkw7VMOAiSasuAq37q_njvANsUlgfZxgXRKJDDo,243
|
|
162
|
+
sentry_sdk/integrations/pydantic_ai/spans/ai_client.py,sha256=bRnEpr3j2lgiieorKUElJEjZkihDid_RxRGZzxntQbk,8833
|
|
163
|
+
sentry_sdk/integrations/pydantic_ai/spans/execute_tool.py,sha256=vOGisKI1HYEuoo5U-s9WA61gGsRQn3m9bq7mfYeimD4,1550
|
|
164
|
+
sentry_sdk/integrations/pydantic_ai/spans/invoke_agent.py,sha256=to5AqYPARpr7BLC3nIPiYVsjx1eVG6tN7IW4Y5t5PJ8,3723
|
|
165
|
+
sentry_sdk/integrations/redis/__init__.py,sha256=_pkEiDRzglIBRFMQKwkgbr0pu-DhlMGR0XDZUV9xp6M,1659
|
|
166
|
+
sentry_sdk/integrations/redis/_async_common.py,sha256=A-23KY7JkkZ8g6FufnGo6IHK7Ln-jtZmopVH5WhqdkE,4056
|
|
167
|
+
sentry_sdk/integrations/redis/_sync_common.py,sha256=MS5Bc94cqispn4ZM-WSH02GrgnB6chvrnf0JBabTNMU,3796
|
|
168
|
+
sentry_sdk/integrations/redis/consts.py,sha256=y2f-FJ7TIkzto01tyjXvbKVSVELVkjZaxj3FG5DZ0hA,480
|
|
169
|
+
sentry_sdk/integrations/redis/rb.py,sha256=paykO7EE_DAdiZzCpIqW1MqtBE7mE5UG0JnauFejuzE,806
|
|
170
|
+
sentry_sdk/integrations/redis/redis.py,sha256=1K6seuP6ttEdscKLFtEYEu9vkDRuANCsxWVeDISsGsg,1702
|
|
171
|
+
sentry_sdk/integrations/redis/redis_cluster.py,sha256=a5F5PglAm87b-aW08RUv41zYGYliWZgcM3wrGB_mF-s,3554
|
|
172
|
+
sentry_sdk/integrations/redis/redis_py_cluster_legacy.py,sha256=pz5pg0AxdHPZWt0jMQRDPH_9jdh0i3KoDPbNUyavIro,1585
|
|
173
|
+
sentry_sdk/integrations/redis/utils.py,sha256=nfOoBfgWKCfrUGmb55WzOczUlUywyfPYE4bYN-XYlAQ,4005
|
|
174
|
+
sentry_sdk/integrations/redis/modules/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
175
|
+
sentry_sdk/integrations/redis/modules/caches.py,sha256=LB8UCdPHaSWx6_UHAUCn7z_5Oup-5uU-VvKhYAd6FKU,3991
|
|
176
|
+
sentry_sdk/integrations/redis/modules/queries.py,sha256=-DAor_d6Ir0D1zJe697MWUXqFTYCbVqRfKdkQNF4rF4,1963
|
|
177
|
+
sentry_sdk/integrations/spark/__init__.py,sha256=oOewMErnZk2rzNvIlZO6URxQexu9bUJuSLM2m_zECy8,208
|
|
178
|
+
sentry_sdk/integrations/spark/spark_driver.py,sha256=hInLM2dO5yPxQT9Wb5gvHIKkbbA1i84LBsx416Dv-6c,9474
|
|
179
|
+
sentry_sdk/integrations/spark/spark_worker.py,sha256=FGT4yRU2X_iQCC46aasMmvJfYOKmBip8KbDF_wnhvEY,3706
|
|
180
|
+
sentry_sdk/profiler/__init__.py,sha256=3PI3bHk9RSkkOXZKN84DDedk_7M65EiqqaIGo-DYs0E,1291
|
|
181
|
+
sentry_sdk/profiler/continuous_profiler.py,sha256=7Qb75TaKLNYxMA97wO-qEpDVqxPQWOLUi2rnUm6_Ci0,23066
|
|
182
|
+
sentry_sdk/profiler/transaction_profiler.py,sha256=e3MsUqs-YIp6-nmzpmBYGoWWIF7RyuSGu24Dj-8GXAU,27970
|
|
183
|
+
sentry_sdk/profiler/utils.py,sha256=80MF0wiguKe47O-uWQfl-81G1caiVa8HgcFHWBzFpuM,6492
|
|
184
|
+
sentry_sdk-2.46.0.dist-info/licenses/LICENSE,sha256=KhQNZg9GKBL6KQvHQNBGMxJsXsRdhLebVp4Sew7t3Qs,1093
|
|
185
|
+
sentry_sdk-2.46.0.dist-info/METADATA,sha256=weqN0Q83GeJjt1GyB8YIrttfRJa1v41i4ZMXCo4_T7U,10808
|
|
186
|
+
sentry_sdk-2.46.0.dist-info/WHEEL,sha256=JNWh1Fm1UdwIQV075glCn4MVuCRs0sotJIq-J6rbxCU,109
|
|
187
|
+
sentry_sdk-2.46.0.dist-info/entry_points.txt,sha256=qacZEz40UspQZD1IukCXykx0JtImqGDOctS5KfOLTko,91
|
|
188
|
+
sentry_sdk-2.46.0.dist-info/top_level.txt,sha256=XrQz30XE9FKXSY_yGLrd9bsv2Rk390GTDJOSujYaMxI,11
|
|
189
|
+
sentry_sdk-2.46.0.dist-info/RECORD,,
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2018 Functional Software, Inc. dba Sentry
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
sentry_sdk/_functools.py
DELETED
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
"""
|
|
2
|
-
A backport of Python 3 functools to Python 2/3. The only important change
|
|
3
|
-
we rely upon is that `update_wrapper` handles AttributeError gracefully.
|
|
4
|
-
"""
|
|
5
|
-
|
|
6
|
-
from functools import partial
|
|
7
|
-
|
|
8
|
-
from sentry_sdk._types import MYPY
|
|
9
|
-
|
|
10
|
-
if MYPY:
|
|
11
|
-
from typing import Any
|
|
12
|
-
from typing import Callable
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
WRAPPER_ASSIGNMENTS = (
|
|
16
|
-
"__module__",
|
|
17
|
-
"__name__",
|
|
18
|
-
"__qualname__",
|
|
19
|
-
"__doc__",
|
|
20
|
-
"__annotations__",
|
|
21
|
-
)
|
|
22
|
-
WRAPPER_UPDATES = ("__dict__",)
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
def update_wrapper(
|
|
26
|
-
wrapper, wrapped, assigned=WRAPPER_ASSIGNMENTS, updated=WRAPPER_UPDATES
|
|
27
|
-
):
|
|
28
|
-
# type: (Any, Any, Any, Any) -> Any
|
|
29
|
-
"""Update a wrapper function to look like the wrapped function
|
|
30
|
-
|
|
31
|
-
wrapper is the function to be updated
|
|
32
|
-
wrapped is the original function
|
|
33
|
-
assigned is a tuple naming the attributes assigned directly
|
|
34
|
-
from the wrapped function to the wrapper function (defaults to
|
|
35
|
-
functools.WRAPPER_ASSIGNMENTS)
|
|
36
|
-
updated is a tuple naming the attributes of the wrapper that
|
|
37
|
-
are updated with the corresponding attribute from the wrapped
|
|
38
|
-
function (defaults to functools.WRAPPER_UPDATES)
|
|
39
|
-
"""
|
|
40
|
-
for attr in assigned:
|
|
41
|
-
try:
|
|
42
|
-
value = getattr(wrapped, attr)
|
|
43
|
-
except AttributeError:
|
|
44
|
-
pass
|
|
45
|
-
else:
|
|
46
|
-
setattr(wrapper, attr, value)
|
|
47
|
-
for attr in updated:
|
|
48
|
-
getattr(wrapper, attr).update(getattr(wrapped, attr, {}))
|
|
49
|
-
# Issue #17482: set __wrapped__ last so we don't inadvertently copy it
|
|
50
|
-
# from the wrapped function when updating __dict__
|
|
51
|
-
wrapper.__wrapped__ = wrapped
|
|
52
|
-
# Return the wrapper so this can be used as a decorator via partial()
|
|
53
|
-
return wrapper
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
def wraps(wrapped, assigned=WRAPPER_ASSIGNMENTS, updated=WRAPPER_UPDATES):
|
|
57
|
-
# type: (Callable[..., Any], Any, Any) -> Callable[[Callable[..., Any]], Callable[..., Any]]
|
|
58
|
-
"""Decorator factory to apply update_wrapper() to a wrapper function
|
|
59
|
-
|
|
60
|
-
Returns a decorator that invokes update_wrapper() with the decorated
|
|
61
|
-
function as the wrapper argument and the arguments to wraps() as the
|
|
62
|
-
remaining arguments. Default arguments are as for update_wrapper().
|
|
63
|
-
This is a convenience function to simplify applying partial() to
|
|
64
|
-
update_wrapper().
|
|
65
|
-
"""
|
|
66
|
-
return partial(update_wrapper, wrapped=wrapped, assigned=assigned, updated=updated)
|