Ë
    nûàgŠœ  ã                  óN  — d Z ddlm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 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d
„Z G d„ de«      Z G d„ dej0                  ¬«      Z G d„ de«      Z ej6                  d«      Zdd„Zdd„Zdd„Zdd„Z  G d„ de«      Z!y)zŠ
.. testsetup::

    from packaging.specifiers import Specifier, SpecifierSet, InvalidSpecifier
    from packaging.version import Version
é    )ÚannotationsN)ÚCallableÚIterableÚIteratorÚTypeVarÚUnioné   )Úcanonicalize_version)ÚVersionÚUnparsedVersionVar)Úboundc                ó<   — t        | t        «      st        | «      } | S ©N)Ú
isinstancer   )Úversions    úe/var/www/skyplay_api_hub/venv/lib/python3.12/site-packages/setuptools/_vendor/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                  ó0  — e Zd Zej                  d	d„«       Zej                  d
d„«       Zej                  dd„«       Zeej                  dd„«       «       Z	e	j                  dd„«       Z	ej                  ddd„«       Zej                  	 d	 	 	 	 	 dd„«       Zy)ÚBaseSpecifierc                 ó   — 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__4   r"   r   c                 ó   — 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    Úothers     r   Ú__eq__zBaseSpecifier.__eq__:   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.prereleasesC   r"   r   c                 ó   — y)zQSetter for :attr:`prereleases`.

        :param value: The value to set.
        Nr   ©r    Úvalues     r   r*   zBaseSpecifier.prereleasesL   r"   r   Nc                 ó   — y)zR
        Determines if the given item is contained within this specifier.
        Nr   )r    Úitemr*   s      r   ÚcontainszBaseSpecifier.containsS   r"   r   c                 ó   — 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    Úiterabler*   s      r   ÚfilterzBaseSpecifier.filterY   r"   r   ©ÚreturnÚstr©r5   Úint©r'   Úobjectr5   Úbool©r5   úbool | None©r-   r;   r5   ÚNoner   )r/   r6   r*   r=   r5   r;   ©r2   zIterable[UnparsedVersionVar]r*   r=   r5   zIterator[UnparsedVersionVar])r   r   r   ÚabcÚabstractmethodr!   r$   r(   Úpropertyr*   Úsetterr0   r3   r   r   r   r   r   ,   sÙ   „ Ø×Ñòó ðð 	×Ñòó ðð
 	×Ñòó ðð Ø×Ñòó ó ðð ×Ñòó ðð 	×Ñóó ðð
 	×ÑàQUðØ4ðØCNðà	%òó ñ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d&d'd„Zed(d„«       Zej                  d)d„«       Zed*d„«       Zed*d„«       Zd*d„Zd*d„Zed+d„«       Zd,d„Zd-d„Zd.d„Zd/d„Zd/d„Zd/d„Zd/d„Zd/d„Zd0d „Zd0d!„Zd/d"„Zd1d#„Z d2d3d$„Z!	 d2	 	 	 	 	 d4d%„Z"y)5Ú	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!=ú<=ú>=ú<ú>ú===Nc                óî   — | j                   j                  |«      }|st        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    Úspecr*   Úmatchs       r   Ú__init__zSpecifier.__init__Þ   sm   € ð —‘×"Ñ" 4Ó(ˆÙÜ"Ð%8¸¸Ð#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)rQ   rS   rR   rP   rV   rU   rT   rQ   ú.*éþÿÿÿTF)r^   r]   Úendswithr   Úis_prerelease)r    rX   r   s      r   r*   zSpecifier.prereleasesø   sm   € ð ×ÑÐ(Ø×$Ñ$Ð$ð
 !ŸJ™JÑˆ�'ØÐ@Ñ@ð ˜4Ò G×$4Ñ$4°TÔ$:Ø! # 2˜,�ô �wÓ×-Ò-Øàr   c                ó   — || _         y r   ©r^   r,   s     r   r*   zSpecifier.prereleases  ó
   € à!ˆÕr   c                ó    — | j                   d   S )z`The operator of this specifier.

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

        >>> Specifier("==1.2.3").version
        '1.2.3'
        r	   rk   r   s    r   r   zSpecifier.version  rl   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=Ú rT   ú(ú)>)r^   r*   Ú	__class__r   r6   ©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{}{})Úformatr]   r   s    r   r!   zSpecifier.__str__8  s   € ð ˆv�}‰}˜dŸj™jÐ)Ð)r   c                óx   — t        | j                  d   | j                  d   dk7  ¬«      }| j                  d   |fS )Nr	   r   rP   ©Ústrip_trailing_zero)r
   r]   )r    Úcanonical_versions     r   Ú_canonical_speczSpecifier._canonical_specB  s>   € ä0Ø�J‰J�q‰MØ!%§¡¨A¡°$Ñ!6ô
Ðð �z‰z˜!‰}Ð/Ð/Ð/r   c                ó,   — t        | j                  «      S r   )Úhashr}   r   s    r   r$   zSpecifier.__hash__J  s   € Ü�D×(Ñ(Ó)Ð)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   r6   rs   r   ÚNotImplementedr}   r&   s     r   r(   zSpecifier.__eq__M  si   € ô& �eœSÔ!ð&ØŸ™¤s¨5£zÓ2‘ô ˜E 4§>¡>Ô2Ü!Ð!à×#Ñ# u×'<Ñ'<Ñ<Ð<øô $ò &Ü%Ò%ð&ús   ’A" Á"A4Á3A4c                ó>   — t        | d| j                  |   › �«      }|S )NÚ	_compare_)ÚgetattrÚ
_operators)r    ÚopÚoperator_callables      r   Ú_get_operatorzSpecifier._get_operatorj  s+   € Ü.5Ø�I˜dŸo™o¨bÑ1Ð2Ð3ó/
Ðð !Ð r   c           
     óà   — t        t        t        j                  t        t        |«      «      «      d d «      }|dz  } | j                  d«      ||«      xr  | j                  d«      ||«      S )Néÿÿÿÿrc   rS   rQ   )Ú_version_joinÚlistÚ	itertoolsÚ	takewhileÚ_is_not_suffixÚ_version_splitrˆ   )r    Úprospectiver_   Úprefixs       r   Ú_compare_compatiblezSpecifier._compare_compatiblep  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 )Nrc   Frz   rd   )re   r
   Úpublicr�   Ú_pad_versionÚlenr   Úlocal)r    r‘   r_   Ú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‘   r_   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   c                ó®   — t        |«      }||k  sy|j                  s8|j                  r,t        |j                  «      t        |j                  «      k(  ryy©NFT)r   rf   Úbase_version©r    r‘   Úspec_strr_   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   )r6   Úlowerr£   s      r   Ú_compare_arbitraryzSpecifier._compare_arbitraryñ  s&   € Ü�;Ó×%Ñ%Ó'¬3¨t«9¯?©?Ó+<Ñ<Ð<r   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
        ©r0   ©r    r/   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   rf   rˆ   rX   r   )r    r/   r*   Únormalized_itemr‡   s        r   r0   zSpecifier.contains	  sY   € ð4 ÐØ×*Ñ*ˆKô *¨$Ó/ˆð
 ×(Ò(±Øð /3×.@Ñ.@ÀÇÁÓ.OÐÙ  °$·,±,Ó?Ð?r   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   r0   rf   r*   Úappend)r    r2   r*   ÚyieldedÚfound_prereleasesÚkwr   Úparsed_versions           r   r3   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©rp   N)r_   r6   r*   r=   r5   r?   )r5   r;   r>   r4   )r5   ztuple[str, str]r7   r9   )r†   r6   r5   ÚCallableOperator)r‘   r   r_   r6   r5   r;   )r‘   r   r¯   r6   r5   r;   )r/   zstr | Versionr5   r;   r   )r/   ÚUnparsedVersionr*   r=   r5   r;   r@   )#r   r   r   r   Ú_operator_regex_strÚ_version_regex_strÚreÚcompileÚVERBOSEÚ
IGNORECASErY   r…   ra   rC   r*   rD   rX   r   rv   r!   r}   r$   r(   rˆ   r“   r¡   r¤   r§   rª   r°   r³   r¶   rº   r0   r3   r   r   r   rG   rG   c   sR  „ ñðÐð\Ðð| ˆR�Z‰ZØÐ%Ñ%Ð(:Ñ:¸WÑDØ
�
‰
�R—]‘]Ñ"ó€Fð ØØØØ"ØØØñ	€Jô(ð4 òó ðð. ×Ñò"ó ð"ð òó ðð òó ðóBó$*ð ò0ó ð0ó*ó=ó:!ó
ó(&/óP:ó<ó<óó0ó<=ó#ô**@ðZ RVð;Ø4ð;ØCNð;à	%ô;r   rG   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_regexrZ   ÚextendÚgroups)r   ÚresultÚepochrž   Úrestr/   r`   s          r   r�   r�   v  s~   € ð €Fà×'Ñ'¨Ó,�N€Eˆ1ˆdØ
‡M�M�%’,˜3Ôà—
‘
˜3“ò  ˆÜ×$Ñ$ TÓ*ˆÙØ�M‰M˜%Ÿ,™,›.Õ)à�M‰M˜$Õð ð €Mr   c                ó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)Ú
componentsr×   rØ   s      r   r‹   r‹   Œ  s'   € ð €L€EˆDØˆW�A�c—h‘h˜t“nÐ%Ð&Ð&r   c                ó.   ‡ — t        ˆ fd„dD «       «       S )Nc              3  ó@   •K  — | ]  }‰j                  |«      –— Œ y ­wr   )Ú
startswith)Ú.0r’   Úsegments     €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   c                óÒ  — 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)ÚleftÚrightÚ
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                  óÒ   — e Zd ZdZ	 	 d	 	 	 	 	 dd„Zedd„«       Zej                  dd„«       Zdd„Zdd„Z	dd„Z
dd	„Zdd
„Zdd„Zdd„Zdd„Z	 	 d	 	 	 	 	 	 	 dd„Z	 d	 	 	 	 	 d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.
    Nc                ó"  — t        |t        «      rc|j                  d«      D �cg c]#  }|j                  «       sŒ|j                  «       ‘Œ% }}t	        t        t        |«      «      | _        || _        yt	        |«      | _        || _        yc c}w )a´  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.
            May also be an iterable of ``Specifier`` instances, which will be used
            as is.
        :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   r6   rÒ   r\   Ú	frozensetÚmaprG   Ú_specsr^   )r    Ú
