Ë
    •2Úib›  ã            	       ó¨  — d Z ddlZddlZddlZddlmZmZmZmZm	Z	m
Z
mZmZ ddlmZ ddlmZ eeef   Z ede¬«      Zeeegef   Zd	ed
efd„Z G d„ de«      Z G d„ dej2                  ¬«      Z G d„ de«      Z ej8                  d«      Zd	ed
ee   fd„Zdee   d
efd„Zded
efd„Z dee   dee   d
e
ee   ee   f   fd„Z! G d„ de«      Z"y)zŠ
.. testsetup::

    from packaging.specifiers import Specifier, SpecifierSet, InvalidSpecifier
    from packaging.version import Version
é    N)ÚCallableÚIterableÚIteratorÚListÚOptionalÚTupleÚTypeVarÚUnioné   )Úcanonicalize_version)ÚVersionÚUnparsedVersionVar)ÚboundÚversionÚreturnc                 ó<   — t        | t        «      st        | «      } | S ©N)Ú
isinstancer   )r   s    úZ/var/www/html/acx/venv/lib/python3.12/site-packages/wheel/vendored/packaging/specifiers.pyÚ_coerce_versionr      s   € Ü�gœwÔ'Ü˜'Ó"ˆØ€Nó    c                   ó   — e Zd ZdZy)ÚInvalidSpecifiera  
    Raised when attempting to create a :class:`Specifier` with a specifier
    string that is invalid.

    >>> Specifier("lolwat")
    Traceback (most recent call last):
        ...
    packaging.specifiers.InvalidSpecifier: Invalid specifier: 'lolwat'
    N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__© r   r   r   r      s   „ òr   r   c            	       óx  — e Zd Zej                  defd„«       Zej                  defd„«       Zej                  de	de
fd„«       Zeej                  dee
   fd„«       «       Zej                  de
ddfd	„«       Zej                  dd
edee
   de
fd„«       Zej                  	 ddee   dee
   dee   fd„«       Zy)ÚBaseSpecifierr   c                  ó   — y)zŽ
        Returns the str representation of this Specifier-like object. This
        should be representative of the Specifier itself.
        Nr   ©Úselfs    r   Ú__str__zBaseSpecifier.__str__+   ó   � r   c                  ó   — y)zF
        Returns a hash value for this Specifier-like object.
        Nr   r"   s    r   Ú__hash__zBaseSpecifier.__hash__2   r%   r   Úotherc                  ó   — y)z«
        Returns a boolean representing whether or not the two Specifier-like
        objects are equal.

        :param other: The other object to check against.
        Nr   ©r#   r(   s     r   Ú__eq__zBaseSpecifier.__eq__8   r%   r   c                  ó   — y)zîWhether or not pre-releases as a whole are allowed.

        This can be set to either ``True`` or ``False`` to explicitly enable or disable
        prereleases or it can be set to ``None`` (the default) to use default semantics.
        Nr   r"   s    r   ÚprereleaseszBaseSpecifier.prereleasesA   r%   r   ÚvalueNc                  ó   — y)zQSetter for :attr:`prereleases`.

        :param value: The value to set.
        Nr   ©r#   r.   s     r   r-   zBaseSpecifier.prereleasesJ   r%   r   Úitemr-   c                  ó   — y)zR
        Determines if the given item is contained within this specifier.
        Nr   )r#   r1   r-   s      r   ÚcontainszBaseSpecifier.containsQ   r%   r   Úiterablec                  ó   — y)z•
        Takes an iterable of items and filters them so that only items which
        are contained within this specifier are allowed in it.
        Nr   )r#   r4   r-   s      r   ÚfilterzBaseSpecifier.filterW   r%   r   r   )r   r   r   ÚabcÚabstractmethodÚstrr$   Úintr'   ÚobjectÚboolr+   Úpropertyr   r-   Úsetterr3   r   r   r   r6   r   r   r   r    r    *   s7  „ Ø×Ñð˜ò ó ðð 	×Ñð˜#ò ó ðð
 	×Ñð˜Fð  tò ó ðð Ø×Ñð˜X d™^ò ó ó ðð ×Ñð ð ¨$ò ó ðð 	×Ññ˜Sð ¨x¸©~ð Èò ó ðð
 	×ÑàTXñØ Ð!3Ñ4ðØCKÈDÁ>ðà	Ð$Ñ	%òó ñr   r    )Ú	metaclassc            	       ó†  — e Zd ZdZdZdZ ej                  dez   ez   dz   ej                  ej                  z  «      Z
