+
    Îiu                       R t ^ RIHt ^ RIt^ RIt^ RIt^ RIHtHtH	t	H
t
HtHt ^RIHt ^RIHtHt ]]]3,          t]! R]R7      t]]].]3,          tR R	 ltR
 R ltR R lt ! R R]4      t ! R R]P8                  R7      t ! R R]4      t]P>                  ! R4      t R R lt!R R lt"R R lt#R R lt$ ! R R]4      t%R# ) z
.. testsetup::

    from pip._vendor.packaging.specifiers import Specifier, SpecifierSet, InvalidSpecifier
    from pip._vendor.packaging.version import Version
)annotationsN)CallableFinalIterableIteratorTypeVarUnion)canonicalize_version)InvalidVersionVersionUnparsedVersionVar)boundc                    V ^8  d   QhRRRR/# )   versionUnparsedVersionreturnVersion | None )formats   "o/Users/ahmad/.openclaw/workspace/scripts/.venv/lib/python3.14/site-packages/pip/_vendor/packaging/specifiers.py__annotate__r      s      _      c                r    \        V \        4      '       g    \        V 4      p V # V #   \         d     R # i ; iN)
isinstancer   r
   r   s   &r   _coerce_versionr      s=    gw''	g&G N7N  		s   ' 66c                    V ^8  d   QhRRRR/# r   r   r   r   r   )r   s   "r   r   r   #   s     + +W + +r   c                &    V P                  R R7      # )N)local__replace__r   s   &r   _public_versionr$   #   s    T**r   c                    V ^8  d   QhRRRR/# r   r   )r   s   "r   r   r   '   s     J J7 Jw Jr   c                ,    V P                  R R R R R7      # )N)prepostdevr!   r"   r   s   &r   _base_versionr*   '   s    4dDIIr   c                      ] tR t^+tRtRtR# )InvalidSpecifierz
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'
r   N)__name__
__module____qualname____firstlineno____doc____static_attributes__r   r   r   r,   r,   +   s    r   r,   c                  l   ] tR t^7tRtRt]R R l4       t]P                  R R l4       t
]P                  R R l4       t]P                  R R l4       t]]P                  R	 R
 l4       4       t]P                  R R l4       t]P                  RR R ll4       t]P                  RR R ll4       tRtR# )BaseSpecifierc                   V ^8  d   QhRR/# r   r   strr   )r   s   "r   r   BaseSpecifier.__annotate__<   s      c r   c                    \        V 4      # )z Internal property for match_argsr7   selfs   &r   _strBaseSpecifier._str;   s     4yr   c                   V ^8  d   QhRR/# r6   r   )r   s   "r   r   r8   A   s       r   c                    R# )zv
Returns the str representation of this Specifier-like object. This
should be representative of the Specifier itself.
Nr   r;   s   &r   __str__BaseSpecifier.__str__@       r   c                   V ^8  d   QhRR/# r   r   intr   )r   s   "r   r   r8   H   s      # r   c                    R# )z6
Returns a hash value for this Specifier-like object.
Nr   r;   s   &r   __hash__BaseSpecifier.__hash__G   rC   r   c                    V ^8  d   QhRRRR/# r   otherobjectr   boolr   )r   s   "r   r   r8   N   s      F t r   c                    R# )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<   rL   s   &&r   __eq__BaseSpecifier.__eq__M   rC   r   c                   V ^8  d   QhRR/# r   r   bool | Noner   )r   s   "r   r   r8   X   s      [ r   c                    R# )zWhether 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.prereleasesV   rC   r   c                    V ^8  d   QhRRRR/# )r   valuerN   r   Noner   )r   s   "r   r   r8   `   s       $ r   c                    R# )zASetter for :attr:`prereleases`.

