§
    xÅjš3  ã                   ó  — U d dl mZmZ d dlmZ d dlmZ d dlmZ d dl	m
Z
 erd dlmZ d dlmZmZmZmZmZmZmZmZmZ  e edd	¦  «        ¦  «        Z e¦   «         Z e¦   «         Zd
ed<    e¦   «         Zd
ed<   	 	 	 	 	 	 d’d„Zg d¢Zg d¢Z  eee ¬¦  «        Z![i dd“dd“dd“dd“dd“d d“d!d"“d#d$“d%d&“d'd(“d)d*“d+d,“d-d.“d/d0“d1d2“d3d4“d5d6“i d7d8“d9d:“d;d<“d=d>“d?d@“dAdB“dCdD“dEdF“dGdH“dIdJ“dKdL“dMdN“dOdP“dQdR“dSdT“dUdV“dWdX“¥i dYdZ“d[dV“d\d]“d^d_“d`dB“dadb“dcdD“ddde“dfdg“dhdi“djd“dkdl“dmdn“dodp“dqdr“dsdt“dudv“¥dwdxi¥Z"h dy£dUhdUdhdzœZ#	 	 	 	 d“dd~de$d€e$d�d‚dƒd„dd…fd†„Z%	 d”	 	 	 	 	 	 	 d•d�„Z& G dŽ„ d�e'¦  «        Z( G d�„ d‘e¦  «        Z)d}S )–é    )ÚABCÚabstractmethod)Úzip_longest)ÚLock)ÚTYPE_CHECKING)Úlogger)ÚSequence)	ÚAnyÚCallableÚDictÚIteratorÚListÚOptionalÚSetÚTypeÚUnioniô  iX  zSet[str]Ú_processed_integrationsÚ_installed_integrationsÚintegrationsú	List[str]Úauto_enabling_integrationsÚreturnú-Callable[[bool], Iterator[Type[Integration]]]c                 ó®   ‡ ‡— dt           ddfˆˆ fd„}t          |j        t          ¦  «        r(‰ D ]%}|xj        d                     |¦  «        z  c_        Œ&|S )NÚwith_auto_enabling_integrationsr   zIterator[Type[Integration]]c              3   ó  •K  — ddl m} | r‰‰z   }n‰}|D ]k}	 |                     dd¦  «        \  }}t           ||¦  «        |¦  «        V — Œ8# t          t
          f$ r }t          j        d||¦  «         Y d}~Œdd}~ww xY wdS )z7Returns an iterator of the default integration classes:r   )Úimport_moduleú.é   z)Did not import default integration %s: %sN)Ú	importlibr   ÚrsplitÚgetattrÚDidNotEnableÚSyntaxErrorr   Údebug)	r   r   Úall_import_stringsÚimport_stringÚmoduleÚclsÚer   r   s	          €€úQC:\Projects\Historical\venv\Lib\site-packages\sentry_sdk/integrations/__init__.pyÚiter_default_integrationszJ_generate_default_integrations_iterator.<locals>.iter_default_integrations   së   øè è € ð 	,Ð+Ð+Ð+Ð+Ð+à*ð 	.Ø!-Ð0JÑ!JÐÐà!-Ðà/ð 	ð 	ˆMðØ+×2Ò2°3¸Ñ:Ô:‘�˜Ý˜m˜m¨FÑ3Ô3°SÑ9Ô9Ð9Ð9Ð9Ð9øÝ ¥+Ð.ð ð ð Ý”Ø?ÀÐPQñô ð ð ð ð ð ð øøøøðøøøð		ð 	s   ™4AÁA?ÁA:Á:A?z
