ó
    ÷Þ j·/  ã                  ó@  • S SK Jr  S SKrS SKJrJrJr  SSKJrJ	r	J
r
Jr  SSKJrJrJr  / SQrSS jr\\S	   \\\4   4   r \" S
\5      r  " S S\5      r " S S\5      r " S S\5      r\R6                  " S\R8                  \R:                  -  5      r\R6                  " S\R:                  5      r\R6                  " S\R:                  5      r \R6                  " S\RB                  5      r"SS.S S jjr#S!S jr$SS.     S"S jjr%SS.     S#S jjr&S$S jr'g)%é    )ÚannotationsN)ÚNewTypeÚUnionÚcasté   )Ú
InvalidTagÚTagÚUnsortedTagsErrorÚ	parse_tag)ÚInvalidVersionÚVersionÚ_TrimmedRelease)
ÚBuildTagÚInvalidNameÚInvalidSdistFilenameÚInvalidWheelFilenameÚNormalizedNameÚcanonicalize_nameÚcanonicalize_versionÚis_normalized_nameÚparse_sdist_filenameÚparse_wheel_filenamec                 ó   • [         $ )N)Ú__all__© ó    ÚI/var/www/html/gaurav/venv/lib/python3.13/site-packages/packaging/utils.pyÚ__dir__r      s   € Ü€Nr   r   r   c                  ó   • \ rS rSrSrSrg)r   é.   zg
An invalid distribution name; users should refer to the packaging user guide.

.. versionadded:: 23.2
r   N©Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__Ú__static_attributes__r   r   r   r   r   .   ó   † ôr   r   c                  ó   • \ rS rSrSrSrg)r   é6   z]
An invalid wheel filename was found, users should refer to PEP 427.

.. versionadded:: 20.9
r   Nr!   r   r   r   r   r   6   r(   r   r   c                  ó   • \ rS rSrSrSrg)r   é>   zn
An invalid sdist filename was found, users should refer to the packaging user guide.