dddd	d
ddddœZd0dedee   ddfd„Zedefd„«       Zej$                  deddfd„«       Zedefd„«       Zedefd„«       Zdefd„Zdefd„Zedeeef   fd„«       Zdefd„Zdedefd„Zdedefd „Zd!ededefd"„Z d!ededefd#„Z!d!ededefd$„Z"d!ededefd%„Z#d!ededefd&„Z$d!ed'edefd(„Z%d!ed'edefd)„Z&d!ededefd*„Z'd+e(eef   defd,„Z)	 d1d+e*dee   defd-„Z+	 d1d.e,e-   dee   de.e-   fd/„Z/y)2Ú	Specifiera?  This class abstracts handling of version specifiers.

    .. tip::

        It is generally not required to instantiate this manually. You should instead
        prefer to work with :class:`SpecifierSet` instead, which can parse
        comma-separated version specifiers (which is what package metadata contains).
    z8
        (?P<operator>(~=|==|!=|<=|>=|<|>|===))
        aÈ  
        (?P<version>
            (?:
                # The identity operators allow for an escape hatch that will
                # do an exact string match of the version you wish to install.
                # This will not be parsed by PEP 440 and we cannot determine
                # any semantic meaning from it. This operator is discouraged
                # but included entirely as an escape hatch.
                (?<====)  # Only match for the identity operator
                \s*
                [^\s;)]*  # The arbitrary version can be just about anything,
                          # we match everything except for whitespace, a
                          # semi-colon for marker support, and a closing paren
                          # since versions can be enclosed in them.
            )
            |
            (?:
                # The (non)equality operators allow for wild card and local
                # versions to be specified so we have to define these two
                # operators separately to enable that.
                (?<===|!=)            # Only match for equals and not equals

                \s*
                v?
                (?:[0-9]+!)?          # epoch
                [0-9]+(?:\.[0-9]+)*   # release

                # You cannot use a wild card and a pre-release, post-release, a dev or
                # local version together so group them with a | and make them optional.
                (?:
                    \.\*  # Wild card syntax of .*
                    |
                    (?:                                  # pre release
                        [-_\.]?
                        (alpha|beta|preview|pre|a|b|c|rc)
                        [-_\.]?
                        [0-9]*
                    )?
                    (?:                                  # post release
                        (?:-[0-9]+)|(?:[-_\.]?(post|rev|r)[-_\.]?[0-9]*)
                    )?
                    (?:[-_\.]?dev[-_\.]?[0-9]*)?         # dev release
                    (?:\+[a-z0-9]+(?:[-_\.][a-z0-9]+)*)? # local
                )?
            )
            |
            (?:
                # The compatible operator requires at least two digits in the
                # release segment.
                (?<=~=)               # Only match for the compatible operator

                \s*
                v?
                (?:[0-9]+!)?          # epoch
                [0-9]+(?:\.[0-9]+)+   # release  (We have a + instead of a *)
                (?:                   # pre release
                    [-_\.]?
                    (alpha|beta|preview|pre|a|b|c|rc)
                    [-_\.]?
                    [0-9]*
                )?
                (?:                                   # post release
                    (?:-[0-9]+)|(?:[-_\.]?(post|rev|r)[-_\.]?[0-9]*)
                )?
                (?:[-_\.]?dev[-_\.]?[0-9]*)?          # dev release
            )
            |
            (?:
                # All other operators only allow a sub set of what the
                # (non)equality operators do. Specifically they do not allow
                # local versions to be specified nor do they allow the prefix
                # matching wild cards.
                (?<!==|!=|~=)         # We have special cases for these
                                      # operators so we want to make sure they
                                      # don't match here.

                \s*
                v?
                (?:[0-9]+!)?          # epoch
                [0-9]+(?:\.[0-9]+)*   # release
                (?:                   # pre release
                    [-_\.]?
                    (alpha|beta|preview|pre|a|b|c|rc)
                    [-_\.]?
                    [0-9]*
                )?
                (?:                                   # post release
                    (?:-[0-9]+)|(?:[-_\.]?(post|rev|r)[-_\.]?[0-9]*)
                )?
                (?:[-_\.]?dev[-_\.]?[0-9]*)?          # dev release
            )
        )
        z^\s*z\s*$Ú
compatibleÚequalÚ	not_equalÚless_than_equalÚgreater_than_equalÚ	less_thanÚgreater_thanÚ	arbitrary)ú~=ú==z!=ú<=ú>=ú<ú>ú===NÚspecr-   r   c                 óð   — | j                   j                  |«      }|st        d|› d�«      ‚|j                  d«      j	                  «       |j                  d«      j	                  «       f| _        || _        y)að  Initialize a Specifier instance.

        :param spec:
            The string representation of a specifier which will be parsed and
            normalized before use.
        :param prereleases:
            This tells the specifier if it should accept prerelease versions if
            applicable or not. The default of ``None`` will autodetect it from the
            given specifiers.
        :raises InvalidSpecifier:
            If the given specifier is invalid (i.e. bad syntax).
        zInvalid specifier: 'ú'Úoperatorr   N)Ú_regexÚsearchr   ÚgroupÚstripÚ_specÚ_prereleases)r#   rQ   r-   Úmatchs       r   Ú__init__zSpecifier.__init__Ü   so   € ð —‘×"Ñ" 4Ó(ˆÙÜ"Ð%9¸$¸¸qÐ#AÓBÐBð �K‰K˜