- `{}`)ÚboolÚ
isinstanceÚ__doc__ÚstrÚformat)r   r   r,   r'   s   ``  r+   Ú'_generate_default_integrations_iteratorr2      sŒ   øø€ ðÝ)-ðà	&ðð ð ð ð ð ð õ( Ð+Ô3µSÑ9Ô9ð RØ)ð 	Rð 	RˆMØ%Ð-Ô-°×1BÒ1BÀ=Ñ1QÔ1QÑQÐ-Ô-Ð-à$Ð$ó    )z,sentry_sdk.integrations.argv.ArgvIntegrationz0sentry_sdk.integrations.atexit.AtexitIntegrationz0sentry_sdk.integrations.dedupe.DedupeIntegrationz8sentry_sdk.integrations.excepthook.ExcepthookIntegrationz2sentry_sdk.integrations.logging.LoggingIntegrationz2sentry_sdk.integrations.modules.ModulesIntegrationz0sentry_sdk.integrations.stdlib.StdlibIntegrationz6sentry_sdk.integrations.threading.ThreadingIntegration))z2sentry_sdk.integrations.aiohttp.AioHttpIntegrationz6sentry_sdk.integrations.anthropic.AnthropicIntegrationz2sentry_sdk.integrations.ariadne.AriadneIntegrationz*sentry_sdk.integrations.arq.ArqIntegrationz2sentry_sdk.integrations.asyncpg.AsyncPGIntegrationz.sentry_sdk.integrations.boto3.Boto3Integrationz0sentry_sdk.integrations.bottle.BottleIntegrationz0sentry_sdk.integrations.celery.CeleryIntegrationz2sentry_sdk.integrations.chalice.ChaliceIntegrationzEsentry_sdk.integrations.clickhouse_driver.ClickhouseDriverIntegrationz0sentry_sdk.integrations.cohere.CohereIntegrationz0sentry_sdk.integrations.django.DjangoIntegrationz0sentry_sdk.integrations.falcon.FalconIntegrationz2sentry_sdk.integrations.fastapi.FastApiIntegrationz.sentry_sdk.integrations.flask.FlaskIntegrationz*sentry_sdk.integrations.gql.GQLIntegrationz;sentry_sdk.integrations.google_genai.GoogleGenAIIntegrationz4sentry_sdk.integrations.graphene.GrapheneIntegrationz.sentry_sdk.integrations.httpx.HttpxIntegrationz0sentry_sdk.integrations.httpx2.Httpx2Integrationz,sentry_sdk.integrations.huey.HueyIntegrationzAsentry_sdk.integrations.huggingface_hub.HuggingfaceHubIntegrationz6sentry_sdk.integrations.langchain.LangchainIntegrationz6sentry_sdk.integrations.langgraph.LanggraphIntegrationz4sentry_sdk.integrations.litestar.LitestarIntegrationz0sentry_sdk.integrations.loguru.LoguruIntegrationz*sentry_sdk.integrations.mcp.MCPIntegrationz0sentry_sdk.integrations.openai.OpenAIIntegrationz=sentry_sdk.integrations.openai_agents.OpenAIAgentsIntegrationz9sentry_sdk.integrations.pydantic_ai.PydanticAIIntegrationz2sentry_sdk.integrations.pymongo.PyMongoIntegrationz2sentry_sdk.integrations.pyramid.PyramidIntegrationz.sentry_sdk.integrations.quart.QuartIntegrationz.sentry_sdk.integrations.redis.RedisIntegrationz(sentry_sdk.integrations.rq.RqIntegrationz.sentry_sdk.integrations.sanic.SanicIntegrationz8sentry_sdk.integrations.sqlalchemy.SqlalchemyIntegrationz6sentry_sdk.integrations.starlette.StarletteIntegrationz4sentry_sdk.integrations.starlite.StarliteIntegrationz8sentry_sdk.integrations.strawberry.StrawberryIntegrationz2sentry_sdk.integrations.tornado.TornadoIntegration)r   r   Úaiohttp)é   é   Úaiomysql)r   r5   r   Ú	anthropic)r   é   Úariadne)r   é   Úarq)r   é   ÚasyncpgÚbeam)é   é   Úboto3)r   r9   Úbottle)r   rA   Úcelery)r6   r6   é   Úchalice)r   r9   r   Úclickhouse_driver)r   r@   r   Úcohere)é   r6   r   Údjango)r   é   Údramatiq)r   é	   Úfalcon)r   r6   Úfastapi)r   éO   r   Úflask)r   r   r6   Úgql)r5   r6   r   Úgraphene)r5   r5   Úgoogle_genai)r   é   r   Úgrpc)r   é    r   Úhttpx)r   r9   r   Úhttpx2)r@   r   r   Úhuggingface_hub)r   é   rE   Ú	langchain)r   r   r   Ú	langgraph)r   é   r^   Úlaunchdarkly)rM   rK   r   Úlitellm)r   éM   rI   Úloguru)r   rE   r   Úmcp)r   é   r   Úmistral)r@   r   rI   Úopenai)r   r   r   Úopenai_agents)r   r   é   Úopenfeature)r   rE   r   Úpydantic_aiÚpymongo)r5   rI   r   Ú	pyreqwest)r   é   r^   ÚquartÚray)r@   rE   r   ÚrequestsÚrq)r   r^   Úsanic)r   rK   Ú
sqlalchemy)r   r@   Ú	starletteÚstarlite)r   é0   Ústatsig)r   é7   r5   Ú
strawberry)r   éÑ   rI   Útornado)r^   r   Útyper)r   rd   Útypesafe)r   rE   Úunleash)r^   r   r   >   rf   r8   rT   )r\   rg   rj   TFNzSequence[Integration]Úwith_defaultsr   Údisabled_integrationsz9Optional[Sequence[Union[type[Integration], Integration]]]ÚoptionsúOptional[Dict[str, Any]]zDict[str, Integration]c                 ó2  — t          d„ | pdD ¦   «         ¦  «        } t          j        d|¦  «         t          |                      ¦   «         ¦  «        }d„ |pg D ¦   «         }t          ¦   «         }|rIt          |¦  «        D ]9}|j        | vr. |¦   «         }|| |j        <   |                     |j        ¦  «         Œ:d„ |D ¦   «         }	t           	                    ¦   «         D ]b\  }
}|
| v rY|
|	vrU|D ]R}||vrLt          d¦  «        D ]<}|j        |k    r/||vr+| 
                    |¦  «         t          j        d||