specifiersr*   ÚsÚsplit_specifierss        r   ra   zSpecifierSet.__init__¹  s{   € ô, �j¤#Ô&ð 4>×3CÑ3CÀCÓ3HÖV¨aÈAÏGÉGÍI §¡¥	ÐVÐÐVô $¤C¬	Ð3CÓ$DÓEˆDŒKð (ˆÕô	 $ JÓ/ˆDŒKð (ˆÕùò  Ws
   ¤BºB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   ‚)r^   rþ   rç   r   s    r   r*   zSpecifierSet.prereleasesß  s?   € ð ×ÑÐ(Ø×$Ñ$Ð$ð
 �{Š{Øô Ñ6¨$¯+©+Ô6Ó6Ð6r   c                ó   — || _         y r   rh   r,   s     r   r*   zSpecifierSet.prereleasesð  ri   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)>
        ro   rp   z<SpecifierSet(rr   )r^   r*   r6   rt   s     r   rv   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   )r6   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   )r   rþ   r   s    r   r$   zSpecifierSet.__hash__  s   € Ü�D—K‘KÓ Ð 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   r6   rù   r�   rü   rþ   r^   Ú
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   r6   rG   rù   r�   rþ   r&   s     r   r(   zSpecifierSet.__eq__9  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__S  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__W  s   € ô �D—K‘KÓ Ð r   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__a  r»   r   c                óú   ‡‡— 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   r/   r*   s     €€r   rá   z(SpecifierSet.contains.<locals>.<genexpr>­  s   øè ø€ ÒRÀ�1—:‘:˜d°�:×<ÑRùs   ƒ )r   r   r*   rf   r­   Úallrþ   )r    r/   r*   Ú	installeds    `` r   r0   zSpecifierSet.containsv  sm   ù€ ô< ˜$¤Ô(Ü˜4“=ˆDð
 ÐØ×*Ñ*ˆKñ ˜t×1Ò1Øá˜×+Ò+Ü˜4×,Ñ,Ó-ˆDô ÔRÀdÇkÁkÔRÓRÐRr   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þ   r3   r;   r  r   rf   r¿   )r    r2   r*   r_   ÚfilteredrÁ   r/   rÃ   s           r   r3   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Ä   )rÿ   zstr | Iterable[Specifier]r*   r=   r5   r?   r<   r>   r4   r7   )r'   zSpecifierSet | strr5   rù   r9   )r5   zIterator[Specifier])r/   rÆ   r5   r;   )NN)r/   rÆ   r*   r=   r  r=   r5   r;   r   r@   )r   r   r   r   ra   rC   r*   rD   rv   r!   r$   r  r(   r  r  rº   r0   r3   r   r   r   rù   rù   ²  sé   „ ñð 13Ø#'ð$(à-ð$(ð !ð$(ð 
ó	$(ðL ò7ó ð7ð  ×Ñò"ó ð"ó5ó*=ó!óó@+ó4 ó!ó#ð0 $(Ø!%ð	7Sàð7Sð !ð7Sð ð	7Sð
 
ó7Sðt RVðM"Ø4ðM"ØCNðM"à	%ôM"r   rù   )r   rÆ   r5   r   )r   r6   r5   ú	list[str])rÛ   r  r5   r6   )rà   r6   r5   r;   )rô   r  rõ   r  r5   ztuple[list[str], list[str]])"r   Ú
__future__r   rA   r�   rÉ   Útypingr   r   r   r   r   Úutilsr
   r   r   r6   rÆ   r   r;   rÅ   r   r  r   ÚABCMetar   rG   rÊ   rÓ   r�   r‹   r�   r–   rù   r   r   r   ú<module>r"     sº   ðñõ #ã 
Û Û 	ß ?Õ ?å 'Ý à˜ ˜Ñ%€ÙÐ1¸ÔIÐ Ø˜W c˜N¨DÐ0Ñ1Ð óô	�zô 	ô4˜cŸk™kõ 4ônM�ô Mð` �—
‘
Ð<Ó=€óó,'óóô*J"�=õ J"r   