Ó#×)Ñ)Ó+Ø�K‰K˜	Ó"×(Ñ(Ó*ð'
ˆŒ
ð (ˆÕr   c                 ó¼   — | j                   �| j                   S | j                  \  }}|dv r1|dk(  r|j                  d«      r|d d }t        |«      j                  ryy)N)rK   rM   rL   rJ   rP   rK   ú.*éþÿÿÿTF)rZ   rY   Úendswithr   Úis_prerelease)r#   rT   r   s      r   r-   zSpecifier.prereleasesö   sm   € ð ×ÑÐ(Ø×$Ñ$Ð$ð
 !ŸJ™JÑˆ�'ØÐ6Ñ6ð ˜4Ò G×$4Ñ$4°TÔ$:Ø! # 2˜,�ô �wÓ×-Ò-Øàr   r.   c                 ó   — || _         y r   ©rZ   r0   s     r   r-   zSpecifier.prereleases  ó
   € à!ˆÕr   c                 ó    — | j                   d   S )z`The operator of this specifier.

        >>> Specifier("==1.2.3").operator
        '=='
        r   ©rY   r"   s    r   rT   zSpecifier.operator  ó   € ð �z‰z˜!‰}Ðr   c                 ó    — | j                   d   S )zaThe version of this specifier.

        >>> Specifier("==1.2.3").version
        '1.2.3'
        r   rf   r"   s    r   r   zSpecifier.version  rg   r   c                 óŒ   — | j                   �d| j                  ›�nd}d| j                  j                  › dt	        | «      ›|› d�S )aT  A representation of the Specifier that shows all internal state.

        >>> Specifier('>=1.0.0')
        <Specifier('>=1.0.0')>
        >>> Specifier('>=1.0.0', prereleases=False)
        <Specifier('>=1.0.0', prereleases=False)>
        >>> Specifier('>=1.0.0', prereleases=True)
        <Specifier('>=1.0.0', prereleases=True)>
        ú, prereleases=Ú rN   ú(ú)>)rZ   r-   Ú	__class__r   r9   ©r#   Úpres     r   Ú__repr__zSpecifier.__repr__$  sU   € ð × Ñ Ð,ð ˜T×-Ñ-Ð0Ñ1àð 	ð �4—>‘>×*Ñ*Ð+¨1¬S°«Y¨M¸#¸¸bÐAÐAr   c                 ó4   —  dj                   | j                  Ž S )zÐA string representation of the Specifier that can be round-tripped.

        >>> str(Specifier('>=1.0.0'))
        '>=1.0.0'
        >>> str(Specifier('>=1.0.0', prereleases=False))
        '>=1.0.0'
        z{}{})ÚformatrY   r"   s    r   r$   zSpecifier.__str__6  s   € ð ˆv�}‰}˜dŸj™jÐ)Ð)r   c                 óx   — t        | j                  d   | j                  d   dk7  ¬«      }| j                  d   |fS )Nr   r   rJ   ©Ústrip_trailing_zero)r   rY   )r#   Úcanonical_versions     r   Ú_canonical_speczSpecifier._canonical_spec@  s>   € ä0Ø�J‰J�q‰MØ!%§¡¨A¡°$Ñ!6ô
Ðð �z‰z˜!‰}Ð/Ð/Ð/r   c                 ó,   — t        | j                  «      S r   )Úhashrx   r"   s    r   r'   zSpecifier.__hash__H  s   € Ü�D×(Ñ(Ó)Ð)r   r(   c                 óî   — t        |t        «      r	 | j                  t        |«      «      }nt        || j                  «      st        S | j
                  |j
                  k(  S # t        $ r	 t        cY S w xY w)a>  Whether or not the two Specifier-like objects are equal.

        :param other: The other object to check against.

        The value of :attr:`prereleases` is ignored.

        >>> Specifier("==1.2.3") == Specifier("== 1.2.3.0")
        True
        >>> (Specifier("==1.2.3", prereleases=False) ==
        ...  Specifier("==1.2.3", prereleases=True))
        True
        >>> Specifier("==1.2.3") == "==1.2.3"
        True
        >>> Specifier("==1.2.3") == Specifier("==1.2.4")
        False
        >>> Specifier("==1.2.3") == Specifier("~=1.2.3")
        False
        )r   r9   rn   r   ÚNotImplementedrx   r*   s     r   r+   zSpecifier.__eq__K  si   € ô& �eœSÔ!ð&ØŸ™¤s¨5£zÓ2‘ô ˜E 4§>¡>Ô2Ü!Ð!à×#Ñ# u×'<Ñ'<Ñ<Ð<øô $ò &Ü%Ò%ð&ús   ’A" Á"A4Á3A4Úopc                 ó>   — t        | d| j                  |   › �«      }|S )NÚ	_compare_)ÚgetattrÚ
_operators)r#   r}   Úoperator_callables      r   Ú_get_operatorzSpecifier._get_operatorh  s+   € Ü.5Ø�I˜dŸo™o¨bÑ1Ð2Ð3ó/
Ðð !Ð r   Úprospectivec           
      óà   — t        t        t        j                  t        t        |«      «      «      d d «      }|dz  } | j                  d«      ||«      xr  | j                  d«      ||«      S )Néÿÿÿÿr^   rM   rK   )Ú_version_joinÚlistÚ	itertoolsÚ	takewhileÚ_is_not_suffixÚ_version_splitrƒ   )r#   r„   rQ   Úprefixs       r   Ú_compare_compatiblezSpecifier._compare_compatiblen  sw   € ô Ü”×$Ñ$¤^´^ÀDÓ5IÓJÓKÈCÈRÐPó
ˆð
 	�$‰ˆà'ˆt×!Ñ! $Ó'¨°TÓ:ò 
Ð?W¸t×?QÑ?QÐRVÓ?WØ˜ó@
ð 	
r   c                 óD  — |j                  d«      r_t        |j                  d¬«      }t        |d d d¬«      }t        |«      }t        |«      }t	        ||«      \  }}|d t        |«       }	|	|k(  S t        |«      }
|
j                  st        |j                  «      }||
k(  S )Nr^   Fru   r_   )r`   r   ÚpublicrŒ   Ú_pad_versionÚlenr   Úlocal)r#   r„   rQ   Únormalized_prospectiveÚnormalized_specÚ
split_specÚsplit_prospectiveÚpadded_prospectiveÚ_Úshortened_prospectiveÚspec_versions              r   Ú_compare_equalzSpecifier._compare_equal‚  s¸   € à�=‰=˜Ôä%9Ø×"Ñ"¸ô&Ð"ô 3°4¸¸°9ÐRWÔXˆOô (¨Ó8ˆJô
 !/Ð/EÓ FÐô %1Ð1BÀJÓ$OÑ!Ð ð
 %7Ð7H¼¸Z»Ð$IÐ!à(¨JÑ6Ð6ô # 4›=ˆLð
  ×%Ò%Ü% k×&8Ñ&8Ó9�à ,Ñ.Ð.r   c                 ó(   — | j                  ||«       S r   )rœ   ©r#   r„   rQ   s      r   Ú_compare_not_equalzSpecifier._compare_not_equalª  s   € Ø×&Ñ& {°DÓ9Ð9Ð9r   c                 óD   — t        |j                  «      t        |«      k  S r   ©r   r�   rž   s      r   Ú_compare_less_than_equalz"Specifier._compare_less_than_equal­  ó   € ô �{×)Ñ)Ó*¬g°d«mÑ;Ð;r   c                 óD   — t        |j                  «      t        |«      k\  S r   r¡   rž   s      r   Ú_compare_greater_than_equalz%Specifier._compare_greater_than_equal³  r£   r   Úspec_strc                 ó®   — t        |«      }||k  sy|j                  s8|j                  r,t        |j                  «      t        |j                  «      k(  ryy©NFT)r   ra   Úbase_version©r#   r„   r¦   rQ   s       r   Ú_compare_less_thanzSpecifier._compare_less_than¹  sT   € ô �xÓ ˆð
 ˜TÒ!Øð ×!Ò! k×&?Ò&?Ü�{×/Ñ/Ó0´G¸D×<MÑ<MÓ4NÒNØð
 r   c                 ó  — t        |«      }||kD  sy|j                  s8|j                  r,t        |j                  «      t        |j                  «      k(  ry|j                  �,t        |j                  «      t        |j                  «      k(  ryyr¨   )r   Úis_postreleaser©   r“   rª   s       r   Ú_compare_greater_thanzSpecifier._compare_greater_thanÑ  sƒ   € ô �xÓ ˆð
 ˜TÒ!Øð ×"Ò" {×'AÒ'AÜ�{×/Ñ/Ó0´G¸D×<MÑ<MÓ4NÒNØð ×ÑÐ(Ü�{×/Ñ/Ó0´G¸D×<MÑ<MÓ4NÒNØð
 r   c                 óh   — t        |«      j                  «       t        |«      j                  «       k(  S r   )r9   Úlowerrž   s      r   Ú_compare_arbitraryzSpecifier._compare_arbitraryï  s&   € Ü�;Ó×%Ñ%Ó'¬3¨t«9¯?©?Ó+<Ñ<Ð<r   r1   c                 ó$   — | j                  |«      S )a;  Return whether or not the item is contained in this specifier.

        :param item: The item to check for.

        This is used for the ``in`` operator and behaves the same as
        :meth:`contains` with no ``prereleases`` argument passed.

        >>> "1.2.3" in Specifier(">=1.2.3")
        True
        >>> Version("1.2.3") in Specifier(">=1.2.3")
        True
        >>> "1.0.0" in Specifier(">=1.2.3")
        False
        >>> "1.3.0a1" in Specifier(">=1.2.3")
        False
        >>> "1.3.0a1" in Specifier(">=1.2.3", prereleases=True)
        True
        ©r3   ©r#   r1   s     r   Ú__contains__zSpecifier.__contains__ò  ó   € ð& �}‰}˜TÓ"Ð"r   c                 ó®   — |€| j                   }t        |«      }|j                  r|sy| j                  | j                  «      } ||| j
                  «      S )al  Return whether or not the item is contained in this specifier.

        :param item:
            The item to check for, which can be a version string or a
            :class:`Version` instance.
        :param prereleases:
            Whether or not to match prereleases with this Specifier. If set to
            ``None`` (the default), it uses :attr:`prereleases` to determine
            whether or not prereleases are allowed.

        >>> Specifier(">=1.2.3").contains("1.2.3")
        True
        >>> Specifier(">=1.2.3").contains(Version("1.2.3"))
        True
        >>> Specifier(">=1.2.3").contains("1.0.0")
        False
        >>> Specifier(">=1.2.3").contains("1.3.0a1")
        False
        >>> Specifier(">=1.2.3", prereleases=True).contains("1.3.0a1")
        True
        >>> Specifier(">=1.2.3").contains("1.3.0a1", prereleases=True)
        True
        F)r-   r   ra   rƒ   rT   r   )r#   r1   r-   Únormalized_itemr‚   s        r   r3   zSpecifier.contains  sY   € ð8 ÐØ×*Ñ*ˆKô *¨$Ó/ˆð
 ×(Ò(±Øð /3×.@Ñ.@ÀÇÁÓ.OÐÙ  °$·,±,Ó?Ð?r   r4   c              #   óö   K  — d}g }d|�|ndi}|D ]S  }t        |«      } | j                  |fi |¤ŽsŒ"|j                  r |s| j                  s|j	                  |«       ŒNd}|–— ŒU |s|r|D ]  }|–— Œ yyy­w)aO  Filter items in the given iterable, that match the specifier.

        :param iterable:
            An iterable that can contain version strings and :class:`Version` instances.
            The items in the iterable will be filtered according to the specifier.
        :param prereleases:
            Whether or not to allow prereleases in the returned iterator. If set to
            ``None`` (the default), it will be intelligently decide whether to allow
            prereleases or not (based on the :attr:`prereleases` attribute, and
            whether the only versions matching are prereleases).

        This method is smarter than just ``filter(Specifier().contains, [...])``
        because it implements the rule from :pep:`440` that a prerelease item
        SHOULD be accepted if no other versions match the given specifier.

        >>> list(Specifier(">=1.2.3").filter(["1.2", "1.3", "1.5a1"]))
        ['1.3']
        >>> list(Specifier(">=1.2.3").filter(["1.2", "1.2.3", "1.3", Version("1.4")]))
        ['1.2.3', '1.3', <Version('1.4')>]
        >>> list(Specifier(">=1.2.3").filter(["1.2", "1.5a1"]))
        ['1.5a1']
        >>> list(Specifier(">=1.2.3").filter(["1.3", "1.5a1"], prereleases=True))
        ['1.3', '1.5a1']
        >>> list(Specifier(">=1.2.3", prereleases=True).filter(["1.3", "1.5a1"]))
        ['1.3', '1.5a1']
        Fr-   NT)r   r3   ra   r-   Úappend)r#   r4   r-   ÚyieldedÚfound_prereleasesÚkwr   Úparsed_versions           r   r6   zSpecifier.filter5  s¥   è ø€ ð< ˆØÐà¨KÐ,C™[ÈÐNˆð  ò 	"ˆGÜ,¨WÓ5ˆNàˆt�}‰}˜^Ñ2¨rÓ2ð "×/Ò/Ù 4×#3Ò#3à%×,Ñ,¨WÕ5ð #�GØ!“Mð	"ñ( Ñ,Ø,ò �Ø“ñð -ˆwùs   ‚0A9³AA9©rk   Nr   )0r   r   r   r   Ú_operator_regex_strÚ_version_regex_strÚreÚcompileÚVERBOSEÚ
IGNORECASErU   r�   r9   r   r<   r\   r=   r-   r>   rT   r   rq   r$   r   rx   r:   r'   r;   r+   ÚCallableOperatorrƒ   r   rŽ   rœ   rŸ   r¢   r¥   r«   r®   r±   r
   rµ   ÚUnparsedVersionr3   r   r   r   r6   r   r   r   rA   rA   a   sÅ  „ ñðÐð\Ðð| ˆR�Z‰ZØÐ%Ñ%Ð(:Ñ:¸WÑDØ
�
‰
�R—]‘]Ñ"ó€Fð ØØØØ"ØØØñ	€Jñ(˜Sð (°H¸T±Nð (Èdó (ð4 ð˜Tò ó ðð. ×Ñð" ð "¨$ò "ó ð"ð ð˜#ò ó ðð ð˜ò ó ððB˜#ó Bð$*˜ó *ð ð0  s¨C x¡ò 0ó ð0ð*˜#ó *ð=˜Fð = tó =ð:! ð !Ð(8ó !ð
¨wð 
¸cð 
Àdó 
ð(&/¨'ð &/¸ð &/Àó &/ðP:¨gð :¸Sð :ÀTó :ð<°Gð <À3ð <È4ó <ð<°wð <Àcð <Èdó <ð¨gð Àð Èó ð0°ð ÀCð ÈDó ð<=¨gð =¸Sð =ÀTó =ð#  s¨G |Ñ!4ð #¸ó #ð, DHñ,@Ø#ð,@Ø2:¸4±.ð,@à	ó,@ð^ UYñ;Ø Ð!3Ñ4ð;ØCKÈDÁ>ð;à	Ð$Ñ	%ô;r   rA   z^([0-9]+)((?:a|b|c|rc)[0-9]+)$c                 ó  — g }| j                  d«      \  }}}|j                  |xs d«       |j                  d«      D ]J  }t        j	                  |«      }|r |j                  |j                  «       «       Œ:|j                  |«       ŒL |S )a  Split version into components.

    The split components are intended for version comparison. The logic does
    not attempt to retain the original version string, so joining the
    components back with :func:`_version_join` may not produce the original
    version string.
    ú!Ú0ú.)Ú
rpartitionrº   ÚsplitÚ_prefix_regexrV   ÚextendÚgroups)r   ÚresultÚepochr™   Úrestr1   r[   s          r   rŒ   rŒ   v  s~   € ð €Fà×'Ñ'¨Ó,�N€Eˆ1ˆdØ
‡M�M�%’,˜3Ôà—
‘
˜3“ò  ˆÜ×$Ñ$ TÓ*ˆÙØ�M‰M˜%Ÿ,™,›.Õ)à�M‰M˜$Õð ð €Mr   Ú
componentsc                 ó6   — | ^}}|› ddj                  |«      › �S )zñJoin split version components into a version string.

    This function assumes the input came from :func:`_version_split`, where the
    first component must be the epoch (either empty or numeric), and all other
    components numeric.
    rÉ   rË   )Újoin)rÔ   rÒ   rÓ   s      r   r‡   r‡   Œ  s'   € ð €L€EˆDØˆW�A�c—h‘h˜t“nÐ%Ð&Ð&r   Úsegmentc                 ó.   ‡ — t        ˆ fd„dD «       «       S )Nc              3   ó@   •K  — | ]  }‰j                  |«      –— Œ y ­wr   )Ú