.. versionadded:: 20.9
r   Nr!   r   r   r   r   r   >   r(   r   r   z%[a-z0-9]|[a-z0-9][a-z0-9._-]*[a-z0-9]z[a-z0-9]+(?:-[a-z0-9]+)*z	(\d+)(.*)z
^[\w._]+\ZF)Úvalidatec               ó  • U(       a)  [         R                  U 5      (       d  [        SU < 35      eU R                  5       R	                  SS5      R	                  SS5      nSU;   a  UR	                  SS5      nSU;   a  M  [        SU5      $ )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'

.. versionadded:: 16.2

.. versionchanged:: 20.4
   The return type was changed to :class:`NormalizedName`.

.. versionchanged:: 23.2
   Added the *validate* keyword parameter.
zname is invalid: Ú_Ú-Ú.z--r   )Ú_validate_regexÚ	fullmatchr   ÚlowerÚreplacer   )Únamer-   Úvalues      r   r   r   R   s€   € öB œ×1Ñ1°$×7Ñ7ÜÐ-¨d©XÐ6Ó7Ð7ð �J‰J‹L× Ñ   cÓ*×2Ñ2°3¸Ó<€Eà
�%‹-Ø—‘˜d CÓ(ˆð �%�-äÐ  %Ó(Ð(r   c                ó0   • [         R                  U 5      SL$ )aí  
Check if a name is a normalized project name (i.e. a valid name that
:func:`canonicalize_name` would roundtrip to the same value).

The roundtrip only characterizes normalized names for *valid* names. A name
must start and end with an ASCII letter or digit, which
:func:`canonicalize_name` does not enforce: it leaves a leading or trailing
hyphen in place, so such a name roundtrips without being normalized.

:param str name: The name to check.

>>> from packaging.utils import canonicalize_name, is_normalized_name
>>> is_normalized_name("requests")
True
>>> is_normalized_name("Django")
False
>>> canonicalize_name("_not_legal")
'-not-legal'
>>> is_normalized_name("-not-legal")  # roundtrips, but not a valid name
False

.. versionadded:: 23.2
N)Ú_normalized_regexr3   )r6   s    r   r   r      s   € ô0 ×&Ñ& tÓ,°DÐ8Ð8r   T)Ústrip_trailing_zeroc               ó¼   • [        U [        5      (       a   [        U 5      n [        U(       a  [	        U 5      5      $ U 5      $ ! [         a    [        U 5      s $ f = f)as  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'

.. versionadded:: 17.1

.. versionchanged:: 21.0
   The return type was narrowed to :class:`str`.

.. versionchanged:: 22.0
   Added the *strip_trailing_zero* keyword parameter.
)Ú
isinstanceÚstrr   r   r   )Úversionr:   s     r   r   r   š   sY   € ôL �'œ3×Ñð	 Ü˜gÓ&ˆGô Ö+>Œ˜wÓ'ÓLÐLÀGÓLÐLøô ó 	 Ü�w“<Òð	 ús   —A ÁAÁA©Úvalidate_orderc               ó  • U R                  S5      (       d  [        SU < 35      eU SS n U R                  S5      nUS;  a  [        SU < 35      eU R                  SUS-
  5      nUS	   nS
U;   d  [        R                  U5      c  [        SU < 35      e[        U5      n [        US   5      nUS:X  ae  US   n[        R                  U5      n	U	c  [        SU SU < 35      e[        S[        U	R                  S5      5      U	R                  S5      45      n
OSn
US   n [        X±S9nXVX¬4$ ! [         a  n[        SU < 35      UeSnAff = f! [         a    [        SU < 35      Se[         a    [        SU < 35      Sef = f)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:: 20.9

.. versionchanged:: 23.2
   Raises :class:`InvalidWheelFilename` when the version component is invalid.

.. versionadded:: 26.1
   The *validate_order* parameter.

.. versionchanged:: 26.3
   Raises :class:`InvalidWheelFilename` when an interpreter component is
   not an identifier, a tag set component is empty, or the project name is
   empty.
z.whlz3Invalid wheel filename (extension must be '.whl'): Néüÿÿÿr0   )é   é   z0Invalid wheel filename (wrong number of parts): é   r   Ú__zInvalid project name: r   z*Invalid wheel filename (invalid version): rD   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): z0Invalid wheel filename (invalid tag component): )Úendswithr   ÚcountÚsplitÚ_wheel_name_regexÚmatchr   r   r   Ú_build_tag_regexr   ÚintÚgroupr   r
   r   )Úfilenamer@   ÚdashesÚpartsÚ	name_partr6   r>   ÚeÚ
build_partÚbuild_matchÚbuildÚtag_strÚtagss                r   r   r   È   sí  € ðn ×Ñ˜V×$Ñ$Ü"ØAÀ(ÁÐNó
ð 	
ð ˜˜ˆ}€HØ�^‰^˜CÓ €FØ�VÓÜ"Ø>¸x¹lÐKó
ð 	
ð �N‰N˜3 ¨¡
Ó+€EØ�a‘€IàˆyÓÔ-×3Ñ3°IÓ>ÑFÜ"Ð%;¸H¹<Ð#HÓIÐIÜ˜YÓ'€DðÜ˜% ™(Ó#ˆð �ƒ{Ø˜1‘Xˆ
Ü&×,Ñ,¨ZÓ8ˆØÑÜ&Ø(¨¨°D¸¹ÐEóð ô �Z¤# k×&7Ñ&7¸Ó&:Ó";¸[×=NÑ=NÈqÓ=QÐ!RÓS‰àˆØ�B‰i€Gð
Ü˜Ñ@ˆð ˜5Ð'Ð'øô7 ó Ü"Ø8¸¹ÐEó
àð	ûðûô$ ó Ü"ð*Ø*2©ð7ó
ð ð	ô ó Ü"Ø>¸x¹lÐKó
àð	ðús$   Â"D0 Ä#	E Ä0
EÄ:E
Å
EÅ4Fc                ó°  • U R                  S5      (       a  U S[        S5      *  nO5U R                  S5      (       a  U S[        S5      *  nO[        SU < 35      eUR                  S5      u  p#nU(       d  [        SU < 35      eU(       d  [        SU < 35      e[	        U5      n [        U5      nXV4$ ! [         a  n[        SU < 35      UeSnAff = f)	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``), if it does not
    contain a dash separating the name and the version of the distribution,
    if the project name is empty, or if the version portion is not a valid
    version.

>>> 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

.. versionadded:: 20.9

.. versionchanged:: 21.0
   Added support for ``.zip`` source distributions.

.. versionchanged:: 23.2
   Raises :class:`InvalidSdistFilename` when the version component is invalid.

.. versionchanged:: 26.3
   Raises :class:`InvalidSdistFilename` on an empty project name.

.. _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 (empty project name): z*Invalid sdist filename (invalid version): )rH   Úlenr   Ú
rpartitionr   r   r   )rP   Ú	file_stemrS   ÚsepÚversion_partr6   r>   rT   s           r   r   r   2  s   € ðF ×Ñ˜×#Ñ#ØÐ.¤ I£˜Ð/‰	Ø	×	Ñ	˜6×	"Ñ	"Ø˜^¤ F£˜|Ð,‰	ä"ðØ‰|ðó
ð 	
ð $-×#7Ñ#7¸Ó#<Ñ €I�LÞÜ"Ð%=¸h¹\Ð#JÓKÐKÞÜ"Ø;¸H¹<ÐHó
ð 	
ô ˜YÓ'€DðÜ˜,Ó'ˆð ˆ?Ðøô ó Ü"Ø8¸¹ÐEó
àð	ûðús   Â(B6 Â6
CÃ CÃC)Úreturnz	list[str])r6   r=   r-   Úboolr`   r   )r6   r=   r`   ra   )r>   zVersion | strr:   ra   r`   r=   )rP   r=   r@   ra   r`   z8tuple[NormalizedName, Version, BuildTag, frozenset[Tag]])rP   r=   r`   ztuple[NormalizedName, Version])(Ú
__future__r   ÚreÚtypingr   r   r   rY   r   r	   r
   r   r>   r   r   r   r   r   ÚtuplerN   r=   r   r   Ú
ValueErrorr   r   r   ÚcompileÚ
IGNORECASEÚASCIIr2   r9   rM   ÚUNICODErK   r   r   r   r   r   r   r   r   Ú<module>rk      sT  ðõ
 #ã 	ß 'Ñ 'ç ?Ó ?ß =Ñ =ò€ôð ��r‘˜E # s (™OÐ+Ñ,€ðñ Ð)¨3Ó/€ðô�*ô ô˜:ô ô˜:ô ð —*’*Ø,¨b¯m©m¸b¿h¹hÑ.Fó€ð —J’JÐ:¸B¿H¹HÓEÐ à—:’:˜l¨B¯H©HÓ5Ð ð —J’J˜}¨b¯j©jÓ9Ð ð 6;÷ *)ôZ9ð8 <@ñ+MØð+MØ48ð+Màõ+Mðb !ñg(Øðg(ð ðg(ð >õ	g(õT@r   