§
    k•jx&  ã                  óÖ  — d dl mZ d dlZd dlmZmZmZmZ ddlm	Z	m
Z
mZ ddlmZmZmZ g d¢Zd+d
„Zeed         eeef         f         Z ede¦  «        Z	  G d„ de¦  «        Z G d„ de¦  «        Z G d„ de¦  «        Z ej        dej        ej        z  ¦  «        Z ej        dej        ¦  «        Z ej        dej        ¦  «        Zddœd,d„Z d-d„Z!ddœd.d#„Z"dd$œd/d(„Z#d0d*„Z$dS )1é    )ÚannotationsN)ÚNewTypeÚTupleÚUnionÚcasté   )ÚTagÚUnsortedTagsErrorÚ	parse_tag)ÚInvalidVersionÚVersionÚ_TrimmedRelease)
ÚBuildTagÚInvalidNameÚInvalidSdistFilenameÚInvalidWheelFilenameÚNormalizedNameÚcanonicalize_nameÚcanonicalize_versionÚis_normalized_nameÚparse_sdist_filenameÚparse_wheel_filenameÚreturnú	list[str]c                 ó   — t           S )N)Ú__all__© ó    ú^/var/www/finuniver-perm.ru/html/portfolio/venv/lib/python3.11/site-packages/packaging/utils.pyÚ__dir__r       s   € Ý€Nr   r   r   c                  ó   — e Zd ZdZdS )r   zW
    An invalid distribution name; users should refer to the packaging user guide.
    N©Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   r   r   r   '   ó   € € € € € ðð ð ð r   r   c                  ó   — e Zd ZdZdS )r   zM
    An invalid wheel filename was found, users should refer to PEP 427.
    Nr"   r   r   r   r   r   -   r'   r   r   c                  ó   — e Zd ZdZdS )r   z^
    An invalid sdist filename was found, users should refer to the packaging user guide.
    Nr"   r   r   r   r   r   3   r'   r   r   z%[a-z0-9]|[a-z0-9][a-z0-9._-]*[a-z0-9]z+[a-z0-9]|[a-z0-9]([a-z0-9-](?!--))*[a-z0-9]z	(\d+)(.*)F)ÚvalidateÚnameÚstrr*   Úboolc               ó2  — |r,t                                | ¦  «        st          d| ›�¦  «        ‚|                      ¦   «                              dd¦  «                             dd¦  «        }d|v r|                     dd¦  «        }d|v °t          d|¦  «        S )a]  
    This function takes a valid Python package or extra name, and returns the
    normalized form of it.

    The return type is typed as :class:`NormalizedName`. This allows type
    checkers to help require that a string has passed through this function
    before use.

    If **validate** is true, then the function will check if **name** is a valid
    distribution name before normalizing.

    :param str name: The name to normalize.
    :param bool validate: Check whether the name is a valid distribution name.
    :raises InvalidName: If **validate** is true and the name is not an
        acceptable distribution name.

    >>> from packaging.utils import canonicalize_name
    >>> canonicalize_name("Django")
    'django'
    >>> canonicalize_name("oslo.concurrency")
    'oslo-concurrency'
    >>> canonicalize_name("requests")
    'requests'
    zname is invalid: Ú_ú-ú.z--r   )Ú_validate_regexÚ	fullmatchr   ÚlowerÚreplacer   )r+   r*   Úvalues      r   r   r   B   sŸ   € ð2 ð 8�×1Ò1°$Ñ7Ô7ð 8ÝÐ6¨dÐ6Ð6Ñ7Ô7Ð7ð �JŠJ‰LŒL× Ò   cÑ*Ô*×2Ò2°3¸Ñ<Ô<€Eà
�%ˆ-ˆ-Ø—’˜d CÑ(Ô(ˆð �%ˆ-ˆ-åÐ  %Ñ(Ô(Ð(r   c                ó:   — t                                | ¦  «        duS )a7  
    Check if a name is already normalized (i.e. :func:`canonicalize_name` would
    roundtrip to the same value).

    :param str name: The name to check.

    >>> from packaging.utils import is_normalized_name
    >>> is_normalized_name("requests")
    True
    >>> is_normalized_name("Django")
    False
    N)Ú_normalized_regexr3   )r+   s    r   r   r   g   s   € õ ×&Ò& tÑ,Ô,°DÐ8Ð8r   T)Ústrip_trailing_zeroÚversionúVersion | strr9   c               óÌ   — t          | t          ¦  «        r0	 t          | ¦  «        } n# t          $ r t          | ¦  «        cY S w xY wt          |rt	          | ¦  «        n| ¦  «        S )a  Return a canonical form of a version as a string.

    This function takes a string representing a package version (or a
    :class:`~packaging.version.Version` instance), and returns the
    normalized form of it. By default, it strips trailing zeros from
    the release segment.

    >>> from packaging.utils import canonicalize_version
    >>> canonicalize_version('1.0.1')
    '1.0.1'

    Per PEP 625, versions may have multiple canonical forms, differing
    only by trailing zeros.

    >>> canonicalize_version('1.0.0')
    '1'
    >>> canonicalize_version('1.0.0', strip_trailing_zero=False)
    '1.0.0'

    Invalid versions are returned unaltered.

    >>> canonicalize_version('foo bar baz')
    'foo bar baz'

    >>> canonicalize_version('1.4.0.0.0')
    '1.4'
    )Ú
