§
    X›jÐ  ã                  ó¶   — d dl mZ d dlmZ d dlmZ d dlmZmZ d dl	m
Z
mZmZ  ee¦  «        Z G d„ d¦  «        Z G d„ d	e¦  «        Zdd„Z	 ddd„Zdd„ZdS )é    )Úannotations)Ú	getLogger)Ú
Collection)ÚInvalidRequirementÚRequirement)ÚDistributionÚPackageNotFoundErrorÚversionc                  ód   — e Zd ZU dZdZded<   dZded<   dZded<   dZded<   	 	 	 	 ddd	„Z	d
„ Z
dS )ÚDependencyConflictaü  Represents a dependency conflict in OpenTelemetry instrumentation.

    This class is used to track conflicts between required dependencies and the
    actual installed packages. It supports two scenarios:

    1. Standard conflicts where all dependencies are required
    2. Either/or conflicts where only one of a set of dependencies is required

    Attributes:
        required: The required dependency specification that conflicts with what's installed.
        found: The actual dependency that was found installed (if any).
        required_any: Collection of dependency specifications where any one would satisfy
            the requirement (for either/or scenarios).
        found_any: Collection of actual dependencies found for either/or scenarios.
    Nú
str | NoneÚrequiredÚfoundúCollection[str]Úrequired_anyÚ	found_anyc                ó>   — || _         || _        || _        || _        d S ©N)r   r   r   r   )Úselfr   r   r   r   s        úg/home/lighthouse/health/venv/lib/python3.11/site-packages/opentelemetry/instrumentation/dependencies.pyÚ__init__zDependencyConflict.__init__6   s%   € ð !ˆŒØˆŒ
à(ˆÔØ"ˆŒˆˆó    c                óx   — | j         s!| j        s| j        rd| j        › d| j        › d�S d| j         › d| j        › d�S )Nz5DependencyConflict: requested any of the following: "z" but found: "ú"z DependencyConflict: requested: ")r   r   r   r   ©r   s    r   Ú__str__zDependencyConflict.__str__C   s_   € ØŒ}ð 	~ $Ô"3ð 	~°t´~ð 	~Ø}È4ÔK\Ð}Ð}ÐlpÔlzÐ}Ð}Ð}Ð}Ø\°$´-Ð\Ð\ÈtÌzÐ\Ð\Ð\Ð\r   )NNNN)r   r   r   r   r   r   r   r   )Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   Ú__annotations__r   r   r   r   r   © r   r   r   r      s¡   € € € € € € ðð ð   €HÐÐÐÑØ€EÐÐÐÑà$(€LÐ(Ð(Ð(Ñ(Ø!%€IÐ%Ð%Ð%Ñ%ð  $Ø Ø(,Ø%)ð#ð #ð #ð #ð #ð]ð ]ð ]ð ]ð ]r   r   c                  ó(   — e Zd ZU ded<   dd„Zd„ ZdS )ÚDependencyConflictErrorr   Úconflictc                ó   — || _         d S r   )r%   )r   r%   s     r   r   z DependencyConflictError.__init__L   s   € Ø ˆŒˆˆr   c                ó*   — t          | j        ¦  «        S r   )Ústrr%   r   s    r   r   zDependencyConflictError.__str__O   s   € Ý�4”=Ñ!Ô!Ð!r   N)r%   r   )r   r   r   r!   r   r   r"   r   r   r$   r$   I   sE   € € € € € € Ø Ð Ð Ñ ð!ð !ð !ð !ð"ð "ð "ð "ð "r   r$   Údistr   ÚreturnúDependencyConflict | Nonec                ó^  — g }g }d}d}||i}d}||i}| j         r…| j         D ]}}||vrŒ||vr||vrŒt          |¦  «        }	|	j                             |¦  «        r|                     |	¦  «         |	j                             |¦  «        r|                     |	¦  «         Œ~t          ||¦  «        S )NÚextraÚinstrumentszinstruments-any)Úrequiresr   ÚmarkerÚevaluateÚappendÚget_dependency_conflicts)
r)   Úinstrumentation_depsÚinstrumentation_any_depsr-   r.   Úinstruments_markerÚinstruments_anyÚinstruments_any_markerÚdepÚreqs
             r   Úget_dist_dependency_conflictsr;   S   sö   € ð ÐØ!ÐØ€EØ€KØ Ð-ÐØ'€OØ# _Ð5ÐØ„}ð 5Ø”=ð 
	5ð 
	5ˆCØ˜CÐÐØØ #Ð%Ð%¨/ÀÐ*DÐ*DØå˜cÑ"Ô"ˆCØŒz×"Ò"Ð#5Ñ6Ô6ð 1Ø$×+Ò+¨CÑ0Ô0Ð0ØŒz×"Ò"Ð#9Ñ:Ô:ð 5Ø(×/Ò/°Ñ4Ô4Ð4øÝ#ØÐ6ñô ð r   NÚdepsúCollection[str | Requirement]Údeps_anyú$Collection[str | Requirement] | Nonec                óæ  — | D ]Ü}t          |t          ¦  «        r|}nU	 t          |¦  «        }nD# t          $ r7}t                               d||¦  «         t          |¦  «        cY d }~c S d }~ww xY w	 t          |j        ¦  «        }n!# t          $ r t          |¦  «        cY c S w xY w|j	         
                    |¦  «        st          ||j        › d|› �¦  «        c S ŒÝ|rt          |¦  «        S d S )Nú<error parsing dependency, reporting as a conflict: "%s" - %sú )Ú
