
    xih                    d    d Z ddlmZ ddlmZ ddlmZ ddlmZ	 ddlm
Z
 ddlmZ  G d d      Zy	)
z`Represents a wheel file and provides access to the various parts of the
name that have meaning.
    )annotations)Iterable)Tag)InvalidWheelFilename)parse_wheel_filenamec                  D    e Zd ZdZddZd	dZd
dZ	 	 	 	 	 	 ddZddZy)WheelzA wheel filec                    || _         	 t        |      }|\  | _        }| _        | _        t        |      | _	        y # t        $ r}t        |j                  d         d d }~ww xY w)Nr   )
filenamer   _PackagingInvalidWheelFilenamer   argsname	build_tag	file_tagsstrversion)selfr   
wheel_infoe_versions        U/var/www/html/binance/venv/lib/python3.12/site-packages/pip/_internal/models/wheel.py__init__zWheel.__init__   sa     	<-h7J ?I;	8T^T^8}	 . 	<&qvvay1t;	<s   ; 	A"AA"c                :    t        d | j                  D              S )z4Return the wheel's tags as a sorted list of strings.c              3  2   K   | ]  }t        |        y wN)r   ).0tags     r   	<genexpr>z0Wheel.get_formatted_file_tags.<locals>.<genexpr>"   s     93c#h9s   )sortedr   )r   s    r   get_formatted_file_tagszWheel.get_formatted_file_tags    s    9$..999    c                n     	 t         fdt        |      D              S # t        $ r t               w xY w)a  Return the lowest index that one of the wheel's file_tag combinations
        achieves in the given list of supported tags.

        For example, if there are 8 supported tags and one of the file tags
        is first in the list, then return 0.

        :param tags: the PEP 425 tags to check the wheel against, in order
            with most preferred first.

        :raises ValueError: If none of the wheel's file tags match one of
            the supported tags.
        c              3  F   K   | ]  \  }}|j                   v s|  y wr   )r   )r   itr   s      r   r   z*Wheel.support_index_min.<locals>.<genexpr>2   s      Mdadnn9LMs   !!)next	enumerateStopIteration
ValueErrorr   tagss   ` r   support_index_minzWheel.support_index_min$   s4    	MioMMM 	,	s     4c                @    t        fd| j                  D              S )a  Return the priority of the most preferred tag that one of the wheel's file
        tag combinations achieves in the given list of supported tags using the given
        tag_to_priority mapping, where lower priorities are more-preferred.

        This is used in place of support_index_min in some cases in order to avoid
        an expensive linear scan of a large list of tags.

        :param tags: the PEP 425 tags to check the wheel against.
        :param tag_to_priority: a mapping from tag to priority of that tag, where
            lower is more preferred.

        :raises ValueError: If none of the wheel's file tags match one of
            the supported tags.
        c              3  2   K   | ]  }|v s|     y wr    )r   r   tag_to_prioritys     r   r   z0Wheel.find_most_preferred_tag.<locals>.<genexpr>G   s"      
%(c_>TOC 
s   	
)minr   )r   r+   r0   s     `r   find_most_preferred_tagzWheel.find_most_preferred_tag6   s#    "  
,0NN
 
 	
r!   c                :    | j                   j                  |       S )zReturn whether the wheel is compatible with one of the given tags.

        :param tags: the PEP 425 tags to check the wheel against.
        )r   
isdisjointr*   s     r   	supportedzWheel.supportedK   s    
 >>,,T222r!   N)r   r   returnNone)r6   z	list[str])r+   	list[Tag]r6   int)r+   r8   r0   zdict[Tag, int]r6   r9   )r+   zIterable[Tag]r6   bool)	__name__
__module____qualname____doc__r   r    r,   r2   r5   r/   r!   r   r	   r	      s6    	%:$

0>
	
*3r!   r	   N)r>   
__future__r   collections.abcr   pip._vendor.packaging.tagsr   pip._vendor.packaging.utilsr   r   r   pip._internal.exceptionsr	   r/   r!   r   <module>rD      s,    # $ * = 9>3 >3r!   