¦  «         Œ=ŒSŒc|  	                    ¦   «         D �]\  }}
t          5  |t          vrÚt          |
¦  «        |v rt          j        d|¦  «         n™t          j        d	|¦  «         	 t          |
¦  «                             ¦   «          |
                     |¦  «         t                                |¦  «         n2# t"          $ r%}||vr‚ t          j        d
||¦  «         Y d}~nd}~ww xY wt                               |¦  «         ddd¦  «         n# 1 swxY w Y   �Œ
d„ |  	                    ¦   «         D ¦   «         } | D ]}t          j        d|¦  «         Œ| S )a)  
    Given a list of integration instances, this installs them all.

    When `with_defaults` is set to `True` all default integrations are added
    unless they were already provided before.

    `disabled_integrations` takes precedence over `with_defaults` and
    `with_auto_enabling_integrations`.

    Some integrations are designed to automatically deactivate other integrations
    in order to avoid conflicts and prevent duplicate telemetry from being collected.
    For example, enabling the `langchain` integration will auto-deactivate both the
    `openai` and `anthropic` integrations.

    Users can override this behavior by:
      - Explicitly providing an integration in the `integrations=[]` list, or
      - Disabling the higher-level integration via the `disabled_integrations` option.
    c              3   ó(   K  — | ]}|j         |fV — Œd S ©N©Ú