isinstancer   r   ÚloggerÚwarningr   r
   Únamer	   Ú	specifierÚcontainsÚ_get_dependency_conflicts_any)r<   r>   r9   r:   ÚexcÚdist_versions         r   r3   r3   n   sT  € ð ð Ið IˆÝ�c�;Ñ'Ô'ð 	/ØˆCˆCð/Ý! #Ñ&Ô&��øÝ%ð /ð /ð /Ý—’ØRØØñô ð õ
 *¨#Ñ.Ô.Ð.Ð.Ð.Ð.Ð.Ð.Ð.Ð.øøøøð/øøøð	+Ý" 3¤8Ñ,Ô,ˆLˆLøÝ#ð 	+ð 	+ð 	+Ý% cÑ*Ô*Ð*Ð*Ð*Ð*Ð*ð	+øøøð Œ}×%Ò% lÑ3Ô3ð 	IÝ% c¨c¬hÐ+GÐ+G¸Ð+GÐ+GÑHÔHÐHÐHÐHð	Ið ð 7Ý,¨XÑ6Ô6Ð6Øˆ4s,   ž.®
A/¸*A*Á"A/Á*A/Á3BÂB&Â%B&c                óv  — | sd S d}g }g }| D �]}t          |t          ¦  «        r|}nU	 t          |¦  «        }nD# t          $ r7}t                               d||¦  «         t          |¦  «        cY d }~c S d }~ww xY w	 t          |j        ¦  «        }n2# t          $ r% | 	                    t          |¦  «        ¦  «         Y Œ´w xY w|j                             |¦  «        rd} nC| 	                    t          |¦  «        ¦  «         | 	                    |j        › d|› �¦  «         �Œ|rt          ||¬¦  «        S d S )NTrA   FrB   )r   r   )rC   r   r   rD   rE   r   r
   rF   r	   r2   r(   rG   rH   )r>   Úis_dependency_conflictr   r   r9   r:   rJ   rK   s           r   rI   rI   ’   s¢  € ð ð ØˆtØ!ÐØ$&€LØ!#€IØð 7ñ 7ˆÝ�c�;Ñ'Ô'ð 	/ØˆCˆCð/Ý! #Ñ&Ô&��øÝ%ð /ð /ð /Ý—’ØRØØñô ð õ
 *¨#Ñ.Ô.Ð.Ð.Ð.Ð.Ð.Ð.Ð.Ð.øøøøð/øøøð	Ý" 3¤8Ñ,Ô,ˆLˆLøÝ#ð 	ð 	ð 	Ø×Ò¥ C¡¤Ñ)Ô)Ð)ØˆHð	øøøð Œ=×!Ò! ,Ñ/Ô/ð 	à%*Ð"ØˆEà×Ò�C ™HœHÑ%Ô%Ð%Ø×Ò˜CœHÐ5Ð5 |Ð5Ð5Ñ6Ô6Ð6Ñ6àð 
Ý!Ø%Øð
ñ 
ô 
ð 	
ð ˆ4s-   ©9¹
A:Á*A5Á-A:Á5A:Á>BÂ,CÃC)r)   r   r*   r+   r   )r<   r=   r>   r?   r*   r+   )r>   r=   r*   r+   )Ú
__future__r   Úloggingr   Útypingr   Úpackaging.requirementsr   r   Ú&opentelemetry.util._importlib_metadatar   r	   r
   r   rD   r   Ú	Exceptionr$   r;   r3   rI   r"   r   r   ú<module>rT      sE  ðð #Ð "Ð "Ð "Ð "Ð "à Ð Ð Ð Ð Ð Ø Ð Ð Ð Ð Ð à BÐ BÐ BÐ BÐ BÐ BÐ BÐ Bðð ð ð ð ð ð ð ð ð ð 
ˆ�8Ñ	Ô	€ð']ð ']ð ']ð ']ð ']ñ ']ô ']ð ']ðT"ð "ð "ð "ð "˜iñ "ô "ð "ðð ð ð ð@ ð ð  ð  ð  ð  ðH)ð )ð )ð )ð )ð )r   