isinstancer,   r   r   r   )r:   r9   s     r   r   r   w   sx   € õ< �'�3ÑÔð  ð	 Ý˜gÑ&Ô&ˆGˆGøÝð 	 ð 	 ð 	 Ý�w‘<”<ÐÐÐð	 øøøåÐ+>ÐK�˜wÑ'Ô'Ð'ÀGÑLÔLÐLs   —' §AÁA©Úvalidate_orderÚfilenamer?   ú8tuple[NormalizedName, Version, BuildTag, frozenset[Tag]]c               ó�  — |                       d¦  «        st          d| ›�¦  «        ‚| dd…         } |                      d¦  «        }|dvrt          d| ›�¦  «        ‚|                      d|dz
  ¦  «        }|d	         }d
|v s t	          j        d|t          j        ¦  «        €t          d| ›�¦  «        ‚t          |¦  «        }	 t          |d         ¦  «        }n%# t          $ r}t          d| ›�¦  «        |‚d}~ww xY w|dk    r|d         }t                               |¦  «        }	|	€t          d|› d| ›�¦  «        ‚t          dt          |	                     d¦  «        ¦  «        |	                     d¦  «        f¦  «        }
nd}
|d         }	 t          ||¬¦  «        }n!# t          $ r t          d| ›�¦  «        d‚w xY w|||
|fS )a  
    This function takes the filename of a wheel file, and parses it,
    returning a tuple of name, version, build number, and tags.

    The name part of the tuple is normalized and typed as
    :class:`NormalizedName`. The version portion is an instance of
    :class:`~packaging.version.Version`. The build number is ``()`` if
    there is no build number in the wheel filename, otherwise a
    two-item tuple of an integer for the leading digits and
    a string for the rest of the build number. The tags portion is a
    frozen set of :class:`~packaging.tags.Tag` instances (as the tag
    string format allows multiple tags to be combined into a single
    string).

    If **validate_order** is true, compressed tag set components are
    checked to be in sorted order as required by PEP 425.

    :param str filename: The name of the wheel file.
    :param bool validate_order: Check whether compressed tag set components
        are in sorted order.
    :raises InvalidWheelFilename: If the filename in question
        does not follow the :ref:`wheel specification
        <pypug:binary-distribution-format>`.

    >>> from packaging.utils import parse_wheel_filename
    >>> from packaging.tags import Tag
    >>> from packaging.version import Version
    >>> name, ver, build, tags = parse_wheel_filename("foo-1.0-py3-none-any.whl")
    >>> name
    'foo'
    >>> ver == Version('1.0')
    True
    >>> tags == {Tag("py3", "none", "any")}
    True
    >>> not build
    True

    .. versionadded:: 26.1
       The *validate_order* parameter.
    z.whlz3Invalid wheel filename (extension must be '.whl'): Néüÿÿÿr0   )é   é   z0Invalid wheel filename (wrong number of parts): é   r   Ú__z^[\w\d._]*$zInvalid project name: r   z*Invalid wheel filename (invalid version): rE   zInvalid build number: z in r   r   éÿÿÿÿr>   z\Invalid wheel filename (compressed tag set components must be in sorted order per PEP 425): )Úendswithr   ÚcountÚsplitÚreÚmatchÚUNICODEr   r   r   Ú_build_tag_regexr   ÚintÚgroupr   r
   )r@   r?   ÚdashesÚpartsÚ	name_partr+   r:   ÚeÚ
