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
55 changes: 5 additions & 50 deletions scripts/populate_tox/releases.jsonl

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions sentry_sdk/integrations/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,10 +146,12 @@ def iter_default_integrations(
"grpc": (1, 32, 0), # grpcio
"httpx": (0, 16, 0),
"httpx2": (2, 0, 0),
"huey": (2, 0),
"huggingface_hub": (0, 24, 7),
"langchain": (0, 1, 0),
"langgraph": (0, 6, 6),
"launchdarkly": (9, 8, 0),
"litestar": (2, 0, 0),
"litellm": (1, 77, 5),
"loguru": (0, 7, 0),
"mcp": (1, 15, 0),
Expand All @@ -158,18 +160,22 @@ def iter_default_integrations(
"openfeature": (0, 7, 1),
"pydantic_ai": (1, 0, 0),
"pymongo": (3, 5, 0),
"pyramid": (1, 8),
"pyreqwest": (0, 11, 6),
"quart": (0, 16, 0),
"ray": (2, 7, 0),
"redis": (2, 10, 0),
"requests": (2, 30, 0),
"rq": (0, 6),
"sanic": (0, 8),
"spark": (3, 0), # pyspark
"sqlalchemy": (1, 2),
"starlette": (0, 16),
"starlite": (1, 48),
"statsig": (0, 55, 3),
"strawberry": (0, 209, 5),
"tornado": (6, 0),
"trytond": (4, 6),
"typer": (0, 15),
"unleash": (6, 0, 1),
}
Expand Down
5 changes: 3 additions & 2 deletions sentry_sdk/integrations/anthropic.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
from sentry_sdk.utils import (
capture_internal_exceptions,
event_from_exception,
package_version,
parse_version,
reraise,
safe_serialize,
)
Expand All @@ -43,6 +43,7 @@
Omit = None

from anthropic import AsyncStream, Stream
from anthropic import __version__ as ANTHROPIC_VERSION
from anthropic.lib.streaming import (
AsyncMessageStream,
AsyncMessageStreamManager,
Expand Down Expand Up @@ -151,7 +152,7 @@ def __init__(self: "AnthropicIntegration", include_prompts: bool = True) -> None

@staticmethod
def setup_once() -> None:
version = package_version("anthropic")
version = parse_version(ANTHROPIC_VERSION)
_check_minimum_version(AnthropicIntegration, version)

"""
Expand Down
7 changes: 6 additions & 1 deletion sentry_sdk/integrations/beam.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@
from typing import TYPE_CHECKING

import sentry_sdk
from sentry_sdk.integrations import Integration
from sentry_sdk.integrations import Integration, _check_minimum_version
from sentry_sdk.integrations.logging import ignore_logger
from sentry_sdk.utils import (
capture_internal_exceptions,
ensure_integration_enabled,
event_from_exception,
parse_version,
reraise,
)

Expand All @@ -32,8 +33,12 @@ class BeamIntegration(Integration):

@staticmethod
def setup_once() -> None:
from apache_beam import __version__ as BEAM_VERSION # type: ignore
from apache_beam.transforms.core import DoFn, ParDo # type: ignore

version = parse_version(BEAM_VERSION)
_check_minimum_version(BeamIntegration, version)

ignore_logger("root")
ignore_logger("bundle_processor.create")

Expand Down
6 changes: 3 additions & 3 deletions sentry_sdk/integrations/chalice.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from functools import wraps

import sentry_sdk
from sentry_sdk.integrations import DidNotEnable, Integration
from sentry_sdk.integrations import DidNotEnable, Integration, _check_minimum_version
from sentry_sdk.integrations._wsgi_common import _filter_headers
from sentry_sdk.integrations.aws_lambda import _make_request_event_processor
from sentry_sdk.traces import (
Expand Down Expand Up @@ -156,9 +156,9 @@ class ChaliceIntegration(Integration):
@staticmethod
def setup_once() -> None:
version = parse_version(CHALICE_VERSION)

_check_minimum_version(ChaliceIntegration, version)
if version is None:
raise DidNotEnable("Unparsable Chalice version: {}".format(CHALICE_VERSION))
return

if version < (1, 20):
old_get_view_function_response = Chalice._get_view_function_response
Expand Down
15 changes: 13 additions & 2 deletions sentry_sdk/integrations/cohere.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,23 @@
from sentry_sdk.tracing import Span

import sentry_sdk
from sentry_sdk.integrations import DidNotEnable, Integration
from sentry_sdk.integrations import DidNotEnable, Integration, _check_minimum_version
from sentry_sdk.scope import should_send_default_pii
from sentry_sdk.utils import capture_internal_exceptions, event_from_exception, reraise
from sentry_sdk.utils import (
capture_internal_exceptions,
event_from_exception,
parse_version,
reraise,
)

try:
from cohere import (
ChatStreamEndEvent,
NonStreamedChatResponse,
)
from cohere import (
__version__ as COHERE_VERSION,
)
from cohere.base_client import BaseCohere
from cohere.client import Client

Expand Down Expand Up @@ -78,6 +86,9 @@ def __init__(self: "CohereIntegration", include_prompts: bool = True) -> None:

@staticmethod
def setup_once() -> None:
version = parse_version(COHERE_VERSION)
_check_minimum_version(CohereIntegration, version)

BaseCohere.chat = _wrap_chat(BaseCohere.chat, streaming=False)
Client.embed = _wrap_embed(Client.embed)
BaseCohere.chat_stream = _wrap_chat(BaseCohere.chat_stream, streaming=True)
Expand Down
7 changes: 6 additions & 1 deletion sentry_sdk/integrations/dramatiq.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import sentry_sdk
from sentry_sdk.api import continue_trace, get_baggage, get_traceparent
from sentry_sdk.consts import OP, SPANDATA, SPANSTATUS
from sentry_sdk.integrations import DidNotEnable, Integration
from sentry_sdk.integrations import DidNotEnable, Integration, _check_minimum_version
from sentry_sdk.integrations._wsgi_common import request_body_within_bounds
from sentry_sdk.traces import SegmentNameSource
from sentry_sdk.tracing import (
Expand All @@ -17,11 +17,13 @@
AnnotatedValue,
capture_internal_exceptions,
event_from_exception,
parse_version,
)

R = TypeVar("R")

try:
from dramatiq import __version__ as DRAMATIQ_VERSION
from dramatiq.broker import Broker
from dramatiq.errors import Retry
from dramatiq.message import Message
Expand Down Expand Up @@ -54,6 +56,9 @@ class DramatiqIntegration(Integration):

@staticmethod
def setup_once() -> None:
version = parse_version(DRAMATIQ_VERSION)
_check_minimum_version(DramatiqIntegration, version)

_patch_dramatiq_broker()


Expand Down
8 changes: 6 additions & 2 deletions sentry_sdk/integrations/fastapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@

import sentry_sdk
from sentry_sdk.consts import SPANDATA
from sentry_sdk.integrations import DidNotEnable
from sentry_sdk.integrations import DidNotEnable, _check_minimum_version
from sentry_sdk.traces import StreamedSpan, get_current_span
from sentry_sdk.tracing import SOURCE_FOR_STYLE, TransactionSource
from sentry_sdk.tracing_utils import has_span_streaming_enabled
from sentry_sdk.utils import transaction_from_function
from sentry_sdk.utils import parse_version, transaction_from_function

if TYPE_CHECKING:
from typing import Any, Awaitable, Callable, Dict
Expand All @@ -27,6 +27,7 @@

try:
import fastapi # type: ignore
from fastapi import __version__ as FASTAPI_VERSION
except ImportError:
raise DidNotEnable("FastAPI is not installed")

Expand All @@ -46,6 +47,9 @@ class FastApiIntegration(StarletteIntegration):

@staticmethod
def setup_once() -> None:
version = parse_version(FASTAPI_VERSION)
_check_minimum_version(FastApiIntegration, version)

patch_get_request_handler()


Expand Down
7 changes: 6 additions & 1 deletion sentry_sdk/integrations/google_genai/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,14 @@
import sentry_sdk
from sentry_sdk.ai.utils import get_start_span_function
from sentry_sdk.consts import OP, SPANDATA
from sentry_sdk.integrations import DidNotEnable, Integration
from sentry_sdk.integrations import DidNotEnable, Integration, _check_minimum_version
from sentry_sdk.traces import SpanStatus, StreamedSpan
from sentry_sdk.tracing import SPANSTATUS
from sentry_sdk.tracing_utils import has_span_streaming_enabled
from sentry_sdk.utils import parse_version

try:
from google.genai import __version__ as GOOGLE_GENAI_VERSION
from google.genai.models import AsyncModels, Models
except ImportError:
raise DidNotEnable("google-genai not installed")
Expand Down Expand Up @@ -46,6 +48,9 @@ def __init__(self: "GoogleGenAIIntegration", include_prompts: bool = True) -> No

@staticmethod
def setup_once() -> None:
version = parse_version(GOOGLE_GENAI_VERSION)
_check_minimum_version(GoogleGenAIIntegration, version)

# Patch sync methods
Models.generate_content = _wrap_generate_content(Models.generate_content)
Models.generate_content_stream = _wrap_generate_content_stream(
Expand Down
5 changes: 3 additions & 2 deletions sentry_sdk/integrations/graphene.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,11 @@
ensure_integration_enabled,
event_from_exception,
has_data_collection_enabled,
package_version,
parse_version,
)

try:
from graphene import __version__ as GRAPHENE_VERSION # type: ignore
from graphene.types import schema as graphene_schema # type: ignore
except ImportError:
raise DidNotEnable("graphene is not installed")
Expand All @@ -36,7 +37,7 @@ class GrapheneIntegration(Integration):

@staticmethod
def setup_once() -> None:
version = package_version("graphene")
version = parse_version(GRAPHENE_VERSION)
_check_minimum_version(GrapheneIntegration, version)

_patch_graphql()
Expand Down
4 changes: 3 additions & 1 deletion sentry_sdk/integrations/grpc/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from functools import wraps
from typing import TYPE_CHECKING, Any, Optional, Sequence

from sentry_sdk.integrations import DidNotEnable, Integration
from sentry_sdk.integrations import DidNotEnable, Integration, _check_minimum_version
from sentry_sdk.utils import parse_version

from .client import ClientInterceptor
Expand Down Expand Up @@ -175,6 +175,8 @@ class GRPCIntegration(Integration):

@staticmethod
def setup_once() -> None:
_check_minimum_version(GRPCIntegration, GRPC_VERSION)

import grpc

grpc.insecure_channel = _wrap_channel_sync(grpc.insecure_channel)
Expand Down
7 changes: 6 additions & 1 deletion sentry_sdk/integrations/httpx.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import sentry_sdk
from sentry_sdk.consts import OP, SPANDATA
from sentry_sdk.integrations import DidNotEnable, Integration
from sentry_sdk.integrations import DidNotEnable, Integration, _check_minimum_version
from sentry_sdk.scope import should_send_default_pii
from sentry_sdk.tracing_utils import (
add_http_request_source,
Expand All @@ -14,6 +14,7 @@
capture_internal_exceptions,
ensure_integration_enabled,
parse_url,
parse_version,
)

if TYPE_CHECKING:
Expand All @@ -24,6 +25,7 @@

try:
from httpx import AsyncClient, Client, Request, Response
from httpx import __version__ as HTTPX_VERSION
except ImportError:
raise DidNotEnable("httpx is not installed")

Expand All @@ -40,6 +42,9 @@ def setup_once() -> None:
httpx has its own transport layer and can be customized when needed,
so patch Client.send and AsyncClient.send to support both synchronous and async interfaces.
"""
version = parse_version(HTTPX_VERSION)
_check_minimum_version(HttpxIntegration, version)

_install_httpx_client()
_install_httpx_async_client()

Expand Down
7 changes: 6 additions & 1 deletion sentry_sdk/integrations/httpx2.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import sentry_sdk
from sentry_sdk.consts import OP, SPANDATA
from sentry_sdk.integrations import DidNotEnable, Integration
from sentry_sdk.integrations import DidNotEnable, Integration, _check_minimum_version
from sentry_sdk.scope import should_send_default_pii
from sentry_sdk.tracing_utils import (
add_http_request_source,
Expand All @@ -14,6 +14,7 @@
capture_internal_exceptions,
ensure_integration_enabled,
parse_url,
parse_version,
)

if TYPE_CHECKING:
Expand All @@ -24,6 +25,7 @@

try:
from httpx2 import AsyncClient, Client, Request, Response
from httpx2 import __version__ as HTTPX2_VERSION
except ImportError:
raise DidNotEnable("httpx2 is not installed")

Expand All @@ -40,6 +42,9 @@ def setup_once() -> None:
httpx2 has its own transport layer and can be customized when needed,
so patch Client.send and AsyncClient.send to support both synchronous and async interfaces.
"""
version = parse_version(HTTPX2_VERSION)
_check_minimum_version(Httpx2Integration, version)

_install_httpx2_client()
_install_httpx2_async_client()

Expand Down
7 changes: 6 additions & 1 deletion sentry_sdk/integrations/huey.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import sentry_sdk
from sentry_sdk.api import continue_trace, get_baggage, get_traceparent
from sentry_sdk.consts import OP, SPANDATA, SPANSTATUS
from sentry_sdk.integrations import DidNotEnable, Integration
from sentry_sdk.integrations import DidNotEnable, Integration, _check_minimum_version
from sentry_sdk.scope import should_send_default_pii
from sentry_sdk.traces import SegmentNameSource, SpanStatus, StreamedSpan
from sentry_sdk.tracing import (
Expand All @@ -21,6 +21,7 @@
ensure_integration_enabled,
event_from_exception,
has_data_collection_enabled,
parse_version,
reraise,
)

Expand All @@ -33,6 +34,7 @@
F = TypeVar("F", bound=Callable[..., Any])

try:
from huey import __version__ as HUEY_VERSION
from huey.api import Huey, PeriodicTask, Result, ResultGroup, Task
from huey.exceptions import CancelExecution, RetryTask, TaskLockedException
except ImportError:
Expand All @@ -55,6 +57,9 @@ class HueyIntegration(Integration):

@staticmethod
def setup_once() -> None:
version = parse_version(HUEY_VERSION)
_check_minimum_version(HueyIntegration, version)

patch_enqueue()
patch_execute()
_register_control_flow_exception(
Expand Down
Loading
Loading