
    dh                    |    d Z ddlmZ ddlZddlmZ ddlmZ ddlm	Z	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.
    )annotationsN)IterableTag)BuildTagparse_wheel_filename)InvalidWheelFilename)
deprecatedc                      e Zd ZdZ ej
                  dej                        Zd
dZe	dd       Z
ddZddZ	 	 	 	 	 	 ddZddZy	)WheelzA wheel filez^(?P<namever>(?P<name>[^\s-]+?)-(?P<ver>[^\s-]*?))
        ((-(?P<build>\d[^-]*?))?-(?P<pyver>[^\s-]+?)-(?P<abi>[^\s-]+?)-(?P<plat>[^\s-]+?)
        \.whl|\.dist-info)$c                   || _         |  d | _        	 t        |      }|\  | _        }| _        | _        t        |      | _        y # t        $ r)}| j                  j                  |      }|st        |j                  d         d t        d|d|j                  d    dddd       |j                  d	      j                  d
d      | _        |j                  d      j                  d
d      | _        |j                  d      j                  d      }|j                  d      j                  d      |j                  d      j                  d      t!        fd|D              | _        Y d }~y d }~ww xY w)Nr   zWheel filename zU is not correctly normalised. Future versions of pip will raise the following error:
z

zvto rename the wheel to use a correctly normalised name (this may require updating the version in the project metadata)z25.3i2  )reasonreplacementgone_inissuename_-verpyver.abiplatc              3  V   K   | ]   }D ]  }D ]  }t        |||          " yw))interpreterr   platformNr   ).0pyr   r   abisplatss       \/var/www/html/vivango/api/ia/venv/lib/python3.12/site-packages/pip/_internal/models/wheel.py	<genexpr>z!Wheel.__init__.<locals>.<genexpr>F   sO      '' !	'  d;;';';'s   &))filename
_build_tagr   r   	file_tagsstrversion_PackagingInvalidWheelFilenamelegacy_wheel_file_rematchr	   argsr
   groupreplacesplit	frozenset)	selfr#   
wheel_info_versionelegacy_wheel_info
pyversionsr   r    s	          @@r!   __init__zWheel.__init__   sg     	+/%	-h7JCM@DIx$.x=DL- !	 $ 9 9 ? ? I$*166!954?%h\ 2Ovvayk'
,  *//7??SIDI,2259AA#sKDL +009??DJ$**5177<D%++F399#>E& '$' DNN9!	s   1A 
E9DE44E9c                V   | j                   | j                   S | j                  j                  | j                        }|J d       |j	                  d      }t        j                  d|      }|J d       |j                         }t        |d         |d   f| _         | j                   S )Nz!guaranteed by filename validationbuildz^(\d+)(.*)$r      )r$   r)   r*   r#   r,   regroupsint)r0   r4   	build_tagr*   build_tag_groupss        r!   r=   zWheel.build_tagM   s    ??&??" !55;;DMMJ ,Q.QQ,%++G4	3 E"EE  <<>/235Ea5HI    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&   )r   tags     r!   r"   z0Wheel.get_formatted_file_tags.<locals>.<genexpr>_   s     93c#h9s   )sortedr%   )r0   s    r!   get_formatted_file_tagszWheel.get_formatted_file_tags]   s    9$..999r?   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rB   )r%   )r   itr0   s      r!   r"   z*Wheel.support_index_min.<locals>.<genexpr>o   s      Mdadnn9LMs   !!)next	enumerateStopIteration
ValueErrorr0   tagss   ` r!   support_index_minzWheel.support_index_mina   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rB    )r   rC   tag_to_prioritys     r!   r"   z0Wheel.find_most_preferred_tag.<locals>.<genexpr>   s"      
%(c_>TOC 
s   	
)minr%   )r0   rO   rT   s     `r!   find_most_preferred_tagzWheel.find_most_preferred_tags   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%   
isdisjointrN   s     r!   	supportedzWheel.supported   s    
 >>,,T222r?   N)r#   r&   returnNone)rZ   r   )rZ   z	list[str])rO   	list[Tag]rZ   r<   )rO   r\   rT   zdict[Tag, int]rZ   r<   )rO   zIterable[Tag]rZ   bool)__name__
__module____qualname____doc__r:   compileVERBOSEr)   r6   propertyr=   rE   rP   rV   rY   rS   r?   r!   r   r      sj    %2::	 	

	-^  :$

0>
	
*3r?   r   )ra   
__future__r   r:   collections.abcr   pip._vendor.packaging.tagsr   pip._vendor.packaging.utilsr   r   r	   r(   pip._internal.exceptionspip._internal.utils.deprecationr
   r   rS   r?   r!   <module>rk      s4    # 	 $ * F : 6y3 y3r?   