
    g
                        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	 	 	 	 ddZ	 	 	 	 dd	Zy
)    )annotations)	getLogger)
Collection)InvalidRequirementRequirement)DistributionPackageNotFoundErrorversionc                  :    e Zd ZU dZded<   dZded<   dddZd Zy)	DependencyConflictN
str | Nonerequiredfoundc                     || _         || _        y Nr   r   )selfr   r   s      _/var/www/openai/venv/lib/python3.12/site-packages/opentelemetry/instrumentation/dependencies.py__init__zDependencyConflict.__init__#   s     
    c                <    d| j                    d| j                   dS )Nz DependencyConflict: requested: "z" but found: ""r   )r   s    r   __str__zDependencyConflict.__str__'   s     1$--tzzlZ[\\r   r   )r   r   r   r   )__name__
__module____qualname__r   __annotations__r   r   r    r   r   r   r      s!    HjE:]r   r   c                    g }d}d}||i}| j                   D ]C  }||vs||vrt        |      }|j                  j                  |      s3|j	                  |       E t        |      S )Nextrainstruments)requiresr   markerevaluateappendget_dependency_conflicts)distinstrumentation_depsr    r!   instruments_markerdepreqs          r   get_dist_dependency_conflictsr,   +   sx     EK-}}{#5#::12 '',  $$899r   c                   | D ]o  }t        |t              r|}n	 t        |      }	 t        |j                        }|j                  j                  |      rTt        ||j                   d|       c S  y # t        $ r.}t        j	                  d||       t        |      cY d }~c S d }~ww xY w# t        $ r t        |      cY c S w xY w)Nz<error parsing dependency, reporting as a conflict: "%s" - %s )
isinstancer   r   loggerwarningr   r
   namer	   	specifiercontains)depsr*   r+   excdist_versions        r   r&   r&   =   s     c;'C/!#&	+"388,L }}%%l3%cchhZq+GHH) *  & /R
 *#../ $ 	+%c**	+s.   A6B06	B-?!B( B-(B-0C	C	N)r'   r   returnDependencyConflict | None)r5   zCollection[str | Requirement]r8   r9   )
__future__r   loggingr   typingr   packaging.requirementsr   r   &opentelemetry.util._importlib_metadatar   r	   r
   r   r0   r   r,   r&   r   r   r   <module>r?      s_    #   B  
8		] 	]:
::$
'r   