ó
    ÂÜhwœ  ã                  óL  • S r SSKJr  SSKrSSKrSSKrSSKJrJrJ	r	J
r
Jr  SSKJr  SSKJr  \\\4   r\
" S\S	9r\\\/\4   rSS
 jr " S S\5      r " S S\R0                  S9r " S S\5      r\R6                  " S5      rSS jrSS jrSS jrSS jr  " S S\5      r!g)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                óF   • [        U [        5      (       d  [        U 5      n U $ ©N)Ú
isinstancer   )Úversions    Ú6/usr/lib/python3/dist-packages/packaging/specifiers.pyÚ_coerce_versionr      s   € Ü�gœw×'Ñ'Ü˜'Ó"ˆØ€Nó    c                  ó   • \ rS rSrSrSrg)ÚInvalidSpecifieré    zç
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__Ú__firstlineno__Ú__doc__Ú__static_attributes__r   r   r   r   r       s   † ôr   r   c                  óJ  • \ rS rSr\R
                  SS j5       r\R
                  SS j5       r\R
                  SS j5       r\	\R
                  SS j5       5       r
\
R                  SS j5       r
\R
                  SSS jj5       r\R
                   S     SS	 jj5       rS
rg)ÚBaseSpecifieré,   c                ó   • g)zv
Returns the str representation of this Specifier-like object. This
should be representative of the Specifier itself.
Nr   ©Úselfs    r   Ú__str__ÚBaseSpecifier.__str__-   ó   � r   c                ó   • g)z6
Returns a hash value for this Specifier-like object.
Nr   r#   s    r   Ú__hash__ÚBaseSpecifier.__hash__4   r'   r   c                ó   • g)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__ÚBaseSpecifier.__eq__:   r'   r   c                ó   • g)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   ÚprereleasesÚBaseSpecifier.prereleasesC   r'   r   c                ó   • g)zASetter for :attr:`prereleases`.

:param value: The value to set.
Nr   ©r$   Úvalues     r   r1   r2   L   r'   r   Nc                ó   • g)zB
Determines if the given item is contained within this specifier.
Nr   )r$   Úitemr1   s      r   ÚcontainsÚBaseSpecifier.containsS   r'   r   c                ó   • g)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$   Úiterabler1   s      r   ÚfilterÚBaseSpecifier.filterY   r'   r   r   ©ÚreturnÚstr©r?   Úint©r-   Úobjectr?   Úbool©r?   úbool | None©r5   rE   r?   ÚNoner   )r7   r@   r1   rG   r?   rE   ©r;   zIterable[UnparsedVersionVar]r1   rG   r?   zIterator[UnparsedVersionVar])r   r   r   r   ÚabcÚabstractmethodr%   r)   r.   Úpropertyr1   Úsetterr8   r<   r   r   r   r   r    r    ,   sÙ   † Ø×Ñóó ðð 	×Ñóó ðð
 	×Ñóó ðð Ø×Ñóó ó ðð ×Ñóó ðð 	×Ñõó ðð
 	×ÑàQUðØ4ðØCNðà	%ôó ór   r    )Ú	metaclassc            	      óÖ  • \ rS rSrSrSrSr\R                  " S\-   \-   S-   \R                  \R                  -  5      rSSS	S