startswith)Ú.0r�   r×   s     €r   ú	<genexpr>z!_is_not_suffix.<locals>.<genexpr>˜  s!   øè ø€ ò Ø'-ˆ×Ñ˜6×"ñùs   ƒ)ÚdevÚaÚbÚrcÚpost)Úany)r×   s   `r   r‹   r‹   —  s"   ø€ Üó Ø1Pôó ð ð r   ÚleftÚrightc                 óÒ  — g g }}|j                  t        t        j                  d„ | «      «      «       |j                  t        t        j                  d„ |«      «      «       |j                  | t	        |d   «      d  «       |j                  |t	        |d   «      d  «       |j                  ddgt        dt	        |d   «      t	        |d   «      z
  «      z  «       |j                  ddgt        dt	        |d   «      t	        |d   «      z
  «      z  «       t        t        j                  j                  |«      «      t        t        j                  j                  |«      «      fS )Nc                 ó"   — | j                  «       S r   ©Úisdigit©Úxs    r   ú<lambda>z_pad_version.<locals>.<lambda>¡  s   € ¸¿¹»€ r   c                 ó"   — | j                  «       S r   rç   ré   s    r   rë   z_pad_version.<locals>.<lambda>¢  s   € ¸!¿)¹)»+€ r   r   r   rÊ   )	rº   rˆ   r‰   rŠ   r’   ÚinsertÚmaxÚchainÚfrom_iterable)rã   rä   Ú
