
     h                         d Z ddlZddlmZmZmZ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dS )
z`Represents a wheel file and provides access to the various parts of the
name that have meaning.
    N)DictIterableListOptionalTag)BuildTagparse_wheel_filename)InvalidWheelFilename)
deprecatedc                       e Zd ZdZ ej        dej                  ZdeddfdZ	e
defd            Zdee         fdZd	ee         defd
Zd	ee         deeef         defdZd	ee         defdZdS )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)$filenamereturnNc                 r   || _         |  d | _        	 t          |          }|\  | _        }| _        | _        t          |          | _        d S # t          $ r\}| j        	                    |          }|st          |j        d                   d t          d|d|j        d          dddd           |                    d	                              d
d          | _        |                    d                              d
d          | _        |                    d                              d          }|                    d                              d          |                    d                              d          t!          fd|D                       | _        Y d }~d S 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   P   K   | ] }D ]}D ]}t          |||           V  !dS ))interpreterr   platformNr   ).0pyr   r   abisplatss       Y/var/www/surfInsights/venv3-11/lib/python3.11/site-packages/pip/_internal/models/wheel.py	<genexpr>z!Wheel.__init__.<locals>.<genexpr>D   st       ' '' ' !	' '  d;;;' ' ' ' ' ' ' '    )r   
_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__   s     	.2%	-h77JCM@DIx$.x==DLLL- !	 !	 !	 $ 9 ? ? I I$ @*16!9554?'h ' 'vay' ' '
,     *//77??SIIDI,22599AA#sKKDL +0099??DDJ$**51177<<D%++F3399#>>E& ' ' ' ' '$' ' '  DNNNNNNN9!	s   9A F6EF11F6c                 Z   | j         | j         S | j                            | j                  }|
J d            |                    d          }t          j        d|          }|
J d            |                                }t          |d                   |d         f| _         | j         S )Nz!guaranteed by filename validationbuildz^(\d+)(.*)$r      )r(   r-   r.   r   r0   regroupsint)r4   r8   	build_tagr.   build_tag_groupss        r%   rA   zWheel.build_tagK   s    ?&?" !5;;DMJJ ,,.Q,,,%++G44	33  "E    <<>>/2335Ea5HIr'   c                 >    t          d | j        D                       S )z4Return the wheel's tags as a sorted list of strings.c              3   4   K   | ]}t          |          V  d S N)r*   )r!   tags     r%   r&   z0Wheel.get_formatted_file_tags.<locals>.<genexpr>]   s(      993c#hh999999r'   )sortedr)   )r4   s    r%   get_formatted_file_tagszWheel.get_formatted_file_tags[   s!    99$.999999r'   tagsc                      	 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   4   K   | ]\  }}|j         v |V  d S rE   )r)   )r!   itr4   s      r%   r&   z*Wheel.support_index_min.<locals>.<genexpr>m   s3      MMdadn9L9L9L9L9L9LMMr'   )next	enumerateStopIteration
ValueErrorr4   rI   s   ` r%   support_index_minzWheel.support_index_min_   sV    	MMMMiooMMMMMM 	 	 	,,	s	   '+ Atag_to_priorityc                 D    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   0   K   | ]}|v |         V  d S rE    )r!   rF   rT   s     r%   r&   z0Wheel.find_most_preferred_tag.<locals>.<genexpr>   s;       
 
%(c_>T>TOC >T>T>T>T
 
r'   )minr)   )r4   rI   rT   s     `r%   find_most_preferred_tagzWheel.find_most_preferred_tagq   s?    "  
 
 
 
,0N
 
 
 
 
 	
r'   c                 8    | 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)   
isdisjointrR   s     r%   	supportedzWheel.supported   s    
 >,,T2222r'   )__name__
__module____qualname____doc__r>   compileVERBOSEr-   r*   r:   propertyr	   rA   r   rH   r   r@   rS   r   rY   r   boolr\   rW   r'   r%   r   r      s'       %2:	 	
	 - - - - - -^ 8    X:c : : : :d3i C    $
I
04S#X
	
 
 
 
*3hsm 3 3 3 3 3 3 3r'   r   )r`   r>   typingr   r   r   r   pip._vendor.packaging.tagsr   pip._vendor.packaging.utilsr	   r
   r   r,   pip._internal.exceptionspip._internal.utils.deprecationr   r   rW   r'   r%   <module>rj      s     
			 1 1 1 1 1 1 1 1 1 1 1 1 * * * * * * F F F F F F F F      : 9 9 9 9 9 6 6 6 6 6 6y3 y3 y3 y3 y3 y3 y3 y3 y3 y3r'   