@@ -111,7 +111,6 @@ def iter_default_integrations(with_auto_enabling_integrations):
111111 "sentry_sdk.integrations.tornado.TornadoIntegration" ,
112112]
113113
114-
115114iter_default_integrations = _generate_default_integrations_iterator (
116115 integrations = _DEFAULT_INTEGRATIONS ,
117116 auto_enabling_integrations = _AUTO_ENABLING_INTEGRATIONS ,
@@ -120,6 +119,30 @@ def iter_default_integrations(with_auto_enabling_integrations):
120119del _generate_default_integrations_iterator
121120
122121
122+ _MIN_VERSIONS = {
123+ "aiohttp" : (3 , 4 ),
124+ "anthropic" : (0 , 16 ),
125+ "ariadne" : (0 , 20 ),
126+ "arq" : (0 , 23 ),
127+ "asyncpg" : (0 , 23 ),
128+ "boto3" : (1 , 12 ), # this is actually the botocore version
129+ "bottle" : (0 , 12 ),
130+ "celery" : (4 , 4 , 7 ),
131+ "clickhouse_driver" : (0 , 2 , 0 ),
132+ "django" : (1 , 8 ),
133+ "falcon" : (1 , 4 ),
134+ "flask" : (0 , 10 ),
135+ "gql" : (3 , 4 , 1 ),
136+ "graphene" : (3 , 3 ),
137+ "ray" : (2 , 7 , 0 ),
138+ "rq" : (0 , 6 ),
139+ "sanic" : (0 , 8 ),
140+ "sqlalchemy" : (1 , 2 ),
141+ "strawberry" : (0 , 209 , 5 ),
142+ "tornado" : (6 , 0 ),
143+ }
144+
145+
123146def setup_integrations (
124147 integrations ,
125148 with_defaults = True ,
@@ -195,6 +218,23 @@ def setup_integrations(
195218 return integrations
196219
197220
221+ def _check_minimum_version (integration , version , package = None ):
222+ # type: (Integration, Optional[tuple[int]], Optional[str]) -> None
223+ package = package or integration .identifier
224+
225+ if version is None :
226+ raise DidNotEnable (f"Unparsable { package } version: { version } " )
227+
228+ min_version = _MIN_VERSIONS .get (integration .identifier )
229+ if min_version is None :
230+ return
231+
232+ if version < min_version :
233+ raise DidNotEnable (
234+ f"Integration only supports { package } { '.' .join (map (str , min_version ))} or newer."
235+ )
236+
237+
198238class DidNotEnable (Exception ): # noqa: N818
199239 """
200240 The integration could not be enabled due to a trivial user error like
0 commit comments