:param value: The value to set.
Nr   r<   rZ   s   &&r   rW   rX   _   rC   r   Nc               $    V ^8  d   QhRRRRRR/# )r   itemr7   rW   rU   r   rN   r   )r   s   "r   r   r8   g   s!      S { d r   c                    R# )zB
Determines if the given item is contained within this specifier.
Nr   r<   r_   rW   s   &&&r   containsBaseSpecifier.containsf   rC   r   c               $    V ^8  d   QhRRRRRR/# r   iterablezIterable[UnparsedVersionVar]rW   rU   r   zIterator[UnparsedVersionVar]r   )r   s   "r   r   r8   m   s$      4CN	%r   c                    R# )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<   rf   rW   s   &&&r   filterBaseSpecifier.filterl   rC   r   r   )r=   r   )r-   r.   r/   r0   	__slots____match_args__propertyr=   abcabstractmethodrA   rH   rQ   rW   setterrb   rh   r2   r   r   r   r4   r4   7   s    IN  	  	 
 	       	 
 	 r   r4   )	metaclassc                  N   ] tR t^vt$ RtRHtRtRt]P                  ! R],           ],           R,           ]P                  ]P                  ,          4      tRRRRR	R
RRRRRRRRRR/tR]R&   RIR R lltR R ltR R lt]R R l4       t]P(                  R  R! l4       t]R" R# l4       t]R$ R% l4       tR& R' ltR( R) lt]R* R+ l4       tR, R- ltR. R/ ltR0 R1 ltR2 R3 ltR4 R5 ltR6 R7 ltR8 R9 lt R: R; lt!R< R= lt"R> R? lt#R@ RA lt$RB RC lt%RJRD RE llt&RJRF RG llt'RHt(R# )K	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*~=
compatible==equal!=	not_equalz<=less_than_equal>=greater_than_equal<	less_than>greater_than===	arbitraryr   
_operatorsNc               $    V ^8  d   QhRRRRRR/# )r   specr7   rW   rU   r   r[   r   )r   s   "r   r   Specifier.__annotate__   s!     > >S >K >4 >r   c                
   V P                   P                  V4      pV'       g   \        RV: 24      hVP                  R4      P	                  4       VP                  R4      P	                  4       3V n        W n        RV n        R# )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	fullmatchr,   groupstrip_spec_prereleases_spec_version)r<   r   rW   matchs   &&& r   __init__Specifier.__init__   su     %%d+"%8#ABB KK