identifier©Ú.0Úintegrations     r+   ú	<genexpr>z%setup_integrations.<locals>.<genexpr>Ð   s;   è è € ð ð Ø2=ˆÔ	 Ð-ðð ð ð ð ð r3   © z+Setting up integrations (with default = %s)c                 óZ   — g | ](}t          |t          ¦  «        r|nt          |¦  «        ‘Œ)S rŒ   )r.   Útyperˆ   s     r+   ú
<listcomp>z&setup_integrations.<locals>.<listcomp>Ù   sC   € ð ð ð àõ " +­tÑ4Ô4ÐKˆˆ½$¸{Ñ:KÔ:Kðð ð r3   c                 ó   — h | ]	}|j         ’Œ
S rŒ   r†   rˆ   s     r+   ú	<setcomp>z%setup_integrations.<locals>.<setcomp>ê   s(   € ð (ð (ð (Ø#.ˆÔð(ð (ð (r3   TzAAuto-deactivating %s integration because %s integration is activezIgnoring integration %sz0Setting up previously not enabled integration %sz)Did not enable default integration %s: %sNc                 ó,   — i | ]\  }}|t           v ¯||“ŒS rŒ   )r   )r‰   r‡   rŠ   s      r+   ú
<dictcomp>z&setup_integrations.<locals>.<dictcomp>  s4   € ð ð ð á#ˆJ˜ØÕ0Ð0Ð0ð 	�Kà0Ð0Ð0r3   zEnabling integration %s)Údictr   r%   ÚsetÚkeysr,   r‡   ÚaddÚ_INTEGRATION_DEACTIVATESÚitemsÚappendÚ_installer_lockr   rŽ   Ú
setup_onceÚsetup_once_with_optionsr   r#   )r   r   r   r€   r�   Úuser_provided_integrationsÚused_as_default_integrationÚintegration_clsÚinstanceÚ disabled_integration_identifiersrŠ   Útargets_to_deactivateÚtargetr)   r‡   r*   s                   r+   Úsetup_integrationsr¥   ·   sÂ  € õ2 ð ð ØAMÐASÐQSðñ ô ñ ô €Lõ „LÐ>ÀÑNÔNÐNå!$ \×%6Ò%6Ñ%8Ô%8Ñ!9Ô!9Ððð à0Ð6°Bðñ ô Ðõ #&¡%¤%Ðàð EÝ8Ø+ñ 
ô  
ð 	Eð 	EˆOð Ô)°Ð=Ð=Ø*˜?Ñ,Ô,�Ø4<�˜XÔ0Ñ1Ø+×/Ò/°Ô0CÑDÔDÐDøð(ð (Ø2Gð(ñ (ô (Ð$õ /G×.LÒ.LÑ.NÔ.Nð "ð "Ñ*ˆÐ*à˜<Ð'Ð'ØÐ#CÐCÐCà/ð 
"ð 
"�ØÐ!;Ð;Ð;Ý8¸Ñ>Ô>ð "ð "˜Øœ>¨VÒ3Ð3Ø"Ð*?Ð?Ð?Ø 5× <Ò <¸SÑ AÔ AÐ AÝ &¤Ø$gØ$*Ø$/ñ!"ô !"ð !"øøøð $0×#5Ò#5Ñ#7Ô#7ð 8ñ 8Ñˆ
�KÝð 	8ð 	8ØÕ!8Ð8Ð8Ý˜Ñ$Ô$Ð(=Ð=Ð=Ý”LÐ!:¸JÑGÔGÐGÐGå”LØJÈJñô ð ð@Ý˜[Ñ)Ô)×4Ò4Ñ6Ô6Ð6Ø#×;Ò;¸GÑDÔDÐDõ 0×3Ò3°JÑ?Ô?Ð?Ð?øõ (ð ð ð Ø%Ð-HÐHÐHØ!åœØGÈÐUVñô ð ð ð ð ð ð øøøøð	øøøõ (×+Ò+¨JÑ7Ô7Ð7ð+	8ð 	8ð 	8ñ 	8ô 	8ð 	8ð 	8ð 	8ð 	8ð 	8ð 	8øøøð 	8ð 	8ð 	8ð 	8ùð.ð à'3×'9Ò'9Ñ';Ô';ðñ ô €Lð #ð <ð <ˆ
ÝŒÐ.°
Ñ;Ô;Ð;Ð;àÐs=   Å"AIÆ)6G:ÇIÇ:
H)ÈH$ÈIÈ$H)È)IÉI	ÉI	rŠ   útype[Integration]ÚversionúOptional[tuple[int, ...]]ÚpackageúOptional[str]c                 ó\  — |p| j         }|€t          d|› d�¦  «        ‚t                               | j         ¦  «        }|€d S t	          ||d¬¦  «        D ]W\  }}||k    rŒ||k     r<t          d|› dd                     t          t          |¦  «        ¦  «        › d�¦  «        ‚||k    r d S ŒXd S )	NzUnparsable z	 version.r   )Ú	fillvaluezIntegration only supports ú r   z
 or newer.)r‡   r#   Ú_MIN_VERSIONSÚgetr   ÚjoinÚmapr0   )rŠ   r§   r©   Úmin_versionÚvÚmins         r+   Ú_check_minimum_versionrµ   #  sé   € ð
 Ð/˜Ô/€Gà€ÝÐ;¨Ð;Ð;Ð;Ñ<Ô<Ð<å×#Ò# KÔ$:Ñ;Ô;€KØÐØˆõ ˜g {¸aÐ@Ñ@Ô@ð ð ‰ˆˆ3Ø�Š8ˆ8ØØ�ŠWˆWÝØb¨WÐbÐb°s·x²xÅÅCÈÑ@UÔ@UÑ7VÔ7VÐbÐbÐbñô ð ð �ŠWˆWØˆFˆFð ðð r3   c                   ó   — e Zd ZdZdS )r#   a  
    The integration could not be enabled due to a trivial user error like
    `flask` not being installed for the `FlaskIntegration`.

    This exception is silently swallowed for default integrations, but reraised
    for explicitly enabled integrations.
    N)Ú__name__Ú