SSSSS.rS(S)S jjr\S*S j5       r\R                   S+S j5       r\S,S j5       r\S,S j5       rS,S jrS,S jr\S-S j5       rS.S jrS/S jrS0S jrS1S jrS1S jrS1S jrS1S jrS1S  jrS2S! jrS2S" jrS1S# jr S3S$ jr!S4S5S% jjr" S4     S6S& jjr#S'r$g)7Ú	Specifieréc   a+  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                óø   • U R                   R                  U5      nU(       d  [        SU< 35      eUR                  S5      R	                  5       UR                  S5      R	                  5       4U l        X l        g)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$   Úspecr1   Úmatchs       r   Ú__init__ÚSpecifier.__init__Þ   sk   € ð —‘×"Ñ" 4Ó(ˆÞÜ"Ð%8¸¹Ð#AÓBÐBð �K‰K˜
Ó#×)Ñ)Ó+Ø�K‰K˜	Ó"×(Ñ(Ó*ð'
ˆŒ
ð (Õr   c                óÖ   • U R                   b  U R                   $ U R                  u  pUS;   a<  US:X  a  UR                  S5      (       a  US S n[        U5      R                  (       a  gg)N)r\   r^   r]   r[   ra   r`   r_   r\   ú.*éþÿÿÿTF)ri   rh   Úendswithr   Úis_prerelease)r$   rc   r   s      r   r1   ÚSpecifier.prereleasesø   sn   € ð ×ÑÑ(Ø×$Ñ$Ð$ð
 !ŸJ™JÑˆØÐ@Ó@ð ˜4Ó G×$4Ñ$4°T×$:Ñ$:Ø! # 2˜,�ô �wÓ×-×-Øàr   c                ó   • Xl         g r   ©ri   r4   s     r   r1   rs     ó   € à!Õr   c                ó    • U R                   S   $ )zHThe operator of this specifier.

>>> Specifier("==1.2.3").operator
'=='
r   ©rh   r#   s    r   rc   ÚSpecifier.operator  ó   € ð �z‰z˜!‰}Ðr   c                ó    • U R                   S   $ )zIThe version of this specifier.

>>> Specifier("==1.2.3").version
'1.2.3'
r	   rx   r#   s    r   r   ÚSpecifier.version  rz   r   c                ó’   • U R                   b  SU R                  < 3OSnSU R                  R                   S[	        U 5      < U S3$ )a  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=Ú r_   Ú(ú)>)ri   r1   Ú	__class__r   r@   ©r$   Úpres     r   Ú__repr__ÚSpecifier.__repr__&  sU   € ð × Ñ Ñ,ð ˜T×-Ñ-Ñ0Ñ1àð 	ð �4—>‘>×*Ñ*Ð+¨1¬S°«Y©M¸#¸¸bÐAÐAr   c                ó4   • SR                   " U R                  6 $ )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{}{})Úformatrh   r#   s    r   r%   ÚSpecifier.__str__8  s   € ð �}Š}˜dŸj™jÐ)Ð)r   c                ór   • [        U R                  S   U R                  S   S:g  S9nU R                  S   U4$ )Nr	   r   r[   ©Ústrip_trailing_zero)r
   rh   )r$   Úcanonical_versions     r   Ú_canonical_specÚSpecifier._canonical_specB  s>   € ä0Ø�J‰J�q‰MØ!%§¡¨A¡°$Ñ!6ñ
Ðð �z‰z˜!‰}Ð/Ð/Ð/r   c                ó,   • [        U R                  5      $ r   )ÚhashrŽ   r#   s    r   r)   ÚSpecifier.__hash__J  s   € Ü�D×(Ñ(Ó)Ð)r   c                ó  • [        U[        5      (       a   U R                  [        U5      5      nO [        XR                  5      (       d  [        $ U R
                  UR
                  :H  $ ! [         a	    [        s $ f = f)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   r@   r‚   r   ÚNotImplementedrŽ   r,   s     r   r.   ÚSpecifier.__eq__M  sm   € ô& �eœS×!Ñ!ð&ØŸ™¤s¨5£zÓ2‘ô ˜E§>¡>×2Ñ2Ü!Ð!à×#Ñ# u×'<Ñ'<Ñ<Ð<øô $ó &Ü%Ò%ð&ús   —A+ Á+A>Á=A>c                ó>   • [        U SU R                  U    35      nU$ )NÚ	_compare_)ÚgetattrÚ
_operators)r$   ÚopÚoperator_callables      r   Ú_get_operatorÚSpecifier._get_operatorj  s+   € Ü.5Ø�I˜dŸo™o¨bÑ1Ð2Ð3ó/
Ðð !Ð r   c           
     óè   • [        [        [        R                  " [        [        U5      5      5      S S 5      nUS-  nU R                  S5      " X5      =(       a    U R                  S5      " X5      $ )Néÿÿÿÿro   r^   r\   )Ú_version_joinÚlistÚ	itertoolsÚ	takewhileÚ_is_not_suffixÚ_version_splitrœ   )r$   Úprospectiverj   Úprefixs       r   Ú_compare_compatibleÚSpecifier._compare_compatiblep  sn   € ô Ü”×$Ò$¤^´^ÀDÓ5IÓJÓKÈCÈRÐPó
ˆð
 	�$‰ˆà×!Ñ! $Ô'¨Ó:÷ 
¸t×?QÑ?QÐRVÔ?WØó@
ð 	
r   c                óD  • UR                  S5      (       aV  [        UR                  SS9n[        US S SS9n[        U5      n[        U5      n[	        Xe5      u  pxUS [        U5       n	X•:H  $ [        U5      n
U
R                  (       d  [        UR                  5      nX:H  $ )Nro   Fr‹   rp   )rq   r
   Úpublicr¥   Ú_pad_versionÚlenr   Úlocal)r$   r¦   rj   Únormalized_prospectiveÚnormalized_specÚ
split_specÚsplit_prospectiveÚpadded_prospectiveÚ_Úshortened_prospectiveÚspec_versions              r   Ú_compare_equalÚSpecifier._compare_equal„  s³   € à�=‰=˜×Ñä%9Ø×"Ñ"¸ñ&Ð"ô 3°4¸¸°9ÐRWÑXˆOô (¨Ó8ˆJô
 !/Ð/EÓ FÐô %1Ð1BÓ$OÑ!Ðð
 %7Ð7H¼¸Z»Ð$IÐ!à(Ñ6Ð6ô # 4›=ˆLð
  ×%×%Ü% k×&8Ñ&8Ó9�àÑ.Ð.r   c                ó.   • U R                  X5      (       + $ r   )r·   ©r$   r¦   rj   s      r   Ú_compare_not_equalÚSpecifier._compare_not_equal¬  s   € Ø×&Ñ& {Ó9Ô9Ð9r   c                óD   • [        UR                  5      [        U5      :*  $ r   ©r   r«   rº   s      r   Ú_compare_less_than_equalÚ"Specifier._compare_less_than_equal¯  ó   € ô �{×)Ñ)Ó*¬g°d«mÑ;Ð;r   c                óD   • [        UR                  5      [        U5      :¬  $ r   r¾   rº   s      r   Ú_compare_greater_than_equalÚ%Specifier._compare_greater_than_equalµ  rÁ   r   c                óÄ   • [        U5      nX:  d  gUR                  (       d>  UR                  (       a-  [        UR                  5      [        UR                  5      :X  a  gg©NFT)r   rr   Úbase_version©r$   r¦   Úspec_strrj   s       r   Ú_compare_less_thanÚSpecifier._compare_less_than»  sR   € ô �xÓ ˆð
 Ó!Øð ×!×! k×&?×&?Ü�{×/Ñ/Ó0´G¸D×<MÑ<MÓ4NÓNØð
 r   c                ó8  • [        U5      nX:”  d  gUR                  (       d>  UR                  (       a-  [        UR                  5      [        UR                  5      :X  a  gUR                  b-  [        UR                  5      [        UR                  5      :X  a  ggrÆ   )r   Úis_postreleaserÇ   r®   rÈ   s       r   Ú_compare_greater_thanÚSpecifier._compare_greater_thanÓ  s�   € ô �xÓ ˆð
 Ó!Øð ×"×" {×'A×'AÜ�{×/Ñ/Ó0´G¸D×<MÑ<MÓ4NÓNØð ×ÑÑ(Ü�{×/Ñ/Ó0´G¸D×<MÑ<MÓ4NÓNØð
 r   c                óh   • [        U5      R                  5       [        U5      R                  5       :H  $ r   )r@   Úlowerrº   s      r   Ú_compare_arbitraryÚSpecifier._compare_arbitraryñ  s&   € Ü�;Ó×%Ñ%Ó'¬3¨t«9¯?©?Ó+<Ñ<Ð<r   c                ó$   • U R                  U5      $ )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
©r8   ©r$   r7   s     r   Ú__contains__ÚSpecifier.__contains__ô  ó   € ð& �}‰}˜TÓ"Ð"r   c                óÂ   • Uc  U R                   n[        U5      nUR                  (       a  U(       d  gU R                  U R                  5      nU" X0R
                  5      $ )aÌ  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)r1   r   rr   rœ   rc   r   )r$   r7   r1   Únormalized_itemr›   s        r   r8   ÚSpecifier.contains	  sW   € ð4 ÑØ×*Ñ*ˆKô *¨$Ó/ˆð
 ×(×(¶Øð /3×.@Ñ.@ÀÇÁÓ.OÐÙ  ·,±,Ó?Ð?r   c              #  ó@  #   • Sn/ nSUb  UOS0nU Hj  n[        U5      nU R                  " U40 UD6(       d  M(  UR                  (       a+  U(       d$  U R                  (       d  UR	                  U5        Md  SnUv •  Ml     U(       d  U(       a  U H  nUv •  M	     ggg7f)aŸ  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']
Fr1   NT)r   r8   rr   r1   Úappend)r$   r;   r1   ÚyieldedÚfound_prereleasesÚkwr   Úparsed_versions           r   r<   ÚSpecifier.filter5  s›   é € ð< ˆØÐà¨KÑ,C™[ÈÐNˆó  ˆGÜ,¨WÓ5ˆNà�}Š}˜^Ñ2¨r×2Ñ2ð "×/×/Þ 4×#3×#3à%×,Ñ,¨WÖ5ð #�GØ!”Mñ  ö( Ö,Û,�Ø”ò -ð -ˆwùs   ‚4BºA$B)ri   rh   ©r   N)rj   r@   r1   rG   r?   rI   )r?   rE   rH   r>   )r?   ztuple[str, str]rA   rC   )rš   r@   r?   ÚCallableOperator)r¦   r   rj   r@   r?   rE   )r¦   r   rÉ   r@   r?   rE   )r7   zstr | Versionr?   rE   r   )r7   ÚUnparsedVersionr1   rG   r?   rE   rJ   )%r   r   r   r   r   Ú_operator_regex_strÚ_version_regex_strÚreÚcompileÚVERBOSEÚ
IGNORECASErd   r™   rl   rM   r1   rN   rc   r   r…   r%   rŽ   r)   r.   rœ   r¨   r·   r»   r¿   rÃ   rÊ   rÎ   rÒ   r×   r8   r<   r   r   r   r   rQ   rQ   c   sU  † ñðÐð\Ðð| �ZŠZØÐ%Ñ%Ð(:Ñ:¸WÑDØ
�
‰
�R—]‘]Ñ"ó€Fð ØØØØ"ØØØñ	€Jö(ð4 óó ðð. ×Ñó"ó ð"ð óó ðð óó ðôBô$*ð ó0ó ð0ô*ô=ô:!ô
ô(&/ôP:ô<ô<ôô0ô<=ô#ö**@ðZ RVð;Ø4ð;ØCNð;à	%÷;ð ;r   rQ   z^([0-9]+)((?:a|b|c|rc)[0-9]+)$c                ó2  • / nU R                  S5      u  p#nUR                  U=(       d    S5        UR                  S5       HQ  n[        R	                  U5      nU(       a!  UR                  UR                  5       5        M@  UR                  U5        MS     U$ )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_regexre   ÚextendÚgroups)r   ÚresultÚepochr´   Úrestr7   rk   s          r   r¥   r¥   v  sw   € ð €Fà×'Ñ'¨Ó,�N€EˆdØ
‡M�M�%—,˜3Ôà—
‘
˜3–ˆÜ×$Ñ$ TÓ*ˆÞØ�M‰M˜%Ÿ,™,›.Ö)à�M‰M˜$Öñ  ð €Mr   c                ó4   • U tpU SSR                  U5       3$ )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ØˆW�A�c—h‘h˜t“nÐ%Ð&Ð&r   c                ó8   ^ • [        U 4S jS 5       5      (       + $ )Nc              3  óF   >#   • U  H  nTR                  U5      v •  M     g 7fr   )Ú
startswith)Ú.0r§   Úsegments     €r   Ú	<genexpr>Ú!_is_not_suffix.<locals>.<genexpr>˜  s#   øé € ð Ú1P vˆ×Ñ˜6×"Ð"Ò1Pùs   ƒ!)ÚdevÚaÚbÚrcÚpost)Úany)r   s   `r   r¤   r¤   —  s"   ø€ Üô Ù1Póó ô ð r   c                óÔ  • / / p2UR                  [        [        R                  " S U 5      5      5        UR                  [        [        R                  " S U5      5      5        UR                  U [	        US   5      S  5        UR                  U[	        US   5      S  5        UR                  SS/[        S[	        US   5      [	        US   5      -
  5      -  5        UR                  SS/[        S[	        US   5      [	        US   5      -
  5      -  5        [        [        R                  R                  U5      5      [        [        R                  R                  U5      5      4$ )Nc                ó"   • U R                  5       $ r   ©Úisdigit©Úxs    r   Ú<lambda>Ú_pad_version.<locals>.<lambda>¡  s
   € ¸¿¹¼r   c                ó"   • U R                  5       $ r   r  r  s    r   r  r  ¢  s
   € ¸!¿)¹)¼+r   r   r	   rï   )	rÞ   r¡   r¢   r£   r­   ÚinsertÚmaxÚchainÚfrom_iterable)ÚleftÚrightÚ
left_splitÚright_splits       r   r¬   r¬   �  s3  € Ø  "�ð ×Ñ”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                  óú   • \ rS rSrSr  S     SS jjr\SS j5       r\R                  SS j5       rSS jr	SS jr
SS	 jrSS
 jrSS jrSS jrSS jrSS jr  S       SS jjr S     SS jjrSrg) ÚSpecifierSeti²  zÀ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                ó,  • [        U[        5      (       ad  UR                  S5       Vs/ s H)  o3R                  5       (       d  M  UR                  5       PM+     nn[	        [        [        U5      5      U l        O[	        U5      U l        X l        gs  snf )aL  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   r@   rò   rg   Ú	frozensetÚmaprQ   Ú_specsri   )r$   Ú
specifiersr1   ÚsÚsplit_specifierss        r   rl   ÚSpecifierSet.__init__¹  su   € ô, �j¤#×&Ñ&ð 4>×3CÑ3CÀCÔ3HÓVÒ3H¨aÏGÉGÏI£	 §¡¦	Ñ3HÐÐVô $¤C¬	Ð3CÓ$DÓEˆD�Kô $ JÓ/ˆDŒKð (Õùò  Ws   ©BÁBc                ó�   • U R                   b  U R                   $ U R                  (       d  g [        S U R                   5       5      $ )Nc              3  ó8   #   • U  H  oR                   v •  M     g 7fr   ©r1   ©rÿ   r"  s     r   r  Ú+SpecifierSet.prereleases.<locals>.<genexpr>î  s   é € Ð6ª+ Q—=–=ª+ùó   ‚)ri   r   r  r#   s    r   r1   ÚSpecifierSet.prereleasesß  s?   € ð ×ÑÑ(Ø×$Ñ$Ð$ð
 �{�{Øô Ñ6¨$¯+ª+Ó6Ó6Ð6r   c                ó   • Xl         g r   ru   r4   s     r   r1   r+  ð  rv   r   c                ód   • U R                   b  SU R                  < 3OSnS[        U 5      < U S3$ )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)>
r~   r   z<SpecifierSet(r�   )ri   r1   r@   rƒ   s     r   r…   ÚSpecifierSet.__repr__ô  sD   € ð × Ñ Ñ,ð ˜T×-Ñ-Ñ0Ñ1àð 	ð  ¤ D£	™}¨S¨E°Ð4Ð4r   c                óX   • SR                  [        S U R                   5       5      5      $ )a6  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  ó8   #   • U  H  n[        U5      v •  M     g 7fr   )r@   r(  s     r   r  Ú'SpecifierSet.__str__.<locals>.<genexpr>  s   é € Ð;ª{¨!œs 1Ÿv˜vª{ùr*  )rú   Úsortedr   r#   s    r   r%   ÚSpecifierSet.__str__	  s"   € ð �x‰xœÑ;¨t¯{ª{Ó;Ó;Ó<Ð<r   c                ó,   • [        U R                  5      $ r   )r‘   r   r#   s    r   r)   ÚSpecifierSet.__hash__  s   € Ü�D—K‘KÓ Ð r   c                ó   • [        U[        5      (       a  [        U5      nO[        U[        5      (       d  [        $ [        5       n[	        U R
                  UR
                  -  5      Ul        U R                  c   UR                  b  UR                  Ul        U$ U R                  b   UR                  c  U R                  Ul        U$ U R                  UR                  :X  a  U R                  Ul        U$ [        S5      e)aR  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   r@   r  r”   r  r   ri   Ú
ValueError)r$   r-   Ú	specifiers      r   Ú__and__ÚSpecifierSet.__and__  sé   € ô �eœS×!Ñ!Ü  Ó'‰EÜ˜E¤<×0Ñ0Ü!Ð!ä “Nˆ	Ü$ T§[¡[°5·<±<Ñ%?Ó@ˆ	Ôà×ÑÑ$¨×);Ñ);Ñ)GØ%*×%7Ñ%7ˆIÔ"ð Ðð ×ÑÑ*¨u×/AÑ/AÑ/IØ%)×%6Ñ%6ˆIÔ"ð Ðð ×Ñ %×"4Ñ"4Ó4Ø%)×%6Ñ%6ˆIÔ"ð Ðô	 ØXóð r   c                óÊ   • [        U[        [        45      (       a  [        [        U5      5      nO[        U[        5      (       d  [        $ U R
                  UR
                  :H  $ )a1  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   r@   rQ   r  r”   r   r,   s     r   r.   ÚSpecifierSet.__eq__8  sJ   € ô& �eœc¤9Ð-×.Ñ.Ü ¤ U£Ó,‰EÜ˜E¤<×0Ñ0Ü!Ð!à�{‰{˜eŸl™lÑ*Ð*r   c                ó,   • [        U R                  5      $ )z7Returns the number of specifiers in this specifier set.)r­   r   r#   s    r   Ú__len__ÚSpecifierSet.__len__R  s   € ä�4—;‘;ÓÐr   c                ó,   • [        U R                  5      $ )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__ÚSpecifierSet.__iter__V  s   € ô �D—K‘KÓ Ð r   c                ó$   • U R                  U5      $ )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 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×   ÚSpecifierSet.__contains__`  rÙ   r   c                ó0  ^^• [        T[        5      (       d  [        T5      mTc  U R                  mT(       d  TR                  (       a  gU(       a&  TR                  (       a  [        TR                  5      m[        UU4S jU R                   5       5      $ )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  óB   >#   • U  H  oR                  TTS 9v •  M     g7f)r'  NrÕ   )rÿ   r"  r7   r1   s     €€r   r  Ú(SpecifierSet.contains.<locals>.<genexpr>¬  s   øé € ÐRÂkÀ—:‘:˜d°�:Õ<Âkùs   ƒ)r   r   r1   rr   rÇ   Úallr   )r$   r7   r1   Ú	installeds    `` r   r8   ÚSpecifierSet.containsu  sp   ù€ ô< ˜$¤×(Ñ(Ü˜4“=ˆDð
 ÑØ×*Ñ*ˆKö ˜t×1×1Øæ˜×+×+Ü˜4×,Ñ,Ó-ˆDô ÕRÀdÇkÂkÓRÓRÐRr   c                ó¸  • Uc  U R                   nU R                  (       a7  U R                   H  nUR                  U[        U5      S9nM     [	        U5      $ / n/ nU HS  n[        U5      nUR                  (       a#  U(       d  U(       d  UR                  U5        M@  MB  UR                  U5        MU     U(       d  U(       a  Uc  [	        U5      $ [	        U5      $ )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'  )r1   r   r<   rE   rA  r   rr   rÞ   )r$   r;   r1   rj   Úfilteredrà   r7   râ   s           r   r<   ÚSpecifierSet.filter®  sÃ   € ðX ÑØ×*Ñ*ˆKð
 �;�;ØŸœ�ØŸ;™; x¼TÀ+Ó=N˜;ÐO’ñ $ä˜“>Ð!ð
 24ˆHØ:<Ðã �Ü!0°Ó!6�ð "×/×/¾Þ#Ø)×0Ñ0°Ö6ñ $ð —O‘O DÖ)ñ !ö Ö 1°kÑ6IÜÐ-Ó.Ð.ä˜“>Ð!r   )ri   r   rä   )r!  zstr | Iterable[Specifier]r1   rG   r?   rI   rF   rH   r>   rA   )r-   zSpecifierSet | strr?   r  rC   )r?   zIterator[Specifier])r7   ræ   r?   rE   )NN)r7   ræ   r1   rG   rJ  rG   r?   rE   r   rJ   )r   r   r   r   r   rl   rM   r1   rN   r…   r%   r)   r9  r.   r>  rB  r×   r8   r<   r   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"ð M"r   r  )r   ræ   r?   r   )r   r@   r?   ú	list[str])rû   rO  r?   r@   )r   r@   r?   rE   )r  rO  r  rO  r?   ztuple[list[str], list[str]])"r   Ú
__future__r   rK   r¢   ré   Útypingr   r   r   r   r   Úutilsr
   r   r   r@   ræ   r   rE   rå   r   r7  r   ÚABCMetar    rQ   rê   ró   r¥   r    r¤   r¬   r  r   r   r   Ú<module>rT     s¸   ðñõ #ã 
Û Û 	ß ?Õ ?å 'Ý à˜ ˜Ñ%€ÙÐ1¸ÑIÐ Ø˜W c˜N¨DÐ0Ñ1Ð ôô	�zô 	ô4˜cŸk™kò 4ônM�ô Mð` —
’
Ð<Ó=€ôô,'ôôô*I"�=õ I"r   