#))+KK	"((*'

 ( :>r   c                    V ^8  d   QhRRRR/# )r   r   r7   r   r   r   )r   s   "r   r   r     s     
! 
! 
! 
!r   c                    V P                   e,   V P                   ^ ,          V8X  d   V P                   ^,          # \        V4      pVf   R# W3V n         V# )zDOne element cache, as only one spec Version is needed per Specifier.N)r   r   )r<   r   version_specifiers   && r   _get_spec_versionSpecifier._get_spec_version  sV    )d.@.@.Cw.N%%a((+G4$%9  r   c                    V ^8  d   QhRRRR/# )r   r   r7   r   r   r   )r   s   "r   r   r     s      S W r   c                4    V P                  V4      pVf   Q hV# )zGet spec version, asserting it's valid (not for === operator).

This method should only be called for operators where version
strings are guaranteed to be valid PEP 440 versions (not ===).
)r   )r<   r   spec_versions   && r   _require_spec_versionSpecifier._require_spec_version  s&     --g6'''r   c                   V ^8  d   QhRR/# rT   r   )r   s   "r   r   r   &  s      [ r   c                	    V P                   e   V P                   # V P                  w  rVR8w  dL   VR8X  d   VP                  R4      '       d   R# V P                  V4      pVf   R # VP                  '       d   R# R# )Nrw   ru   .*FT)r   r   endswithr   is_prerelease)r<   r   version_strr   s   &   r   rW   Specifier.prereleases%  s}     ($$$ !%

t 4K$8$8$>$> ,,[9G $$$r   c                    V ^8  d   QhRRRR/# r   rZ   rU   r   r[   r   )r   s   "r   r   r   C       " " " "r   c                	    Wn         R # r   r   r]   s   &&r   rW   r   B      !r   c                   V ^8  d   QhRR/# r6   r   )r   s   "r   r   r   G  s      # r   c                (    V P                   ^ ,          # )zHThe operator of this specifier.

>>> Specifier("==1.2.3").operator
'=='
r   r;   s   &r   r   Specifier.operatorF       zz!}r   c                   V ^8  d   QhRR/# r6   r   )r   s   "r   r   r   P  s       r   c                (    V P                   ^,          # )zIThe version of this specifier.

>>> Specifier("==1.2.3").version
'1.2.3'
r   r;   s   &r   r   Specifier.versionO  r   r   c                   V ^8  d   QhRR/# r6   r   )r   s   "r   r   r   X  s     B B# Br   c                    V P                   e   RV P                  : 2MRpRV P                  P                   R\	        V 4      : V R2# )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|   ()>)r   rW   	__class__r-   r7   r<   r'   s   & r   __repr__Specifier.__repr__X  sU       , T--01 	 4>>**+1SYM#bAAr   c                   V ^8  d   QhRR/# r6   r   )r   s   "r   r   r   j  s     * * *r   c                6    RP                   ! V P                  !  # )zA 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{}{})r   r   r;   s   &r   rA   Specifier.__str__j  s     }}djj))r   c                   V ^8  d   QhRR/# )r   r   ztuple[str, str]r   )r   s   "r   r   r   u  s     + + +r   c                	    V P                   w  rVR 8X  g   VP                  R4      '       d   W3# V P                  V4      p\        W1R8g  R7      pW3# )r   r   rs   strip_trailing_zero)r   r   r   r	   )r<   r   r   r   canonical_versions   &    r   _canonical_specSpecifier._canonical_spect  s]     JJu 0 0 6 6$$11':04/?
 **r   c                   V ^8  d   QhRR/# rE   r   )r   s   "r   r   r     s     * *# *r   c                	,    \        V P                  4      # r   )hashr   r;   s   &r   rH   Specifier.__hash__  s    D(())r   c                    V ^8  d   QhRRRR/# rK   r   )r   s   "r   r   r     s     = =F =t =r   c                   \        V\        4      '       d    V P                  \        V4      4      pM!\        WP                  4      '       g   \        # V P
                  VP
                  8H  #   \         d
    \        u # i ; i)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   r7   r   r,   NotImplementedr   rP   s   &&r   rQ   Specifier.__eq__  sm    & eS!!&s5z2 E>>22!!##u'<'<<< $ &%%&s   A- -B Bc                    V ^8  d   QhRRRR/# )r   opr7   r   CallableOperatorr   )r   s   "r   r   r     s     ! ! !(8 !r   c                	F    \        V R V P                  V,           24      pV# )	_compare_)getattrr   )r<   r   operator_callables   && r   _get_operatorSpecifier._get_operator  s+    .5Idoob123/
 ! r   c               $    V ^8  d   QhRRRRRR/# r   prospectiver   r   r7   r   rN   r   )r   s   "r   r   r     s!     
 
w 
c 
d 
r   c           
     	    \        \        \        P                  ! \        \        V4      4      4      R R 4      pVR,          pV P                  R4      ! W4      ;'       d    V P                  R4      ! W4      # )Nr   rz   ru   )_version_joinlist	itertools	takewhile_is_not_suffix_version_splitr   )r<   r   r   prefixs   &&& r   _compare_compatibleSpecifier._compare_compatible  ss     $$^^D5IJKCRP

 	$!!$': 
 
t?Q?QRV?W@
 	
r   c               $    V ^8  d   QhRRRRRR/# r   r   )r   s   "r   r   r     s!     &/ &/' &/ &/ &/r   c                	J   VP                  R 4      '       d\   \        \        V4      RR7      p\        VRR RR7      p\        V4      p\        V4      p\	        We4      w  rxVR\        V4       p	W8H  # V P                  V4      p
V
P                  '       g   \        V4      pW8H  # )r   Fr   N)r   r	   r$   r   _pad_versionlenr   r!   )r<   r   r   normalized_prospectivenormalized_spec
split_specsplit_prospectivepadded_prospective_shortened_prospectiver   s   &&&        r   _compare_equalSpecifier._compare_equal  s    ==%9,%&" 349RWXO (8J
 !//E F %11B$O!
 %77HZ$I!(66  55d;L
  %%%-k:..r   c               $    V ^8  d   QhRRRRRR/# r   r   )r   s   "r   r   r     s!     : :g :S :T :r   c                	.    V P                  W4      '       * # r   )r   r<   r   r   s   &&&r   _compare_not_equalSpecifier._compare_not_equal  s    &&{999r   c               $    V ^8  d   QhRRRRRR/# r   r   )r   s   "r   r   r     s&     P PG P3 P4 Pr   c                	<    \        V4      V P                  V4      8*  # r   r$   r   r   s   &&&r   _compare_less_than_equal"Specifier._compare_less_than_equal       {+t/I/I$/OOOr   c               $    V ^8  d   QhRRRRRR/# r   r   )r   s   "r   r   r     s&     P Pw Pc Pd Pr   c                	<    \        V4      V P                  V4      8  # r   r   r   s   &&&r   _compare_greater_than_equal%Specifier._compare_greater_than_equal  r   r   c               $    V ^8  d   QhRRRRRR/# r   r   r   spec_strr7   r   rN   r   )r   s   "r   r   r     s!      g   r   c                	    V P                  V4      pW8  g   R # VP                  '       g.   VP                  '       d   \        V4      \        V4      8X  d   R # R# FT)r   r   r*   r<   r   r  r   s   &&& r   _compare_less_thanSpecifier._compare_less_than  sS     ))(3
 ! """)))k*mD.AA
 r   c               $    V ^8  d   QhRRRRRR/# r  r   )r   s   "r   r   r     s!          C  D  r   c                	   V P                  V4      pW8  g   R # VP                  '       g.   VP                  '       d   \        V4      \        V4      8X  d   R # VP                  e   \        V4      \        V4      8X  d   R # R# r  )r   is_postreleaser*   r!   r  s   &&& r   _compare_greater_thanSpecifier._compare_greater_than  s}     ))(3
 ! ###***k*mD.AA (].
4 .! 
 r   c               $    V ^8  d   QhRRRRRR/# )r   r   zVersion | strr   r7   r   rN   r   )r   s   "r   r   r   0  s!     = =m =3 =4 =r   c                	h    \        V4      P                  4       \        V4      P                  4       8H  # r   )r7   lowerr   s   &&&r   _compare_arbitrarySpecifier._compare_arbitrary0  s&    ;%%'3t9??+<<<r   c                    V ^8  d   QhRRRR/# )r   r_   zstr | Versionr   rN   r   )r   s   "r   r   r   3  s     # # #4 #r   c                $    V P                  V4      # )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")
True
>>> "1.3.0a1" in Specifier(">=1.2.3", prereleases=True)
True
rb   r<   r_   s   &&r   __contains__Specifier.__contains__3      & }}T""r   c               $    V ^8  d   QhRRRRRR/# )r   r_   r   rW   rU   r   rN   r   )r   s   "r   r   r   H  s'     H H_ H; HRV Hr   c           	     N    \        \        V P                  V.VR7      4      4      # )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 will follow the recommendation from
    :pep:`440` and match prereleases, as there are no other versions.

>>> 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")
True
>>> Specifier(">=1.2.3", prereleases=False).contains("1.3.0a1")
False
>>> Specifier(">=1.2.3").contains("1.3.0a1")
True
rW   )rN   r   rh   ra   s   &&&r   rb   Specifier.containsH  s#    2 DdVEFGGr   c               $    V ^8  d   QhRRRRRR/# re   r   )r   s   "r   r   r   c  s$     <, <,4<,CN<,	%<,r   c              #  >  "   . pRpVe   TMV P                   pV P                  V P                  4      pV F  p\        V4      pVf=   V P                  R8X  d*   V P	                  WpP
                  4      '       d   Vx  KJ  KL  KN  V! WP
                  4      '       g   Kh  VP                  '       d	   V'       d	   RpVx  K  Ve   K  V P                  RJg   K  VP                  V4       K  	  V'       g%   Vf   V P                  RJd   T Rj  xL
  R# R# R# R#  L5i)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 follow the recommendation from :pep:`440`
    and match prereleases if there are no other versions.

>>> 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']
FNr   T)	rW   r   r   r   r  r   r   r   append)	r<   rf   rW   prereleases_versionsfound_non_prereleasesinclude_prereleasesr   r   parsed_versions	   &&&      r   rh   Specifier.filterc  s    0  " % '2K8H8H 	
 !..t}}=  G,W5N%==E)d.E.E\\/ / "M/) #><<@@%3337J,0)!M (T->->e-K(//8  ( &#!!.+++ / $ & ,s6   BDD0D8	DDD5DDD)r   r   r   r   Nr   ))r-   r.   r/   r0   r1   rj   _operator_regex_str_version_regex_strrecompileVERBOSE
IGNORECASEr   r   __annotations__r   r   r   rl   rW   ro   r   r   r   rA   r   rH   rQ   r   r   r   r   r   r   r  r  r  r  rb   rh   r2   r   r   r   rr   rr   v   sb    ;I\| ZZ$$'99FB


R]]"F 	lgk"[^{	J 	>8
!  8 " "    B$* + +*=:!
(&/P:PP6 D=#*H6<, <,r   rr   z([0-9]+)((?:a|b|c|rc)[0-9]+)c                    V ^8  d   QhRRRR/# )r   r   r7   r   	list[str]r   )r   s   "r   r   r     s      C I r   c                6   . pV P                  R4      w  r#pTP                  T;'       g    R4       VP                  R4       FR  p\        P	                  V4      pV'       d"   VP                  VP                  4       4       KA  VP                  V4       KT  	  V# )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_regexr   extendgroups)r   resultepochr   restr_   r   s   &      r   r   r     sy     F'',NEd
MM%,,3

3''-MM%,,.)MM$   Mr   c                    V ^8  d   QhRRRR/# )r   
componentsr/  r   r7   r   )r   s   "r   r   r     s     ' 'i 'C 'r   c                4    V vrV RRP                  V4       2# )zJoin 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.
r1  r3  )join)r=  r:  r;  s   &  r   r   r     s%     LEWAchhtn%&&r   c                    V ^8  d   QhRRRR/# )r   segmentr7   r   rN   r   )r   s   "r   r   r     s      C D r   c                   a  \         ;QJ d)    V 3R  lR 4       F  '       g   K   R'       * # 	  R'       * # ! V 3R  lR 4       4      '       * # )c              3  F   <"   T F  pSP                  V4      x  K  	  R # 5ir   )
startswith).0r   rA  s   & r   	<genexpr>!_is_not_suffix.<locals>.<genexpr>  s#      1Pv6""1Ps   !TF)r)   abrcr(   )any)rA  s   fr   r   r     sM    s 1Pss  s  s 1P   r   c               $    V ^8  d   QhRRRRRR/# )r   leftr/  rightr   ztuple[list[str], list[str]]r   )r   s   "r   r   r     s"      y  7R r   c                $   . . r2VP                  \        \        P                  ! R  V 4      4      4       VP                  \        \        P                  ! R V4      4      4       VP                  V \	        V^ ,          4      R 4       VP                  V\	        V^ ,          4      R 4       VP                  ^R.\        ^ \	        V^ ,          4      \	        V^ ,          4      ,
          4      ,          4       VP                  ^R.\        ^ \	        V^ ,          4      \	        V^ ,          4      ,
          4      ,          4       \        \        P                  P                  V4      4      \        \        P                  P                  V4      4      3# )c                "    V P                  4       # r   isdigitxs   &r   <lambda>_pad_version.<locals>.<lambda>  s
    r   c                "    V P                  4       # r   rQ  rS  s   &r   rU  rV    s
    !))+r   Nr2  )	r   r   r   r   r   insertmaxchainfrom_iterable)rM  rN  
left_splitright_splits   &&  r   r   r     s3    " d9../DdKLMtI//0EuMNO d3z!}-/01uSQ0234 a#QKN(;c*Q->P(P!QQRq3%#aZ]);c+a.>Q)Q"RRS 	Y__**:67Y__**;78 r   c                      ] tR tRtRtRtRR R llt]R R l4       t]P                  R R	 l4       tR
 R lt
R R ltR R ltR R ltR R ltR R ltR R ltR R ltR R R lltR!R R lltRtR# )"SpecifierSeti  zThis 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               $    V ^8  d   QhRRRRRR/# )r   
specifierszstr | Iterable[Specifier]rW   rU   r   r[   r   )r   s   "r   r   SpecifierSet.__annotate__  s(     $( $(-$( !$( 
	$(r   c                0   \        V\        4      '       de   VP                  R4       Uu. uF*  q3P                  4       '       g   K  VP                  4       NK,  	  pp\	        \        \        V4      4      V n        M\	        V4      V n        W n        R# u upi )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   r7   r5  r   	frozensetmaprr   _specsr   )r<   ra  rW   ssplit_specifierss   &&&  r   r   SpecifierSet.__init__  su    , j#&& 4>3C3CC3HV3HaGGI		3HV $C	3C$DEDK $J/DK (  Ws   BBc                   V ^8  d   QhRR/# rT   r   )r   s   "r   r   rb    s      [ r   c                	   V P                   e   V P                   # V P                  '       g   R # \        ;QJ d&    R V P                   4       F  '       g   K   RM	  RM! R V P                   4       4      '       d   R# R # )Nc              3  8   "   T F  qP                   x  K  	  R # 5ir   r  rE  rh  s   & r   rF  +SpecifierSet.prereleases.<locals>.<genexpr>  s     2k}}k   TF)r   rg  rK  r;   s   &r   rW   SpecifierSet.prereleases  s[     ($$$
 {{{ 32dkk23332dkk222r   c                    V ^8  d   QhRRRR/# r   r   )r   s   "r   r   rb  %  r   r   c                	    Wn         R # r   r   r]   s   &&r   rW   rq  $  r   r   c                   V ^8  d   QhRR/# r6   r   )r   s   "r   r   rb  (  s     5 5# 5r   c                f    V P                   e   RV P                  : 2MRpR\        V 4      : V R2# )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   )r   rW   r7   r   s   & r   r   SpecifierSet.__repr__(  sD       , T--01 	  D	}SE44r   c                   V ^8  d   QhRR/# r6   r   )r   s   "r   r   rb  =  s     = = =r   c                X    RP                  \        R V P                   4       4      4      # )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'
rd  c              3  8   "   T F  p\        V4      x  K  	  R # 5ir   r:   rn  s   & r   rF  'SpecifierSet.__str__.<locals>.<genexpr>H  s     ;{!s1vv{rp  )r?  sortedrg  r;   s   &r   rA   SpecifierSet.__str__=  s"     xx;t{{;;<<r   c                   V ^8  d   QhRR/# rE   r   )r   s   "r   r   rb  J  s     ! !# !r   c                	,    \        V P                  4      # r   )r   rg  r;   s   &r   rH   SpecifierSet.__hash__J  s    DKK  r   c                    V ^8  d   QhRRRR/# )r   rL   zSpecifierSet | strr   r_  r   )r   s   "r   r   rb  M  s      / L r   c                   \        V\        4      '       d   \        V4      pM\        V\        4      '       g   \        # \        4       p\	        V P
                  VP
                  ,          4      Vn        V P                  f"   VP                  e   VP                  Vn        V# V P                  e   VP                  e   V P                  VP                  8X  d   V P                  Vn        V# \        R4      h)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   r7   r_  r   re  rg  r   
ValueError)r<   rL   	specifiers   && r   __and__SpecifierSet.__and__M  s     eS!! 'EE<00!! N	$T[[5<<%?@	$););)G%*%7%7I"  )e.@.@.H%"4"44%)%6%6I" 	 X r   c                    V ^8  d   QhRRRR/# rK   r   )r   s   "r   r   rb  l  s     + +F +t +r   c                    \        V\        \        34      '       d   \        \        V4      4      pM\        V\        4      '       g   \        # V P
                  VP
                  8H  # )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   r7   rr   r_  r   rg  rP   s   &&r   rQ   SpecifierSet.__eq__l  sJ    & ec9-.. U,EE<00!!{{ell**r   c                   V ^8  d   QhRR/# rE   r   )r   s   "r   r   rb    s          r   c                ,    \        V P                  4      # )z7Returns the number of specifiers in this specifier set.)r   rg  r;   s   &r   __len__SpecifierSet.__len__  s    4;;r   c                   V ^8  d   QhRR/# )r   r   zIterator[Specifier]r   )r   s   "r   r   rb    s     ! !- !r   c                ,    \        V P                  4      # )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')>]
)iterrg  r;   s   &r   __iter__SpecifierSet.__iter__  s     DKK  r   c                    V ^8  d   QhRRRR/# )r   r_   r   r   rN   r   )r   s   "r   r   rb    s     # # #T #r   c                $    V P                  V4      # )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")
True
>>> "1.3.0a1" in SpecifierSet(">=1.0.0,!=1.0.1", prereleases=True)
True
r  r  s   &&r   r  SpecifierSet.__contains__  r  r   c               (    V ^8  d   QhRRRRRRRR/# )r   r_   r   rW   rU   	installedr   rN   r   )r   s   "r   r   rb    s8     &N &N&N !&N 	&N
 
&Nr   c           	         \        V4      pVe   V'       d   VP                  '       d   RpVf   TMTp\        \        V P	                  V.VR7      4      4      # )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 will follow the recommendation from :pep:`440`
    and match prereleases, as there are no other versions.
:param installed:
    Whether or not the item is installed. If set to ``True``, it will
    accept prerelease versions even if the specifier does not allow them.

>>> 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")
True
>>> SpecifierSet(">=1.0.0,!=1.0.1", prereleases=False).contains("1.3.0a1")
False
>>> SpecifierSet(">=1.0.0,!=1.0.1").contains("1.3.0a1", prereleases=True)
True
Tr  )r   r   rN   r   rh   )r<   r_   rW   r  r   
check_items   &&&&  r   rb   SpecifierSet.contains  sQ    @ "$'91F1F1FK$_T'
Dj\{KLMMr   c               $    V ^8  d   QhRRRRRR/# re   r   )r   s   "r   r   rb    s.     [R [R4[RCN[R	%[Rr   c                F  a	 Vf   V P                   e   V P                   pV P                  '       d<   V P                   F  pTP                  Yf   RMTR7      pK  	  Ve   \        V4      # M#VRJ d   \        V4      # VRJ d   V	3R lV 4       # . p. pRpV Fn  p\	        V4      pVf%   VP                  V4       VP                  V4       K6  VP                  '       d   VP                  V4       K[  VP                  V4       RpKp  	  \        V'       d   V4      # T4      # )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 follow the recommendation from :pep:`440`
    and match prereleases if there are no other versions.

>>> 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"]))
['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']
Tr  Fc              3  n   <"   T F*  p\        V4      ;oe   SP                  '       d   K&  Vx  K,  	  R # 5ir   )r   r   )rE  r_   r   s   & r   rF  &SpecifierSet.filter.<locals>.<genexpr>  s3       (#24#88A"00 D (s   #5
5)rW   rg  rh   r  r   r   r   )
r<   rf   rW   r   filtered_itemsfound_prereleasesfound_final_releaser_   r$  r   s
   &&&      @r   rh   SpecifierSet.filter  s3   N 4#3#3#?**K
 ;;; ;;2E$; '  $
 & H~% ' d"H~%e# (  4668#D,T2N %%%d+!((.---!((.%%d+&*#  &9NQQ?PQQr   )r   rg  r&  )NNr   )r-   r.   r/   r0   r1   rj   r   rl   rW   ro   r   rA   rH   r  rQ   r  r  r  rb   rh   r2   r   r   r   r_  r_    s     +I$(L  & " "5*=!>+4 !#*&NP[R [Rr   r_  )&r1   
__future__r   rm   r   r)  typingr   r   r   r   r   r   utilsr	   r   r
   r   r7   r   r   rN   r   r   r$   r*   r  r,   ABCMetar4   rr   r*  r6  r   r   r   r   r_  r   r   r   <module>r     s    # 
  	 F F ' ,%1I WcND01 +J	z 	<ckk <~i, i,X 

:;,'*KR= KRr   