__module__Ú__qualname__r/   rŒ   r3   r+   r#   r#   >  s   € € € € € ðð ð ð r3   r#   c                   ód   — e Zd ZU dZdZ	 dZded<   	 eed
d„¦   «         ¦   «         Z		 d	 	 	 dd	„Z
dS )ÚIntegrationz–Baseclass for all integrations.

    To accept options for an integration, implement your own constructor that
    saves those options on `self`.
    Nr0   r‡   r   c                  ó   — dS )a`  
        Initialize the integration.

        This function is only called once, ever. Configuration is not available
        at this point, so the only thing to do here is to hook into exception
        handlers, and perhaps do monkeypatches.

        Inside those hooks `Integration.current` can be used to access the
        instance again.
        NrŒ   rŒ   r3   r+   rœ   zIntegration.setup_onceU  s	   € ð 	ˆr3   r�   r‚   c                 ó   — dS )zƒ
        Called after setup_once in rare cases on the instance and with options since we don't have those available above.
        NrŒ   )Úselfr�   s     r+   r�   z#Integration.setup_once_with_optionsd  s	   € ð 	ˆr3   )r   Nr…   )r�   r‚   r   N)r·   r¸   r¹   r/   Úinstallr‡   Ú__annotations__Ústaticmethodr   rœ   r�   rŒ   r3   r+   r»   r»   H  sŽ   € € € € € € ðð ð €GØ*à€J�ÐÐÑØ.àØðð ð ñ „^ñ „\ðð 59ðØ1ðà	ðð ð ð ð ð r3   r»   )r   r   r   r   r   r   )TFNNr…   )rŠ   r¦   r§   r¨   r©   rª   r   N)*Úabcr   r   Ú	itertoolsr   Ú	threadingr   Útypingr   Úsentry_sdk.utilsr   Úcollections.abcr	   r
   r   r   r   r   r   r   r   r   Ú	frozensetÚrangeÚ$_DEFAULT_FAILED_REQUEST_STATUS_CODESr›   r•   r   rÀ   r   r2   Ú_DEFAULT_INTEGRATIONSÚ_AUTO_ENABLING_INTEGRATIONSr,   r®   r˜   r-   r¥   rµ   Ú	Exceptionr#   r»   rŒ   r3   r+   ú<module>rÎ      s|  ðØ #Ð #Ð #Ð #Ð #Ð #Ð #Ð #Ð #Ø !Ð !Ð !Ð !Ð !Ð !Ø Ð Ð Ð Ð Ð Ø  Ð  Ð  Ð  Ð  Ð  à #Ð #Ð #Ð #Ð #Ð #àð WØ(Ð(Ð(Ð(Ð(Ð(ØVÐVÐVÐVÐVÐVÐVÐVÐVÐVÐVÐVÐVÐVÐVÐVÐVÐVÐVÐVÐVÐVð (1 y°°°s¸C±´Ñ'AÔ'AÐ $ð �$‘&”&€ð '* c¡e¤eÐ ˜Ð +Ð +Ñ +ð '* c¡e¤eÐ ˜Ð +Ð +Ñ +ð%Øð%à +ð%ð 5ð%ð %ð %ð %ð>
ð 
ð 
Ð ð*ð *ð *Ð ðX DÐCØ&Ø:ðñ ô Ð ð
 ,ð5Øˆvð5à�	ð5ð �ð5ð ˆwð	5ð
 
ˆ7ð5ð ˆwð5ð ˆGð5ð ˆWð5ð ˆgð5ð ˆið5ð ˆzð5ð ˜ð5ð ˆið5ð ˆfð5ð �ð5ð  ˆfð!5ð" ˆzð#5ð 5ð$ ˆYð%5ð& 
ˆ9ð'5ð( �ð)5ð* �Jð+5ð, ˆJð-5ð. ˆZð/5ð0 ˆið15ð2 �zð35ð4 �ð55ð6 �ð75ð8 �Ið95ð: ˆzð;5ð< ˆið=5ð> 
ˆ:ð?5ð@ ˆyðA5ðB ˆiðC5ðD �ZðE5ð 5ð 5ðF �9ðG5ðH �9ðI5ðJ ˆyðK5ðL �ðM5ðN ˆZðO5ðP 
ˆ9ðQ5ðR �	ðS5ðT 	ˆ&ðU5ðV ˆVðW5ðX �&ðY5ðZ �ð[5ð\ �ð]5ð^ ˆzð_5ð` �+ða5ðb ˆvðc5ðd ˆWðe5ðf �ðg5ð 5ðh ˆyði5ð 5€ðr 9Ð8Ð8Ø�ZØ˜kÐ*ðð Ð ð Ø,1ØY]Ø*.ðið iØ)ðiàðið &*ðið Wð	ið
 (ðið ðið ið ið ið^  $ðØ$ðà(ðð ðð 
ð	ð ð ð ð6ð ð ð ð �9ñ ô ð ð"ð "ð "ð "ð "�#ñ "ô "ð "ð "ð "r3   