left_splitÚright_splits       r   r‘   r‘   �  s5  € Ø  "�€Jð ×Ñ”dœ9×.Ñ.Ñ/DÀdÓKÓLÔMØ×Ñ”tœI×/Ñ/Ñ0EÀuÓMÓNÔOð ×Ñ�dœ3˜z¨!™}Ó-Ð/Ð0Ô1Ø×Ñ�uœS ¨Q¡Ó0Ð2Ð3Ô4ð ×Ñ�a˜#˜¤ Q¬¨K¸©NÓ(;¼cÀ*ÈQÁ-Ó>PÑ(PÓ!QÑQÔRØ×Ñ�q˜3˜%¤# a¬¨Z¸©]Ó);¼cÀ+ÈaÁ.Ó>QÑ)QÓ"RÑRÔSô 	ŒY�_‰_×*Ñ*¨:Ó6Ó7ÜŒY�_‰_×*Ñ*¨;Ó7Ó8ðð r   c            	       óH  — e Zd ZdZ	 ddedee   ddfd„Zedee   fd„«       Z	e	j                  deddfd	„«       Z	defd
„Zdefd„Zdefd„Zded ef   dd fd„Zdedefd„Zdefd„Zdee   fd„Zdedefd„Z	 	 ddedee   dee   defd„Z	 ddee   dee   dee   fd„Zy)ÚSpecifierSetzÌThis class abstracts handling of a set of version specifiers.

    It can be passed a single specifier (``>=3.0``), a comma-separated list of
    specifiers (``>=3.0,!=3.1``), or no specifier at all.
    NÚ
