
    ;ȋh                        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dS )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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strreturnNonec                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       W/var/www/pixelcanvas.ch/venv/lib/python3.11/site-packages/pip/_internal/models/wheel.py	<genexpr>z!Wheel.__init__.<locals>.<genexpr>F   st       ' '' ' !	' '  d;;;' ' ' ' ' ' ' '    )r   
_build_tagr   r   	file_tagsr   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     	+/%	-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r   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   r/   regroupsint)r3   r7   	build_tagr-   build_tag_groupss        r%   r@   zWheel.build_tagM   s    ?&?" !5;;DMJJ ,,.Q,,,%++G44	33  "E    <<>>/2335Ea5HIr'   	list[str]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)   )r3   s    r%   get_formatted_file_tagszWheel.get_formatted_file_tags]   s!    99$.999999r'   tags	list[Tag]r?   c                     	 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tr3   s      r%   r&   z*Wheel.support_index_min.<locals>.<genexpr>o   s3      MMdadn9L9L9L9L9L9LMMr'   )next	enumerateStopIteration
ValueErrorr3   rI   s   ` r%   support_index_minzWheel.support_index_mina   sV    	MMMMiooMMMMMM 	 	 	,,	s	   '+ Atag_to_prioritydict[Tag, int]c                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   rU   s     r%   r&   z0Wheel.find_most_preferred_tag.<locals>.<genexpr>   s;       
 
%(c_>T>TOC >T>T>T>T
 
r'   )minr)   )r3   rI   rU   s     `r%   find_most_preferred_tagzWheel.find_most_preferred_tags   s?    "  
 
 
 
,0N
 
 
 
 
 	
r'   Iterable[Tag]boolc                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)   
isdisjointrS   s     r%   	supportedzWheel.supported   s    
 >,,T2222r'   N)r   r   r   r   )r   r   )r   rB   )rI   rJ   r   r?   )rI   rJ   rU   rV   r   r?   )rI   r\   r   r]   )__name__
__module____qualname____doc__r=   compileVERBOSEr,   r9   propertyr@   rH   rT   r[   r`   rY   r'   r%   r   r      s        %2:	 	
	 - - - -^    X: : : :   $
 
 
 
*3 3 3 3 3 3r'   r   )rd   
__future__r   r=   collections.abcr   pip._vendor.packaging.tagsr   pip._vendor.packaging.utilsr   r   r	   r+   pip._internal.exceptionspip._internal.utils.deprecationr
   r   rY   r'   r%   <module>rn      s     # " " " " " 				 $ $ $ $ $ $ * * * * * * 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'   