build_partÚbuild_matchÚbuildÚtag_strÚtagss                r   r   r   �   sG  € ðZ ×Ò˜VÑ$Ô$ð 
Ý"ØNÀ(ÐNÐNñ
ô 
ð 	
ð ˜˜˜Œ}€HØ�^Š^˜CÑ Ô €FØ�VÐÐÝ"ØK¸xÐKÐKñ
ô 
ð 	
ð �NŠN˜3 ¨¡
Ñ+Ô+€EØ�a”€IàˆyÐÐ�BœH ^°YÅÄ
ÑKÔKÐSÝ"Ð#H¸HÐ#HÐ#HÑIÔIÐIÝ˜YÑ'Ô'€DðÝ˜% œ(Ñ#Ô#ˆˆøÝð ð ð Ý"ØE¸ÐEÐEñ
ô 
àð	øøøøðøøøð
 �‚{€{Ø˜1”Xˆ
Ý&×,Ò,¨ZÑ8Ô8ˆØÐÝ&ØE¨ÐEÐE¸ÐEÐEñô ð õ �Z¥# k×&7Ò&7¸Ñ&:Ô&:Ñ";Ô";¸[×=NÒ=NÈqÑ=QÔ=QÐ!RÑSÔSˆˆàˆØ�BŒi€GðÝ˜°Ð@Ñ@Ô@ˆˆøÝð ð ð Ý"ð7Ø*2ð7ð 7ñ
ô 
ð ð	ðøøøð
 �'˜5 $Ð'Ð's$   ÃC Ã
C<Ã$C7Ã7C<ÆF! Æ!F?útuple[NormalizedName, Version]c                óÊ  — |                       d¦  «        r| dt          d¦  «         …         }n@|                       d¦  «        r| dt          d¦  «         …         }nt          d| ›�¦  «        ‚|                     d¦  «        \  }}}|st          d| ›�¦  «        ‚t	          |¦  «        }	 t          |¦  «        }n%# t          $ r}t          d| ›�¦  «        |‚d}~ww xY w||fS )a‘  
    This function takes the filename of a sdist file (as specified
    in the `Source distribution format`_ documentation), and parses
    it, returning a tuple of the normalized name and version as
    represented by an instance of :class:`~packaging.version.Version`.

    :param str filename: The name of the sdist file.
    :raises InvalidSdistFilename: If the filename does not end
        with an sdist extension (``.zip`` or ``.tar.gz``), or if it does not
        contain a dash separating the name and the version of the distribution.

    >>> from packaging.utils import parse_sdist_filename
    >>> from packaging.version import Version
    >>> name, ver = parse_sdist_filename("foo-1.0.tar.gz")
    >>> name
    'foo'
    >>> ver == Version('1.0')
    True

    .. _Source distribution format: https://packaging.python.org/specifications/source-distribution-format/#source-distribution-file-name
    z.tar.gzNz.zipz@Invalid sdist filename (extension must be '.tar.gz' or '.zip'): r0   zInvalid sdist filename: z*Invalid sdist filename (invalid version): )rI   Úlenr   Ú
rpartitionr   r   r   )r@   Ú	file_stemrT   ÚsepÚversion_partr+   r:   rU   s           r   r   r   ù   s.  € ð, ×Ò˜Ñ#Ô#ð 
ØÐ.¥ I¡¤˜Ð.Ô/ˆ	ˆ	Ø	×	Ò	˜6Ñ	"Ô	"ð 
Ø˜^¥ F¡¤˜|˜^Ô,ˆ	ˆ	å"ðØðð ñ
ô 
ð 	
ð $-×#7Ò#7¸Ñ#<Ô#<Ñ €Iˆs�LØð LÝ"Ð#J¸hÐ#JÐ#JÑKÔKÐKå˜YÑ'Ô'€DðÝ˜,Ñ'Ô'ˆˆøÝð ð ð Ý"ØE¸ÐEÐEñ
ô 
àð	øøøøðøøøð
 �'ˆ?Ðs   Â,B< Â<
CÃCÃC)r   r   )r+   r,   r*   r-   r   r   )r+   r,   r   r-   )r:   r;   r9   r-   r   r,   )r@   r,   r?   r-   r   rA   )r@   r,   r   r[   )%Ú
__future__r   rL   Útypingr   r   r   r   rZ   r	   r
   r   r:   r   r   r   r   r    rP   r,   r   r   Ú
ValueErrorr   r   r   ÚcompileÚ
IGNORECASEÚASCIIr2   r8   rO   r   r   r   r   r   r   r   r   ú<module>rh      sV  ðð
 #Ð "Ð "Ð "Ð "Ð "à 	€	€	€	Ø .Ð .Ð .Ð .Ð .Ð .Ð .Ð .Ð .Ð .Ð .Ð .à 3Ð 3Ð 3Ð 3Ð 3Ð 3Ð 3Ð 3Ð 3Ð 3Ø =Ð =Ð =Ð =Ð =Ð =Ð =Ð =Ð =Ð =ðð ð €ðð ð ð ð ��r”˜E # s (œOÐ+Ô,€à�Ð)¨3Ñ/Ô/€ðð
ð ð ð ð �*ñ ô ð ðð ð ð ð ˜:ñ ô ð ðð ð ð ð ˜:ñ ô ð ð �"”*Ø,¨b¬m¸b¼hÑ.Fñô €ð �B”JÐMÈrÌxÑXÔXÐ à�2”:˜l¨B¬HÑ5Ô5Ð ð 6;ð ")ð ")ð ")ð ")ð ")ð ")ðJ9ð 9ð 9ð 9ð" <@ð#Mð #Mð #Mð #Mð #Mð #MðR !ðY(ð Y(ð Y(ð Y(ð Y(ð Y(ðx/ð /ð /ð /ð /ð /r   