specifiersr-   r   c                 óÒ   — |j                  d«      D �cg c]#  }|j                  «       sŒ|j                  «       ‘Œ% }}t        t        t        |«      «      | _        || _        yc c}w )aN  Initialize a SpecifierSet instance.

        :param specifiers:
            The string representation of a specifier or a comma-separated list of
            specifiers which will be parsed and normalized before use.
        :param prereleases:
            This tells the SpecifierSet if it should accept prerelease versions if
            applicable or not. The default of ``None`` will autodetect it from the
            given specifiers.

        :raises InvalidSpecifier:
            If the given ``specifiers`` are not parseable than this exception will be
            raised.
        ú,N)rÍ   rX   Ú	frozensetÚmaprA   Ú_specsrZ   )r#   rõ   r-   ÚsÚsplit_specifierss        r   r\   zSpecifierSet.__init__¹  sW   € ð( 0:×/?Ñ/?ÀÓ/DÖR¨!ÈÏÉÍ	˜AŸG™G�IÐRÐÐRô  ¤¤IÐ/?Ó @ÓAˆŒð (ˆÕùò Ss
   ”A$ªA$c                 ó„   — | j                   �| j                   S | j                  sy t        d„ | j                  D «       «      S )Nc              3   ó4   K  — | ]  }|j                   –— Œ y ­wr   ©r-   ©rÛ   rû   s     r   rÜ   z+SpecifierSet.prereleases.<locals>.<genexpr>å  s   è ø€ Ò6 Q�1—=•=Ñ6ùs   ‚)rZ   rú   râ   r"   s    r   r-   zSpecifierSet.prereleasesÖ  s?   € ð ×ÑÐ(Ø×$Ñ$Ð$ð
 �{Š{Øô Ñ6¨$¯+©+Ô6Ó6Ð6r   r.   c                 ó   — || _         y r   rc   r0   s     r   r-   zSpecifierSet.prereleasesç  rd   r   c                 ó^   — | j                   �d| j                  ›�nd}dt        | «      ›|› d�S )a  A representation of the specifier set that shows all internal state.

        Note that the ordering of the individual specifiers within the set may not
        match the input string.

        >>> SpecifierSet('>=1.0.0,!=2.0.0')
        <SpecifierSet('!=2.0.0,>=1.0.0')>
        >>> SpecifierSet('>=1.0.0,!=2.0.0', prereleases=False)
        <SpecifierSet('!=2.0.0,>=1.0.0', prereleases=False)>
        >>> SpecifierSet('>=1.0.0,!=2.0.0', prereleases=True)
        <SpecifierSet('!=2.0.0,>=1.0.0', prereleases=True)>
        rj   rk   z<SpecifierSet(rm   )rZ   r-   r9   ro   s     r   rq   zSpecifierSet.__repr__ë  sD   € ð × Ñ Ð,ð ˜T×-Ñ-Ð0Ñ1àð 	ð  ¤ D£	˜}¨S¨E°Ð4Ð4r   c                 óX   — dj                  t        d„ | j                  D «       «      «      S )an  A string representation of the specifier set that can be round-tripped.

        Note that the ordering of the individual specifiers within the set may not
        match the input string.

        >>> str(SpecifierSet(">=1.0.0,!=1.0.1"))
        '!=1.0.1,>=1.0.0'
        >>> str(SpecifierSet(">=1.0.0,!=1.0.1", prereleases=False))
        '!=1.0.1,>=1.0.0'
        r÷   c              3   ó2   K  — | ]  }t        |«      –— Œ y ­wr   )r9   r   s     r   rÜ   z'SpecifierSet.__str__.<locals>.<genexpr>  s   è ø€ Ò;¨!œs 1ŸvÑ;ùs   ‚)rÖ   Úsortedrú   r"   s    r   r$   zSpecifierSet.__str__   s"   € ð �x‰xœÑ;¨t¯{©{Ô;Ó;Ó<Ð<r   c                 ó,   — t        | j                  «      S r   )rz   rú   r"   s    r   r'   zSpecifierSet.__hash__  s   € Ü�D—K‘KÓ Ð r   r(   c                 óâ  — t        |t        «      rt        |«      }nt        |t        «      st        S t        «       }t	        | j
                  |j
                  z  «      |_        | j                  €|j                  �|j                  |_        |S | j                  �|j                  €| j                  |_        |S | j                  |j                  k(  r| j                  |_        |S t        d«      ‚)a‚  Return a SpecifierSet which is a combination of the two sets.

        :param other: The other object to combine with.

        >>> SpecifierSet(">=1.0.0,!=1.0.1") & '<=2.0.0,!=2.0.1'
        <SpecifierSet('!=1.0.1,!=2.0.1,<=2.0.0,>=1.0.0')>
        >>> SpecifierSet(">=1.0.0,!=1.0.1") & SpecifierSet('<=2.0.0,!=2.0.1')
        <SpecifierSet('!=1.0.1,!=2.0.1,<=2.0.0,>=1.0.0')>
        zFCannot combine SpecifierSets with True and False prerelease overrides.)r   r9   rô   r|   rø   rú   rZ   Ú
