From f7244a2ba13dd9bd7199613ddff7dbac3e62f3e4 Mon Sep 17 00:00:00 2001 From: Ivana Kellyer Date: Thu, 9 Jan 2025 14:54:13 +0100 Subject: [PATCH] anthropic --- sentry_sdk/integrations/anthropic.py | 9 ++------- sentry_sdk/integrations/asyncpg.py | 1 - 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/sentry_sdk/integrations/anthropic.py b/sentry_sdk/integrations/anthropic.py index 87e69a3113..f06d8a14db 100644 --- a/sentry_sdk/integrations/anthropic.py +++ b/sentry_sdk/integrations/anthropic.py @@ -4,7 +4,7 @@ import sentry_sdk from sentry_sdk.ai.monitoring import record_token_usage from sentry_sdk.consts import OP, SPANDATA -from sentry_sdk.integrations import DidNotEnable, Integration +from sentry_sdk.integrations import _check_minimum_version, DidNotEnable, Integration from sentry_sdk.scope import should_send_default_pii from sentry_sdk.utils import ( capture_internal_exceptions, @@ -37,12 +37,7 @@ def __init__(self, include_prompts=True): def setup_once(): # type: () -> None version = package_version("anthropic") - - if version is None: - raise DidNotEnable("Unparsable anthropic version.") - - if version < (0, 16): - raise DidNotEnable("anthropic 0.16 or newer required.") + _check_minimum_version(AnthropicIntegration, version) Messages.create = _wrap_message_create(Messages.create) AsyncMessages.create = _wrap_message_create_async(AsyncMessages.create) diff --git a/sentry_sdk/integrations/asyncpg.py b/sentry_sdk/integrations/asyncpg.py index 2cdb2557e0..b6b53f4668 100644 --- a/sentry_sdk/integrations/asyncpg.py +++ b/sentry_sdk/integrations/asyncpg.py @@ -33,7 +33,6 @@ def __init__(self, *, record_params: bool = False): def setup_once() -> None: # asyncpg.__version__ is a string containing the semantic version in the form of ".." asyncpg_version = parse_version(asyncpg.__version__) - _check_minimum_version(AsyncPGIntegration, asyncpg_version) asyncpg.Connection.execute = _wrap_execute(