ValueError)r#   r(   Ú	specifiers      r   Ú__and__zSpecifierSet.__and__  så   € ô �eœSÔ!Ü  Ó'‰EÜ˜E¤<Ô0Ü!Ð!ä “Nˆ	Ü$ T§[¡[°5·<±<Ñ%?Ó@ˆ	Ôà×ÑÐ$¨×);Ñ);Ð)GØ%*×%7Ñ%7ˆIÔ"ð Ðð ×ÑÐ*¨u×/AÑ/AÐ/IØ%)×%6Ñ%6ˆIÔ"ð Ðð ×Ñ %×"4Ñ"4Ò4Ø%)×%6Ñ%6ˆIÔ"ð Ðô ðóð r   c                 ó¶   — t        |t        t        f«      rt        t        |«      «      }nt        |t        «      st        S | j
                  |j
                  k(  S )a¡  Whether or not the two SpecifierSet-like objects are equal.

        :param other: The other object to check against.

        The value of :attr:`prereleases` is ignored.

        >>> SpecifierSet(">=1.0.0,!=1.0.1") == SpecifierSet(">=1.0.0,!=1.0.1")
        True
        >>> (SpecifierSet(">=1.0.0,!=1.0.1", prereleases=False) ==
        ...  SpecifierSet(">=1.0.0,!=1.0.1", prereleases=True))
        True
        >>> SpecifierSet(">=1.0.0,!=1.0.1") == ">=1.0.0,!=1.0.1"
        True
        >>> SpecifierSet(">=1.0.0,!=1.0.1") == SpecifierSet(">=1.0.0")
        False
        >>> SpecifierSet(">=1.0.0,!=1.0.1") == SpecifierSet(">=1.0.0,!=1.0.2")
        False
        )r   r9   rA   rô   r|   rú   r*   s     r   r+   zSpecifierSet.__eq__0  sD   € ô& �eœc¤9Ð-Ô.Ü ¤ U£Ó,‰EÜ˜E¤<Ô0Ü!Ð!à�{‰{˜eŸl™lÑ*Ð*r   c                 ó,   — t        | j                  «      S )z7Returns the number of specifiers in this specifier set.)r’   rú   r"   s    r   Ú__len__zSpecifierSet.__len__J  s   € ä�4—;‘;ÓÐr   c                 ó,   — t        | j                  «      S )zð
        Returns an iterator over all the underlying :class:`Specifier` instances
        in this specifier set.

        >>> sorted(SpecifierSet(">=1.0.0,!=1.0.1"), key=str)
        [<Specifier('!=1.0.1')>, <Specifier('>=1.0.0')>]
        )Úiterrú   r"   s    r   Ú__iter__zSpecifierSet.__iter__N  s   € ô �D—K‘KÓ Ð r   r1   c                 ó$   — | j                  |«      S )ar  Return whether or not the item is contained in this specifier.

        :param item: The item to check for.

        This is used for the ``in`` operator and behaves the same as
        :meth:`contains` with no ``prereleases`` argument passed.

        >>> "1.2.3" in SpecifierSet(">=1.0.0,!=1.0.1")
        True
        >>> Version("1.2.3") in SpecifierSet(">=1.0.0,!=1.0.1")
        True
        >>> "1.0.1" in SpecifierSet(">=1.0.0,!=1.0.1")
        False
        >>> "1.3.0a1" in SpecifierSet(">=1.0.0,!=1.0.1")
        False
        >>> "1.3.0a1" in SpecifierSet(">=1.0.0,!=1.0.1", prereleases=True)
        True
        r³   r´   s     r   rµ   zSpecifierSet.__contains__X  r¶   r   Ú	installedc                 óú   ‡‡— t        ‰t        «      st        ‰«      Š‰€| j                  Š‰s‰j                  ry|r!‰j                  rt        ‰j                  «      Št        ˆˆfd„| j                  D «       «      S )a´  Return whether or not the item is contained in this SpecifierSet.

        :param item:
            The item to check for, which can be a version string or a
            :class:`Version` instance.
        :param prereleases:
            Whether or not to match prereleases with this SpecifierSet. If set to
            ``None`` (the default), it uses :attr:`prereleases` to determine
            whether or not prereleases are allowed.

        >>> SpecifierSet(">=1.0.0,!=1.0.1").contains("1.2.3")
        True
        >>> SpecifierSet(">=1.0.0,!=1.0.1").contains(Version("1.2.3"))
        True
        >>> SpecifierSet(">=1.0.0,!=1.0.1").contains("1.0.1")
        False
        >>> SpecifierSet(">=1.0.0,!=1.0.1").contains("1.3.0a1")
        False
        >>> SpecifierSet(">=1.0.0,!=1.0.1", prereleases=True).contains("1.3.0a1")
        True
        >>> SpecifierSet(">=1.0.0,!=1.0.1").contains("1.3.0a1", prereleases=True)
        True
        Fc              3   óD   •K  — | ]  }|j                  ‰‰¬ «      –— Œ y­w)rÿ   Nr³   )rÛ   rû   r1   r-   s     €€r   rÜ   z(SpecifierSet.contains.<locals>.<genexpr>¤  s   øè ø€ ÒRÀ�1—:‘:˜d°�:×<ÑRùs   ƒ )r   r   r-   ra   r©   Úallrú   )r#   r1   r-   r  s    `` r   r3   zSpecifierSet.containsm  sm   ù€ ô< ˜$¤Ô(Ü˜4“=ˆDð
 ÐØ×*Ñ*ˆKñ ˜t×1Ò1Øá˜×+Ò+Ü˜4×,Ñ,Ó-ˆDô ÔRÀdÇkÁkÔRÓRÐRr   r4   c                 ór  — |€| j                   }| j                  r8| j                  D ]  }|j                  |t        |«      ¬«      }Œ  t	        |«      S g }g }|D ]A  }t        |«      }|j                  r|s|rŒ|j                  |«       Œ1|j                  |«       ŒC |s|r|€t	        |«      S t	        |«      S )a.  Filter items in the given iterable, that match the specifiers in this set.

        :param iterable:
            An iterable that can contain version strings and :class:`Version` instances.
            The items in the iterable will be filtered according to the specifier.
        :param prereleases:
            Whether or not to allow prereleases in the returned iterator. If set to
            ``None`` (the default), it will be intelligently decide whether to allow
            prereleases or not (based on the :attr:`prereleases` attribute, and
            whether the only versions matching are prereleases).

        This method is smarter than just ``filter(SpecifierSet(...).contains, [...])``
        because it implements the rule from :pep:`440` that a prerelease item
        SHOULD be accepted if no other versions match the given specifier.

        >>> list(SpecifierSet(">=1.2.3").filter(["1.2", "1.3", "1.5a1"]))
        ['1.3']
        >>> list(SpecifierSet(">=1.2.3").filter(["1.2", "1.3", Version("1.4")]))
        ['1.3', <Version('1.4')>]
        >>> list(SpecifierSet(">=1.2.3").filter(["1.2", "1.5a1"]))
        []
        >>> list(SpecifierSet(">=1.2.3").filter(["1.3", "1.5a1"], prereleases=True))
        ['1.3', '1.5a1']
        >>> list(SpecifierSet(">=1.2.3", prereleases=True).filter(["1.3", "1.5a1"]))
        ['1.3', '1.5a1']

        An "empty" SpecifierSet will filter items based on the presence of prerelease
        versions in the set.

        >>> list(SpecifierSet("").filter(["1.3", "1.5a1"]))
        ['1.3']
        >>> list(SpecifierSet("").filter(["1.5a1"]))
        ['1.5a1']
        >>> list(SpecifierSet("", prereleases=True).filter(["1.3", "1.5a1"]))
        ['1.3', '1.5a1']
        >>> list(SpecifierSet("").filter(["1.3", "1.5a1"], prereleases=True))
        ['1.3', '1.5a1']
        rÿ   )r-   rú   r6   r<   r  r   ra   rº   )r#   r4   r-   rQ   Úfilteredr¼   r1   r¾   s           r   r6   zSpecifierSet.filter¦  sÈ   € ðX ÐØ×*Ñ*ˆKð
 �;Š;ØŸ™ò P�ØŸ;™; x¼TÀ+Ó=N˜;ÓO‘ðPä˜“>Ð!ð
 24ˆHØ:<Ðà ò 	*�Ü!0°Ó!6�ð "×/Ò/¹Ú#Ø)×0Ñ0°Õ6à—O‘O DÕ)ð	*ñ Ñ 1°kÐ6IÜÐ-Ó.Ð.ä˜“>Ð!r   r¿   )NNr   )r   r   r   r   r9   r   r<   r\   r=   r-   r>   rq   r$   r:   r'   r
   r
  r;   r+   r  r   rA   r  rÇ   rµ   r3   r   r   r6   r   r   r   rô   rô   ²  st  „ ñð CGñ(Øð(Ø19¸$±ð(à	ó(ð: ð7˜X d™^ò 7ó ð7ð  ×Ñð" ð "¨$ò "ó ð"ð5˜#ó 5ð*=˜ó =ð!˜#ó !ð˜U >°3Ð#6Ñ7ð ¸Nó ð@+˜Fð + tó +ð4 ˜ó  ð!˜( 9Ñ-ó !ð# ð #°Tó #ð0 '+Ø$(ñ	7Sàð7Sð ˜d‘^ð7Sð ˜D‘>ð	7Sð
 
ó7Sðt UYñM"Ø Ð!3Ñ4ðM"ØCKÈDÁ>ðM"à	Ð$Ñ	%ôM"r   rô   )#r   r7   r‰   rÂ   Útypingr   r   r   r   r   r   r	   r
   Úutilsr   r   r   r9   rÇ   r   r<   rÆ   r   r  r   ÚABCMetar    rA   rÃ   rÎ   rŒ   r‡   r‹   r‘   rô   r   r   r   ú<module>r     s)  ðñó Û Û 	ß V× VÓ Vå 'Ý à˜ ˜Ñ%€ÙÐ1¸ÔIÐ Ø˜W c˜N¨DÐ0Ñ1Ð ð˜_ð °ó ô	�zô 	ô4˜cŸk™kõ 4ônO�ô Oðd �—
‘
Ð<Ó=€ð˜Cð  D¨¡Ió ð,'˜d 3™ið '¨Có 'ð˜Cð  Dó ð�t˜C‘yð ¨¨c©ð °u¸TÀ#¹YÈÈSÉ	Ð=QÑ7Ró ô*A"�=õ A"r   