+
    iZ                   ,  a  0 t $ R t^ RIHt ^ RIt^ RIt^ RIt^ RIt^ RIt^ RI	t	^ RI
t
^ RI
HtHtHtHtHtHtHtHtHt ^RIHt ^RIHtHt ]	P2                  RJ8  d   ^ RI
Ht M]'       d   ^ RIHt . RKOtR R ltR R ltR R lt]! R4      t ]]]!3,          t"]! R]"R7      t#]]]!.]$3,          t%]! R4      t&R]'R&   R R lt( ! R R]PR                  4      t*]PV                   ! R R4      4       t,]PV                   ! R R4      4       t-]PV                   ! R R 4      4       t.]
P                  '       d   ]]],R3,          t/]0]-].3,          t1]-! RR!4      t2].! RR!4      t3]2]333t4R"]'R#&   R$ R% lt5R& R' lt6R( R) lt7R* R+ lt8R, R- lt9R. R/ lt:R0 R1 lt;R2 R3 lt<R4 R5 lt= ! R6 R]>4      t? ! R7 R]P                  R87      tA ! R9 R	]A4      tB]P                  ! R:4      tDR; R< ltER= R> ltFR? R@ ltGRA RB ltHRC RD ltIRE RF ltJRG RH ltK ! RI R
]A4      tLR# )Lz
.. testsetup::

    from packaging.specifiers import Specifier, SpecifierSet, InvalidSpecifier
    from packaging.version import Version
)annotationsN)	TYPE_CHECKINGAnyCallableFinalIterableIteratorSequenceTypeVarUnion)canonicalize_version)InvalidVersionVersion)	TypeGuardBaseSpecifierInvalidSpecifier	SpecifierSpecifierSetc                   V ^8  d   QhRR/# )   return	list[str] )formats   "`/home/piyush/.cache/uv/builds-v0/.tmpPfdyTF/lib/python3.14/site-packages/packaging/specifiers.py__annotate__r   0   s           c                     \         # N)__all__r   r   r   __dir__r    0   s    Nr   c                    V ^8  d   QhRRRR/# )r   specobjectr   zTypeGuard[tuple[str, str]]r   )r   s   "r   r   r   4   s       'A r   c                   \        V \        4      ;'       dM    \        V 4      ^8H  ;'       d7    \        V ^ ,          \        4      ;'       d    \        V ^,          \        4      # )r   )
isinstancetuplelenstr)r"   s   "r   _validate_specr)   4   sX    4 	% 	%IN	% 	%tAw$	% 	% tAw$	r   c                    V ^8  d   QhRRRR/# )r   prer#   r   zTypeGuard[bool | None]r   )r   s   "r   r   r   =   s     0 0v 0%; 0r   c               :    V R J ;'       g    \        V \        4      # r   )r%   bool)r+   s   "r   _validate_prer.   =   s    $;//*S$//r   TUnparsedVersionVar)boundz0.dev0zFinal[Version]_MIN_VERSIONc                    V ^8  d   QhRRRR/# )r   releaseztuple[int, ...]r   r   )r   s   "r   r   r   J   s     = =? = =r   c                    \        V 4      pV^8  d    W^,
          ,          ^ 8X  d   V^,          pK&  V\        V 4      8X  d   V # V RV # )zDStrip trailing zeros from a release tuple for normalized comparison.N)r'   )r4   ends   & r   _trim_releaser7   J   sE    
g,C
'gAg&!+qS\)7<wt}<r   c                  ^    ] tR t^RtRt]P                  ! 4       t]P                  ! 4       tRt	R# )_BoundaryKindz5Where a boundary marker sits in the version ordering.r   N)
__name__
__module____qualname____firstlineno____doc__enumautoAFTER_LOCALSAFTER_POSTS__static_attributes__r   r   r   r9   r9   R   s    ?99;L))+Kr   r9   c                  f    ] tR t^YtRtR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tR# )_BoundaryVersiona  A point on the version line between two real PEP 440 versions.

Some specifier semantics imply boundaries between real versions:
``<=1.0`` includes ``1.0+local`` and ``>1.0`` excludes
``1.0.post0``.  No real :class:`Version` falls on those boundaries,
so this class creates values that sort between the real versions
on either side.

Two kinds exist, shown relative to a base version V::

    V < V+local < AFTER_LOCALS(V) < V.post0 < AFTER_POSTS(V)

``AFTER_LOCALS`` sits after V and every V+local, but before
V.post0.  Upper bound of ``<=V``, ``==V``, ``!=V``.

``AFTER_POSTS`` sits after every V.postN, but before the next
release segment.  Lower bound of ``>V`` (final or pre-release V)
to exclude post-releases per PEP 440.
c               $    V ^8  d   QhRRRRRR/# )r   versionr   kindr9   r   Noner   )r   s   "r   r   _BoundaryVersion.__annotate__q   s!     ? ? ?} ? ?r   c                	R    Wn         W n        \        VP                  4      V n        R # r   )rG   _kindr7   r4   _trimmed_release)selfrG   rH   s   &&&r   __init___BoundaryVersion.__init__q   s    
 -goo >r   c                    V ^8  d   QhRRRR/# )r   otherr   r   r-   r   )r   s   "r   r   rJ   v   s     < < <D <r   c                   V P                   pVP                  VP                  8X  d@   \        VP                  4      V P                  8X  d   VP
                  VP
                  8X  g   R# V P                  \        P                  8X  d;   VP                  VP                  8H  ;'       d    VP                  VP                  8H  # VP                  VP                  8H  ;'       g    VP                  RJ# )z6Is ``other`` a version that this boundary sorts above?FN)rG   epochr7   r4   rM   r+   rL   r9   rA   postdev)rN   rR   vs   && r   
_is_family_BoundaryVersion._is_familyv   s    LLKK177"emm,0E0EE		QUU"::333::'>>EII,>>yyAEE!;;UZZt%;;r   c                    V ^8  d   QhRRRR/# r   rR   r#   r   r-   r   )r   s   "r   r   rJ      s      F t r   c                	    \        V\        4      '       d;   V P                  VP                  8H  ;'       d    V P                  VP                  8H  # \        # r   )r%   rE   rG   rL   NotImplementedrN   rR   s   &&r   __eq___BoundaryVersion.__eq__   s>    e-..<<5==0NNTZZ5;;5NNr   c                    V ^8  d   QhRRRR/# )r   rR   z_BoundaryVersion | Versionr   r-   r   )r   s   "r   r   rJ      s     C C6 C4 Cr   c                	J   \        V\        4      '       db   V P                  VP                  8w  d   V P                  VP                  8  # V P                  P                  VP                  P                  8  # V P                  V4      '       * ;'       d    V P                  V8  # r   )r%   rE   rG   rL   valuerX   r^   s   &&r   __lt___BoundaryVersion.__lt__   su    e-..||u}},||emm33::##ekk&7&777??5))BBdllU.BBr   c                   V ^8  d   QhRR/# r   r   intr   )r   s   "r   r   rJ      s     0 0# 0r   c                	D    \        V P                  V P                  34      # r   )hashrG   rL   rN   s   &r   __hash___BoundaryVersion.__hash__   s    T\\4::.//r   c                   V ^8  d   QhRR/# r   r   r(   r   )r   s   "r   r   rJ      s     Q Q# Qr   c                	~    V P                   P                   R V P                  : RV P                  P                   R2# )(z, ))	__class__r:   rG   rL   namerk   s   &r   __repr___BoundaryVersion.__repr__   s4    ..))*!DLL+;2djjoo=NaPPr   )rL   rM   rG   N)r:   r;   r<   r=   r>   	__slots__rO   rX   r_   rd   rl   ru   rC   r   r   r   rE   rE   Y   s4    ( 9I?
<
C0Q Qr   rE   c                  Z    ] tR t^tRtRtR R ltR R ltR R ltR R	 lt	R
 R lt
RtR# )_LowerBoundzLower bound of a version range.

A version *v* of ``None`` means unbounded below (-inf).
At equal versions, ``[v`` sorts before ``(v`` because an inclusive
bound starts earlier.
c               $    V ^8  d   QhRRRRRR/# r   rG   _VersionOrBoundary	inclusiver-   r   rI   r   )r   s   "r   r   _LowerBound.__annotate__   "     # # 2 #t # #r   c                	    Wn         W n        R # r   rG   r}   rN   rG   r}   s   &&&r   rO   _LowerBound.__init__       "r   c                    V ^8  d   QhRRRR/# r[   r   )r   s   "r   r   r~           S SF St Sr   c                	    \        V\        4      '       g   \        # V P                  VP                  8H  ;'       d    V P                  VP                  8H  # r   r%   ry   r]   rG   r}   r^   s   &&r   r_   _LowerBound.__eq__   =    %--!!||u}},RR5??1RRr   c                    V ^8  d   QhRRRR/# )r   rR   ry   r   r-   r   )r   s   "r   r   r~           6 6K 6D 6r   c                	D   \        V\        4      '       g   \        # V P                  f   VP                  R J# VP                  f   R# V P                  VP                  8w  d   V P                  VP                  8  # V P                  ;'       d    VP                  '       * # )NFr   r^   s   &&r   rd   _LowerBound.__lt__   sw    %--!!<<==,,== <<5==(<<%--//~~55eoo"55r   c                   V ^8  d   QhRR/# rg   r   )r   s   "r   r   r~           4 4# 4r   c                	D    \        V P                  V P                  34      # r   rj   rG   r}   rk   s   &r   rl   _LowerBound.__hash__       T\\4>>233r   c                   V ^8  d   QhRR/# ro   r   )r   s   "r   r   r~           H H# Hr   c                	    V P                   '       d   R MRpRV P                  P                   RV V P                  : R2# )[rq   < >r}   rs   r:   rG   rN   brackets   & r   ru   _LowerBound.__repr__   s:    #S4>>**+1WIdll5EQGGr   r}   rG   Nr:   r;   r<   r=   r>   rw   rO   r_   rd   rl   ru   rC   r   r   r   ry   ry      /     )I#S
64H Hr   ry   c                  Z    ] tR t^tRtRtR R ltR R ltR R ltR R	 lt	R
 R lt
RtR# )_UpperBoundzUpper bound of a version range.

A version *v* of ``None`` means unbounded above (+inf).
At equal versions, ``v)`` sorts before ``v]`` because an exclusive
bound ends earlier.
c               $    V ^8  d   QhRRRRRR/# r{   r   )r   s   "r   r   _UpperBound.__annotate__   r   r   c                	    Wn         W n        R # r   r   r   s   &&&r   rO   _UpperBound.__init__   r   r   c                    V ^8  d   QhRRRR/# r[   r   )r   s   "r   r   r      r   r   c                	    \        V\        4      '       g   \        # V P                  VP                  8H  ;'       d    V P                  VP                  8H  # r   r%   r   r]   rG   r}   r^   s   &&r   r_   _UpperBound.__eq__   r   r   c                    V ^8  d   QhRRRR/# )r   rR   r   r   r-   r   )r   s   "r   r   r      r   r   c                	,   \        V\        4      '       g   \        # V P                  f   R# VP                  f   R# V P                  VP                  8w  d   V P                  VP                  8  # V P                  '       * ;'       d    VP                  # )NFTr   r^   s   &&r   rd   _UpperBound.__lt__   sk    %--!!<<== <<5==(<<%--//>>!55eoo5r   c                   V ^8  d   QhRR/# rg   r   )r   s   "r   r   r      r   r   c                	D    \        V P                  V P                  34      # r   r   rk   s   &r   rl   _UpperBound.__hash__   r   r   c                   V ^8  d   QhRR/# ro   r   )r   s   "r   r   r      r   r   c                	    V P                   '       d   R MRpRV P                  P                   RV P                  : V R2# )]rr   r   r   r   r   r   s   & r   ru   _UpperBound.__repr__   s:    #S4>>**+1T\\,<WIQGGr   r   Nr   r   r   r   r   r      r   r   r   Fztuple[_VersionRange]_FULL_RANGEc               $    V ^8  d   QhRRRRRR/# )r   lowerry   upperr   r   r-   r   )r   s   "r   r   r      s!     ) ); ){ )t )r   c                    V P                   e   VP                   f   R# V P                   VP                   8X  d&   V P                  ;'       d    VP                  '       * # V P                   VP                   8  # )zHTrue when the range defined by *lower* and *upper* contains no versions.Fr   )r   r   s   &&r   _range_is_emptyr      sT    }} 5}}%OO7788==5==((r   c               $    V ^8  d   QhRRRRRR/# )r   leftSequence[_VersionRange]rightr   list[_VersionRange]r   )r   s   "r   r   r      s&      
!" r   c                "   . p^ ;r4V\        V 4      8  dz   V\        V4      8  dj   W,          w  rVW,          w  rx\        WW4      p	\        Wh4      p
\        W4      '       g   VP	                  W34       Wh8  d   V^,          pK~  V^,          pK  V# )zFIntersect two sorted, non-overlapping range lists (two-pointer merge).)r'   maxminr   append)r   r   result
left_indexright_index
left_lower
left_upperright_lowerright_upperr   r   s   &&         r   _intersect_rangesr      s    
 #%F  J
s4y
 [3u:%=!%!1
#(#5 J,J,u,,MM5.) #!OJ1KMr   c                    V ^8  d   QhRRRR/# r   rG   r   r   r   )r   s   "r   r   r     s     K Kw K7 Kr   c                    . V P                   RR OV P                   R,          ^,           N5p\        P                  ! V P                  V^ R7      # )z5Smallest version in the next prefix: 1.2 -> 1.3.dev0.NrT   r4   rV   )r4   r   
from_partsrT   )rG   r4   s   & r   _next_prefix_dev0r     sC    >$>goob&9A&=>GGMM7JJr   c                    V ^8  d   QhRRRR/# r   r   )r   s   "r   r   r     s     S S SG Sr   c                \    \         P                  ! V P                  V P                  ^ R7      # )z7The .dev0 of a version's base release: 1.2 -> 1.2.dev0.r   )r   r   rT   r4   rG   s   &r   
_base_dev0r     s     GMM7??PQRRr   c                    V ^8  d   QhRRRR/# )r   rG   UnparsedVersionr   Version | Noner   )r   s   "r   r   r   $  s      _  r   c                r    \        V \        4      '       g    \        V 4      p V # V #   \         d     R # i ; ir   )r%   r   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   s   "r   r   r   -  s     + +W + +r   c                F    V P                   f   V # V P                  R R7      # )N)local)r   __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   3  s     @ @ @G @r   c                *    V P                  RRRR7      # )zqThe version that *version* is a post-release of.

1.0.post1 -> 1.0, 1.0a1.post0 -> 1.0a1, 1.0.post0.dev1 -> 1.0.
NrU   rV   r   r   r   s   &r   
_post_baser   3  s    
 Dd$??r   c                    V ^8  d   QhRRRR/# r   r   )r   s   "r   r   r   ;  s     2 2' 2g 2r   c                (    V P                  ^ RR7      # )zREarliest pre-release of *version*.

1.2 -> 1.2.dev0, 1.2.post1 -> 1.2.post1.dev0.
NrV   r   r   r   s   &r   _earliest_prereleaser   ;  s    
 1D11r   c                    V ^8  d   QhRRRR/# )r   rW   r|   r   r   r   )r   s   "r   r   r   C  s     9 999r   c                Z   V f   R# \        V \        4      '       di   V P                  pVP                  '       d   VP	                  RRRR7      # VP
                  e   VP
                  ^,           M^ pVP	                  VRR7      # V P                  '       g   V # V P	                  RRRR7      # )z:Smallest non-pre-release version at or above *v*, or None.N)r+   rV   r   )rU   r   )r%   rE   rG   is_prereleaser   rU   )rW   innerks   &  r   _nearest_non_prereleaser   C  s     	y!%&&		$$4t$DD !&

 6UZZ!^A  at 44???==Tt4=88r   c                      ] tR tRtRtRtR# )r   iX  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'
r   N)r:   r;   r<   r=   r>   rC   r   r   r   r   r   X  s    r   c                     ] tR tRt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]P"                  RR R ll4       t]P                  RR R ll4       tRtR# )r   id  c                   V ^8  d   QhRR/# ro   r   )r   s   "r   r   BaseSpecifier.__annotate__i  s      c r   c                    \        V 4      # )z Internal property for match_argsr(   rk   s   &r   _strBaseSpecifier._strh  s     4yr   c                   V ^8  d   QhRR/# ro   r   )r   s   "r   r   r   n  s       r   c                    R# )zv
Returns the str representation of this Specifier-like object. This
should be representative of the Specifier itself.
Nr   rk   s   &r   __str__BaseSpecifier.__str__m      r   c                   V ^8  d   QhRR/# rg   r   )r   s   "r   r   r   u  s      # r   c                    R# )z6
Returns a hash value for this Specifier-like object.
Nr   rk   s   &r   rl   BaseSpecifier.__hash__t  r   r   c                    V ^8  d   QhRRRR/# r[   r   )r   s   "r   r   r   {  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^   s   &&r   r_   BaseSpecifier.__eq__z  r   r   c                   V ^8  d   QhRR/# r   r   bool | Noner   )r   s   "r   r   r     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   rk   s   &r   prereleasesBaseSpecifier.prereleases  r   r   c                    V ^8  d   QhRRRR/# )r   rc   r-   r   rI   r   )r   s   "r   r   r     s       $ r   c                    R# )zASetter for :attr:`prereleases`.

:param value: The value to set.
Nr   rN   rc   s   &&r   r	  r
    r   r   Nc               $    V ^8  d   QhRRRRRR/# )r   itemr(   r	  r  r   r-   r   )r   s   "r   r   r     s!      S { d r   c                    R# )zB
Determines if the given item is contained within this specifier.
Nr   rN   r  r	  s   &&&r   containsBaseSpecifier.contains  r   r   c               (    V ^8  d   QhRRRRRRRR/# 	r   iterablezIterable[UnparsedVersionVar]r	  r  keyrI   r   zIterator[UnparsedVersionVar]r   )r   s   "r   r   r     2     + +.+ !+ 	+
 
&+r   c                	    R # r   r   rN   r  r	  r  s   &&&&r   filterBaseSpecifier.filter       (+r   c               (    V ^8  d   QhRRRRRRRR/# 	r   r  zIterable[T]r	  r  r  zCallable[[T], UnparsedVersion]r   zIterator[T]r   )r   s   "r   r   r     2       ! ,	
 
r   c                	    R # r   r   r  s   &&&&r   r  r         r   c               (    V ^8  d   QhRRRRRRRR/# 	r   r  Iterable[Any]r	  r  r  'Callable[[Any], UnparsedVersion] | Noner   Iterator[Any]r   )r   s   "r   r   r     s2     	 		 !	 5		
 
	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  s   &&&&r   r  r    r   r   r   )r   r   N.NN)r:   r;   r<   r=   rw   __match_args__propertyr   abcabstractmethodr   rl   r_   r	  setterr  typingoverloadr  rC   r   r   r   r   r   d  s   IN  	  	 
 	       	 
 __+ + __  		 	r   )	metaclassc                     ] tR tRt$ RtRXt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&   RYR R l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4       t]P,                  R& R' l4       tR( R) ltR* R+ lt]R, R- l4       t]R. R/ l4       tR0 R1 ltR2 R3 lt]R4 R5 l4       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$RD RE lt%RF RG lt&RH RI lt'RJ RK lt(RL RM lt)RN RO lt*RZRP RQ llt+],PZ                  R[RR RS ll4       t.],PZ                  R[RT RU ll4       t.R\RV RW llt.RXt/R# )]r   i  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).

Instances are safe to serialize with :mod:`pickle`. They use a stable
format so the same pickle can be loaded in future packaging releases.

.. versionchanged:: 26.2

    Added a stable pickle format. Pickles created with packaging 26.2+ can
    be unpickled with future releases.  Backward compatibility with pickles
    from packaging < 26.2 is supported but may be removed in a future
    release.
a  
        (?:
            (?:
                # 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 .*
                    |
                    (?a:                                  # pre release
                        [-_\.]?
                        (alpha|beta|preview|pre|a|b|c|rc)
                        [-_\.]?
                        [0-9]*
                    )?
                    (?a:                                  # post release
                        (?:-[0-9]+)|(?:[-_\.]?(post|rev|r)[-_\.]?[0-9]*)
                    )?
                    (?a:[-_\.]?dev[-_\.]?[0-9]*)?         # dev release
                    (?a:\+[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.
                (?:<=|>=|<|>)

                \s*
                v?
                (?:[0-9]+!)?          # epoch
                [0-9]+(?:\.[0-9]+)*   # release
                (?a:                   # pre release
                    [-_\.]?
                    (alpha|beta|preview|pre|a|b|c|rc)
                    [-_\.]?
                    [0-9]*
                )?
                (?a:                                   # post release
                    (?:-[0-9]+)|(?:[-_\.]?(post|rev|r)[-_\.]?[0-9]*)
                )?
                (?a:[-_\.]?dev[-_\.]?[0-9]*)?          # dev release
            )
        )
        z\s*~=
compatible==equal!=	not_equal<=less_than_equal>=greater_than_equalr   	less_thanr   greater_than===	arbitraryr   
_operatorsNc               $    V ^8  d   QhRRRRRR/# )r   r"   r(   r	  r  r   rI   r   )r   s   "r   r   Specifier.__annotate__=  s!     $< $<S $<K $<4 $<r   c                   V P                   P                  V4      '       g   \        RV: 24      hVP                  4       pVP	                  R4      '       d!   VR,          VR,          P                  4       rCMVVP	                  R
4      '       d!   VR,          VR,          P                  4       rCMVR,          VR,          P                  4       rCW43V n        W n        R	V n        R	V 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: r@  :N   N:rF  NN:Nr   N:r   NN:N   NrG  NNN)r4  r6  r8  r:  r<  )
_regex	fullmatchr   strip
startswith_spec_prereleases_spec_version_wildcard_split_ranges)rN   r"   r	  operatorrG   s   &&&  r   rO   Specifier.__init__=  s     {{$$T**"%8#ABBzz|??5!! $R$r(..*:g__;<< $R$r(..*:g $R$r(..*:g'/&9
 ( :> >B 8<r   c                    V ^8  d   QhRRRR/# )r   rG   r(   r   r   r   )r   s   "r   r   rD  c  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)rO  r   )rN   rG   version_specifiers   && r   _get_spec_versionSpecifier._get_spec_versionc  sV    )d.@.@.Cw.N%%a((+G4$%9  r   c                    V ^8  d   QhRRRR/# )r   rG   r(   r   r   r   )r   s   "r   r   rD  o  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 ===).
)rW  )rN   rG   spec_versions   && r   _require_spec_versionSpecifier._require_spec_versiono  s&     --g6'''r   c                   V ^8  d   QhRR/# r   r   r   r   )r   s   "r   r   rD  y  s      3 r   c                   V P                   e   V P                   # V P                  pV P                  pVR8X  d   \        V n         \        # VP	                  R4      '       d   V P                  W4      pMV P                  W4      pW0n         V# )zConvert this specifier to sorted, non-overlapping version ranges.

Each standard operator maps to one or two ranges.  ``===`` is
modeled as full range (actual check done separately).  Cached.
r@  .*)rQ  rR  rG   r   endswith_wildcard_ranges_standard_ranges)rN   opver_strr   s   &   r   
_to_rangesSpecifier._to_rangesy  sy     <<#<<]],,;&DLD!!**27F**27Fr   c               $    V ^8  d   QhRRRRRR/# r   re  r(   rf  r   r   r   )r   s   "r   r   rD    s"     
 
3 
 
9L 
r   c                	    V P                  VR R 4      p\        V4      p\        V4      pVR8X  d   \        VR4      \	        VR4      3.# \
        \	        VR4      3\        VR4      \        3.# )Nr6  TF)r\  r   r   ry   r   _NEG_INF_POS_INF)rN   re  rf  baser   r   s   &&&   r   rc  Specifier._wildcard_ranges  sy    ))'#2,74 !$': -{5%/HIJJ {5%01%x0
 	
r   c               $    V ^8  d   QhRRRRRR/# rj  r   )r   s   "r   r   rD    s"     <6 <63 <6 <69L <6r   c                	l   V P                  V4      pVR 8X  d   \        VR4      \        3.# VR8X  d,   \        \	        \        V\        P                  4      R4      3.# VR8X  d   VP                  e8   VP                  VP                  ^,           RR7      p\        VR4      \        3.# VP                  e9   VP                  VP                  ^,           ^ RR7      p\        VR4      \        3.# \        \        V\        P                  4      R4      \        3.# VR8X  dH   VP                  '       d   TMVP                  ^ RR7      pV\        8:  d   . # \        \	        VR4      3.# R	V9   p\        V\        P                  4      pV'       d   TMTpVR
8X  d   \        VR4      \	        VR4      3.# VR8X  d%   \        \	        VR4      3\        VR4      \        3.# VR8X  dB   VP                  VP                  RR R7      p	\        VR4      \	        \        V	4      R4      3.# \!        RV: 24      h)r<  Tr:  r   Nr   r   Fr   +r6  r8  r4  )r4   Unknown operator: r   )r\  ry   rn  rm  r   rE   r9   rA   rV   r   rU   rB   r   r2   r4   r   
ValueError)
rN   re  rf  rW   	lower_verr1   	has_localafter_localsr   prefixs
   &&&       r   rd  Specifier._standard_ranges  s-   &&w/: D)8455:  0M4N4N OQUV  9uu  MMaeeaitMD	$Y5x@AAvv!MMqvvzqMM	$Y5x@AA   0M4M4M NPUV  9 Aammm.NE$	{5%89:: 7N	'=+E+EFL: D);ud+CDEE:;q%01UE*H5 
 :]]199Sb>]:FQ%{3DV3Le'TU  -bV455r   c                   V ^8  d   QhRR/# r  r   )r   s   "r   r   rD    s     % %[ %r   c                	    V P                   e   V P                   # V P                  w  rVR8X  d   R# VR8X  d   VP                  R4      '       d   R# V P                  V4      pVf   R # VP                  # )Nr8  Fr6  ra  )rN  rM  rb  rW  r   )rN   rR  version_strrG   s   &   r   r	  Specifier.prereleases  sz     ($$$ !%

t t 4 4T : : ((5? $$$r   c                    V ^8  d   QhRRRR/# r   rc   r  r   rI   r   )r   s   "r   r   rD    s     " " " "r   c                	    Wn         R # r   )rN  r  s   &&r   r	  r~    s    !r   c                   V ^8  d   QhRR/# )r   r   z#tuple[tuple[str, str], bool | None]r   )r   s   "r   r   rD    s     / /A /r   c                	2    V P                   V P                  3# r   )rM  rN  rk   s   &r   __getstate__Specifier.__getstate__  s     

D--..r   c                    V ^8  d   QhRRRR/# r   stater#   r   rI   r   )r   s   "r   r   rD    s      D  D&  DT  Dr   c                	   R V n         R V n        R V n        \        V\        4      '       d   \        V4      ^8X  d5   Vw  r#\        V4      '       d    \        V4      '       d   W n        W0n	        R # \        V4      ^8X  du   \        V^,          \        4      '       dX   Vw  rEVP                  R4      pVP                  RR4      p\        V4      '       d    \        V4      '       d   W n        W0n	        R # \        V\        4      '       dT   VP                  R4      pVP                  RR4      p\        V4      '       d    \        V4      '       d   W n        W0n	        R # \        RV: 24      h)NrM  rN  invalidzCannot restore Specifier from )rO  rP  rQ  r%   r&   r'   r)   r.   rM  rN  dictget	TypeError)rN   r  r"   r	  _	slot_dicts   &&    r   __setstate__Specifier.__setstate__  s    !#eU##5zQ$)!!$''M+,F,F!%J(3%5zQ:eAh#=#=$ }}W-'mmNIF!$''M+,F,F!%J(3%eT""99W%D))NI>Kd##k(B(B!
$/!8	BCCr   c                   V ^8  d   QhRR/# ro   r   )r   s   "r   r   rD  %  s      # r   c                (    V P                   ^ ,          # )zHThe operator of this specifier.

>>> Specifier("==1.2.3").operator
'=='
rM  rk   s   &r   rR  Specifier.operator$       zz!}r   c                   V ^8  d   QhRR/# ro   r   )r   s   "r   r   rD  .  s       r   c                (    V P                   ^,          # )zIThe version of this specifier.

>>> Specifier("==1.2.3").version
'1.2.3'
r  rk   s   &r   rG   Specifier.version-  r  r   c                   V ^8  d   QhRR/# ro   r   )r   s   "r   r   rD  6  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   rq   )>rN  r	  rs   r:   r(   rN   r+   s   & r   ru   Specifier.__repr__6  sU       , T--01 	 4>>**+1SYM#bAAr   c                   V ^8  d   QhRR/# ro   r   )r   s   "r   r   rD  H  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   rM  rk   s   &r   r   Specifier.__str__H  s     }}djj))r   c                   V ^8  d   QhRR/# )r   r   ztuple[str, str]r   )r   s   "r   r   rD  S  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@  ra  r4  strip_trailing_zero)rM  rb  r\  r   )rN   rR  rG   r[  canonical_versions   &    r   _canonical_specSpecifier._canonical_specR  s]     JJu 0 0 6 6$$11':04/?
 **r   c                   V ^8  d   QhRR/# rg   r   )r   s   "r   r   rD  `  s     * *# *r   c                	,    \        V P                  4      # r   )rj   r  rk   s   &r   rl   Specifier.__hash__`  s    D(())r   c                    V ^8  d   QhRRRR/# r[   r   )r   s   "r   r   rD  c  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%   r(   rs   r   r]   r  r^   s   &&r   r_   Specifier.__eq__c  sm    & eS!!&s5z2 E>>22!!##u'<'<<< $ &%%&s   A- -B Bc                    V ^8  d   QhRRRR/# )r   re  r(   r   CallableOperatorr   )r   s   "r   r   rD    s     ! ! !(8 !r   c                	F    \        V R V P                  V,           24      pV# )	_compare_)getattrrB  )rN   re  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"   r(   r   r-   r   )r   s   "r   r   rD    s!     
 
w 
c 
d 
r   c           
     	    \        \        \        P                  ! \        \        V4      4      4      R R 4      pVR,          pV P                  W4      ;'       d    V P                  W4      # )Nra  r   )_version_joinlist	itertools	takewhile_is_not_suffix_version_split_compare_greater_than_equal_compare_equal)rN   r  r"   ry  s   &&& r   _compare_compatibleSpecifier._compare_compatible  se     $$^^D5IJKCRP

 	$00C 
 
4	
r   c                    V ^8  d   QhRRRR/# )r   r"   r(   r   ztuple[list[str], int]r   )r   s   "r   r   rD    s       0E r   c                    V P                   pVf/   \        VRR RR7      p\        V4      pV\        V4      3pW n         V# )zCached split of a wildcard spec into components and numeric length.

>>> Specifier("==1.*")._get_wildcard_split("1.*")
(['0', '1'], 2)
>>> Specifier("==3.10.*")._get_wildcard_split("3.10.*")
(['0', '3', '10'], 3)
NFr  rl  )rP  r   r  _numeric_prefix_len)rN   r"   wildcard_split
normalized
split_specs   &&   r   _get_wildcard_splitSpecifier._get_wildcard_split  sM     --!-d3BiUSJ'
3J(*=j*IJN#1 r   c               $    V ^8  d   QhRRRRRR/# r  r   )r   s   "r   r   rD    s!     "/ "/' "/ "/ "/r   c                	6   VP                  R 4      '       dR   V P                  V4      w  r4\        \        V4      RR7      p\	        V4      p\        Wd4      pVR\        V4       pW8H  # V P                  V4      p	V	P                  '       g   \        V4      pW8H  # )ra  Fr  N)	rb  r  r   r   r  	_left_padr'   r\  r   )
rN   r  r"   r  spec_numeric_lennormalized_prospectivesplit_prospectivepadded_prospectiveshortened_prospectiver[  s
   &&&       r   r  Specifier._compare_equal  s    ==+/+C+CD+I(J &:,%&" !//E F "++<!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   rD    s!     : :g :S :T :r   c                	.    V P                  W4      '       * # r   )r  rN   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   rD    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   rD    s&     P Pw Pc Pd Pr   c                	<    \        V4      V P                  V4      8  # r   r  r  s   &&&r   r  %Specifier._compare_greater_than_equal  r  r   c               $    V ^8  d   QhRRRRRR/# r   r  r   spec_strr(   r   r-   r   )r   s   "r   r   rD    s!      g   r   c                	    V P                  V4      pW8  g   R # VP                  '       g%   VP                  '       d   V\        V4      8  d   R # R# FT)r\  r   r   rN   r  r  r"   s   &&& r   _compare_less_thanSpecifier._compare_less_than  sO     ))(3
 !
 """)))3D99
 r   c               $    V ^8  d   QhRRRRRR/# r  r   )r   s   "r   r   rD    s!       C D r   c                	    V P                  V4      pW8  g   R # VP                  '       g%   VP                  '       d   \        V4      V8X  d   R # VP                  e   \	        V4      V8X  d   R # R# r  )r\  is_postreleaser   r   r   r  s   &&& r   _compare_greater_thanSpecifier._compare_greater_than  sk     ))(3
 !
 ###***;'4/ (_[-IT-Q
 r   c               $    V ^8  d   QhRRRRRR/# )r   r  zVersion | strr"   r(   r   r-   r   )r   s   "r   r   rD    s!     = =m =3 =4 =r   c                	h    \        V4      P                  4       \        V4      P                  4       8H  # r   r(   r   r  s   &&&r   _compare_arbitrarySpecifier._compare_arbitrary  s&    ;%%'3t9??+<<<r   c                    V ^8  d   QhRRRR/# )r   r  zstr | Versionr   r-   r   )r   s   "r   r   rD    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
r  rN   r  s   &&r   __contains__Specifier.__contains__      & }}T""r   c               $    V ^8  d   QhRRRRRR/# )r   r  r   r	  r  r   r-   r   )r   s   "r   r   rD  .  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
r	  )r-   r  r  r  s   &&&r   r  Specifier.contains.  s#    2 DdVEFGGr   c               (    V ^8  d   QhRRRRRRRR/# r  r   )r   s   "r   r   rD  J  r  r   c                	    R # r   r   r  s   &&&&r   r  Specifier.filterI  r  r   c               (    V ^8  d   QhRRRRRRRR/# r  r   )r   s   "r   r   rD  R  r   r   c                	    R # r   r   r  s   &&&&r   r  r  Q  r"  r   c               (    V ^8  d   QhRRRRRRRR/# r$  r   )r   s   "r   r   rD  Y  s8     O, O,O, !O, 5	O,
 
O,r   c              #    "   . pRpVe   TMV P                   pV P                  V P                  4      pV F  p\        Vf   TMV! V4      4      p	Rp
V	f8   V P                  R8X  d&   V P	                  WP
                  4      '       d   Vx  MLV P                  R8X  d*   T P	                  Vf   TMV! V4      V P
                  4      p
MV! WP
                  4      p
V
'       g   K  V	f   K  V	P                  '       d	   V'       d	   RpVx  K  Ve   K  V P                  RJg   K  VP                  V4       E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.
:param key:
    A callable that takes a single argument (an item from the iterable) and
    returns a version string or :class:`Version` instance to be used for
    filtering.

>>> 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']
>>> list(Specifier(">=1.2.3").filter(
... [{"ver": "1.2"}, {"ver": "1.3"}],
... key=lambda x: x["ver"]))
[{'ver': '1.3'}]
FNr@  T)	r	  r  rR  r   r  rG   r   rN  r   )rN   r  r	  r  prereleases_versionsfound_non_prereleasesinclude_prereleasesr  rG   parsed_versionmatchs   &&&&       r   r  r  Y  sT    F  " % '2K8H8H 	
 !..t}}=  G,WWVNE%==E)d.E.E\\/ / "M%'//"{GGdll *.,,Gu3%3337J,0)!M (T->->e-K(//8/  8 &#!!.+++ / $ & ,s<   CE)#E))E);E)	E)E)#E)E)E'E))rN  rQ  rM  rO  rP  r  Nr   r)  r*  )0r:   r;   r<   r=   r>   rw   _specifier_regex_strrecompileVERBOSE
IGNORECASErI  rB  __annotations__rO   rW  r\  rg  rc  rd  r,  r	  r/  r  r  rR  rG   ru   r   r  rl   r_   r  r  r  r  r  r  r  r  r  r  r  r  r0  r1  r  rC   r   r   r   r   r     s   &IZx ZZ%%.

R]]0JF
 	lgk"[^{	J 	$<L
!0
<6| % %6 " "/ DD    B$* + +*=:!
( "/H:PP2@=#*H6 __+ + __ O, O,r   z([0-9]+)((?:a|b|c|rc)[0-9]+)c               $    V ^8  d   QhRRRRRR/# )r   r  r%  r  r&  r   r'  r   )r   s   "r   r   r     s$     '  ' ' "I' ' r   c              #    "   . p. pRpV  F  p\        Vf   TMV! V4      4      pVf2   V'       d   Vx  M"VP                  V4       VP                  V4       KO  VP                  '       g   V'       g   T Rj  xL
  RpVx  K{  V'       d   K  VP                  V4       K  	  V'       g   T Rj  xL
  R# R#  LA L
5i)z?Filter per PEP 440: exclude prereleases unless no finals exist.FNT)r   r   r   )r  r  all_nonfinalarbitrary_stringsfound_finalr  parseds   &&     r   _pep440_filter_prereleasesr    s      !L#%K #d)D> 
!((.##D)###,,,"J {%1 6   - 	 s@   .B?:B?,B?4B?9B;:B?B?-B?2B=3	B?=B?c                    V ^8  d   QhRRRR/# )r   rG   r(   r   r   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_regexrJ  extendgroups)rG   r   rT   r  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   r(   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.
r   r"  )join)r*  rT   r(  s   &  r   r  r    s%     LEWAchhtn%&&r   c                    V ^8  d   QhRRRR/# )r   segmentr(   r   r-   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   )rL  ).0ry  r.  s   & r   	<genexpr>!_is_not_suffix.<locals>.<genexpr>  s#      1Pv6""1Ps   !TF)rV   abrcrU   )any)r.  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   r   rh   r   )r   s   "r   r   r     s      y S r   c                `    ^ pV  F%  pVP                  4       '       g    V# V^,          pK'  	  V# )zwCount leading numeric components in a :func:`_version_split` result.

>>> _numeric_prefix_len(["0", "1", "2", "a1"])
3
)isdigit)r$  countr.  s   &  r   r  r    s:     E  L 	
  Lr   c               $    V ^8  d   QhRRRRRR/# )r   r$  r   target_numeric_lenrh   r   r   )r   s   "r   r   r     s&     O OY OC OI Or   c                d    \        V 4      pW,
          pV^ 8:  d   V # . V RV OR.V,          OWR O# )zPad a :func:`_version_split` result with ``"0"`` segments to reach
``target_numeric_len`` numeric components.  Suffix segments are preserved.

>>> _left_pad(["0", "1", "a1"], 4)
['0', '1', '0', '0', 'a1']
Nr!  )r  )r$  r=  numeric_len
pad_neededs   &&  r   r  r    sJ     &e,K#1JQNU<K NSEJ$6N%:MNNr   c                    V ^8  d   QhRRRR/# )r   op_entryz!tuple[CallableOperator, str, str]r   rh   r   )r   s   "r   r   r     s     2 2> 23 2r   c                    V w  rpVR8X  d   VP                  R4      '       g   ^ # ^# VR9   d   ^# VR8X  d   ^# VR8X  d   VP                  R4      '       g   ^# ^# VR8X  d   ^ # \        RV: 24      h)a,  Sort key for Cost Based Ordering of specifier operators in _filter_versions.

Operators run sequentially on a shrinking candidate set, so operators that
reject the most versions should run first to minimize work for later ones.

Tier 0: Exact equality (==, ===), likely to narrow candidates to one version
Tier 1: Range checks (>=, <=, >, <), cheap and usually reject a large portion
Tier 2: Wildcard equality (==.*) and compatible release (~=), more expensive
Tier 3: Exact !=, cheap but rarely rejects
Tier 4: Wildcard !=.*, expensive and rarely rejects
r6  ra  r4  r8  r@  rt  )r<  r:  r   r   )rb  ru  )rB  r  verre  s   &   r   _operator_costrE    s     JAB	TzT**q11	##	Tz	TzT**q11	U{
)"0
11r   c                     ] tR tRtRtR2tR3R R lltR R 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 ltR R ltR  R! ltR" R# ltR$ R% ltR& R' ltR4R( R) llt]P6                  R5R* R+ ll4       t]P6                  R5R, R- ll4       tR4R. R/ lltR6R0 R1 lltR2tR# )7r   i6  aU  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.

Instances are safe to serialize with :mod:`pickle`. They use a stable
format so the same pickle can be loaded in future packaging
releases.

.. versionchanged:: 26.2

    Added a stable pickle format. Pickles created with
    packaging 26.2+ can be unpickled with future releases.
    Backward compatibility with pickles from
    packaging < 26.2 is supported but may be removed in a future
    release.
Nc               $    V ^8  d   QhRRRRRR/# )r   
specifierszstr | Iterable[Specifier]r	  r  r   rI   r   )r   s   "r   r   SpecifierSet.__annotate__R  s(     +3 +3-+3 !+3 
	+3r   c                4   \        V\        4      '       do   VP                  R4       Uu. uF*  q3P                  4       '       g   K  VP                  4       NK,  	  pp\	        \        \        V4      4      V n        RV9   V n        M]\	        V4      V n        \        ;QJ d&    R V P                   4       F  '       g   K   RM	  RM! R V P                   4       4      V n        \        V P                  4      ^8*  V n        RV n        W n        RV 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.
,r@  c              3  >   "   T F  pR \        V4      9   x  K  	  R# 5ir@  Nr   r1  ss   & r   r2  (SpecifierSet.__init__.<locals>.<genexpr>t  s     %K{!es1vo{   TFN)r%   r(   r$  rK  r&   mapr   _specs_has_arbitraryr7  r'   _canonicalized_resolved_opsrN  _is_unsatisfiable)rN   rH  r	  rO  split_specifierss   &&&  r   rO   SpecifierSet.__init__R  s    , j#&& 4>3C3CC3HV3HaGGI		3HV16s9FV7W1XDK"':"5D
+DK #&#%Kt{{%K###%Kt{{%K"KD!$++.!3MQ (.2%  Ws   DDc                   V ^8  d   QhRR/# )r   r   ztuple[Specifier, ...]r   )r   s   "r   r   rI    s      "7 r   c           	         V P                   '       gR   \        \        P                  \	        V P
                  \        R7      4      4      V n        RV n         RV n        RV n        V P
                  # )zBDeduplicate, sort, and cache specs for order-sensitive operations.r  TN)	rU  r&   r  fromkeyssortedrS  r(   rV  rW  rk   s   &r   _canonical_specsSpecifierSet._canonical_specs  sP    """fT[[c.J KLDK"&D!%D%)D"{{r   c                   V ^8  d   QhRR/# r  r   )r   s   "r   r   rI    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  rN  s   & r   r2  +SpecifierSet.prereleases.<locals>.<genexpr>  s     2k}}k   TF)rN  rS  r7  rk   s   &r   r	  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   rI    s     & & & &r   c                	     Wn         R V n        R # r   )rN  rW  r  s   &&r   r	  rf    s    !!%r   c                   V ^8  d   QhRR/# )r   r   z)tuple[tuple[Specifier, ...], bool | None]r   )r   s   "r   r   rI    s     0 0G 0r   c                	2    V P                   V P                  3# r   )rS  rN  rk   s   &r   r  SpecifierSet.__getstate__  s     T..//r   c                    V ^8  d   QhRRRR/# r  r   )r   s   "r   r   rI    s     7G 7G& 7GT 7Gr   c                	L   R V n         R V n        \        V\        4      '       Ed/   \	        V4      ^8X  d   Vw  r#\        V\        4      '       d   \
        ;QJ d    R V 4       F  '       d   K   RM	  RM! R V 4       4      '       dl   \        V4      '       d[   W n        W0n        \	        V4      ^8*  V n	        \        ;QJ d    R V 4       F  '       g   K   RM	  RM! R V 4       4      V n        R # \	        V4      ^8X  EdO   \        V^,          \        4      '       Ed1   Vw  rEVP                  RR4      pVP                  R4      p\        V\        4      '       d   \        \        V\         R7      4      p\        V\        4      '       d   \
        ;QJ d    R V 4       F  '       d   K   RM	  RM! R V 4       4      '       d   \        V4      '       dy   W n        W0n        \	        V P                  4      ^8*  V n	        \        ;QJ d&    R	 V P                   4       F  '       g   K   RM	  RM! R	 V P                   4       4      V n        R # \        V\        4      '       Ed-   VP                  RR4      pVP                  R4      p\        V\        4      '       d   \        \        V\         R7      4      p\        V\        4      '       d   \
        ;QJ d    R
 V 4       F  '       d   K   RM	  RM! R
 V 4       4      '       d   \        V4      '       dy   W n        W0n        \	        V P                  4      ^8*  V n	        \        ;QJ d&    R V P                   4       F  '       g   K   RM	  RM! R V P                   4       4      V n        R # \#        RV: 24      h)Nc              3  B   "   T F  p\        V\        4      x  K  	  R # 5ir   r%   r   rN  s   & r   r2  ,SpecifierSet.__setstate__.<locals>.<genexpr>       DeJq)44e   FTc              3  >   "   T F  pR \        V4      9   x  K  	  R# 5irM  r   rN  s   & r   r2  rp    s     -Mu!es1vourQ  rS  rN  r\  c              3  B   "   T F  p\        V\        4      x  K  	  R # 5ir   ro  rN  s   & r   r2  rp    rq  rr  c              3  >   "   T F  pR \        V4      9   x  K  	  R# 5irM  r   rN  s   & r   r2  rp    s     -S{!es1vo{rQ  c              3  B   "   T F  p\        V\        4      x  K  	  R # 5ir   ro  rN  s   & r   r2  rp    s     @%Q
1i00%rr  c              3  >   "   T F  pR \        V4      9   x  K  	  R# 5irM  r   rN  s   & r   r2  rp    s     )O;a%3q6/;rQ  z!Cannot restore SpecifierSet from r   )rV  rW  r%   r&   r'   allr.   rS  rN  rU  r7  rT  r  r  	frozensetr^  r(   r  )rN   r  specsr	  r  r  s   &&    r   r  SpecifierSet.__setstate__  sv   !!%eU##5zQ%*"ue,,DeDDeDDD%k22"'K(3%*-e*/D'*-#-Mu-M###-Mu-M*MD'5zQ:eAh#=#=$!h3'mmN;eY//!&C"89Eue,,DeDDeDDD%k22"'K(3%*-dkk*:a*?D'*-#-St{{-S###-St{{-S*SD'eT""IIh+E))N3K%++fU455%((C@%@CCC@%@@@!+..#$/!&)$++&6!&;#&)c)O4;;)Occc)O4;;)O&O#;E9EFFr   c                   V ^8  d   QhRR/# ro   r   )r   s   "r   r   rI    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 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  r   rq   r  r  r  s   & r   ru   SpecifierSet.__repr__  sU       , T--01 	 4>>**+1SYM#bAAr   c                   V ^8  d   QhRR/# ro   r   )r   s   "r   r   rI    s     A A Ar   c                N    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'
rK  c              3  8   "   T F  p\        V4      x  K  	  R # 5ir   r   rN  s   & r   r2  'SpecifierSet.__str__.<locals>.<genexpr>   s     @(?1A(?re  )r,  r_  rk   s   &r   r   SpecifierSet.__str__  s"     xx@(=(=(?@@@r   c                   V ^8  d   QhRR/# rg   r   )r   s   "r   r   rI    s     - -# -r   c                	4    \        V P                  4       4      # r   )rj   r_  rk   s   &r   rl   SpecifierSet.__hash__  s    D))+,,r   c                    V ^8  d   QhRRRR/# )r   rR   zSpecifierSet | strr   r   r   )r   s   "r   r   rI    s      / L r   c                8   \        V\        4      '       d   \        V4      pM\        V\        4      '       g   \        # \        4       pV P                  VP                  ,           Vn        \        VP                  4      ^8*  Vn        V P                  ;'       g    VP                  Vn        RVn        V P                  e   V P                  VP                  8X  d   VP                  Vn	        V# VP                  f   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')>
NzFCannot combine SpecifierSets with True and False prerelease overrides.)r%   r(   r   r]   rS  r'   rU  rT  rV  rN  ru  )rN   rR   	specifiers   && r   __and__SpecifierSet.__and__  s     eS!! 'EE<00!! N	;;5	#&y'7'7#8A#=	 #'#6#6#N#N%:N:N	 "&	 $(9(9U=O=O(O%*%7%7I"  '%)%6%6I" 	 X r   c                    V ^8  d   QhRRRR/# r[   r   )r   s   "r   r   rI  &  s     C CF Ct Cr   c                    \        V\        \        34      '       d   \        \        V4      4      pM\        V\        4      '       g   \        # V P                  4       VP                  4       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%   r(   r   r   r]   r_  r^   s   &&r   r_   SpecifierSet.__eq__&  sT    & ec9-.. U,EE<00!!$$&%*@*@*BBBr   c                   V ^8  d   QhRR/# rg   r   )r   s   "r   r   rI  @  s          r   c                ,    \        V P                  4      # )z7Returns the number of specifiers in this specifier set.)r'   rS  rk   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   rI  D  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')>]
)iterrS  rk   s   &r   __iter__SpecifierSet.__iter__D  s     DKK  r   c                   V ^8  d   QhRR/# r_  r   )r   s   "r   r   rI  N  s      4 r   c                    V P                   pRpV F<  pVf   VP                  4       pK  \        W#P                  4       4      pV'       d   K<   M	  Vf   \        R4      hV# )zIntersect all specifiers into a single list of version ranges.

Returns an empty list when unsatisfiable.  ``===`` specs are
modeled as full range; string matching is checked separately
by :meth:`_check_arbitrary_unsatisfiable`.
Nz _get_ranges called with no specs)rS  rg  r   RuntimeError)rN   rz  r   rO  s   &   r   _get_rangesSpecifierSet._get_rangesN  s\     15A~*6<<>Bv  >ABBr   c                   V ^8  d   QhRR/# r   r   r-   r   )r   s   "r   r   rI  d  s      $ r   c                   V P                   pVe   V# V P                  '       g
   RV n         R# V P                  4       '       * pV'       g   V P                  4       pV'       g!   V P                  RJ d   V P                  4       pW n         V# )aV  Check whether this specifier set can never be satisfied.

Returns True if no version can satisfy all specifiers simultaneously.

>>> SpecifierSet(">=2.0,<1.0").is_unsatisfiable()
True
>>> SpecifierSet(">=1.0,<2.0").is_unsatisfiable()
False
>>> SpecifierSet("").is_unsatisfiable()
False
>>> SpecifierSet("==1.0,!=1.0").is_unsatisfiable()
True
F)rW  rS  r  _check_arbitrary_unsatisfiabler	  _check_prerelease_only_ranges)rN   cachedr   s   &  r   is_unsatisfiableSpecifierSet.is_unsatisfiabled  sy     ''M{{{%*D"%%''88:F$**e3779F!'r   c                   V ^8  d   QhRR/# r  r   )r   s   "r   r   rI    s      t r   c                    V P                  4        Fi  w  r\        VP                  4      pVf    R# VP                  e   W2P                  8  d    R# W2P                  8X  g   KT  VP                  '       g   Kh   R# 	  R# )zxWith prereleases=False, check if every range contains only
pre-release versions (which would be excluded from matching).FT)r  r   rG   r}   )rN   r   r   nearests   &   r   r  *SpecifierSet._check_prerelease_only_ranges  s_     !,,.LE-emm<G}}$--(?--'EOOO / r   c                   V ^8  d   QhRR/# r  r   )r   s   "r   r   rI    s     %@ %@ %@r   c                  aa V P                    Uu. uF  qP                  R8X  g   K  VNK  	  ppV'       g   R# V^ ,          P                  P                  4       o\        ;QJ d&    V3R lVR,           4       F  '       g   K   RM	  RM! V3R lVR,           4       4      '       d   R# \        V^ ,          P                  4      oV P                  RJ d   Se   SP                  '       d   R# V P                    Uu. uF  qP                  R8w  g   K  VNK  	  ppV'       g   R# Sf   R# \        ;QJ d)    V3R lV 4       F  '       d   K   R'       * # 	  R'       * # ! V3R lV 4       4      '       * # u upi u upi )zCheck === (arbitrary equality) specs for unsatisfiability.

=== uses case-insensitive string comparison, so the only candidate
that can match ``===V`` is the literal string V.  This method
checks whether that candidate is excluded by other specifiers.
r@  Fc              3  \   <"   T F!  qP                   P                  4       S8g  x  K#  	  R # 5ir   )rG   r   )r1  rO  firsts   & r   r2  >SpecifierSet._check_arbitrary_unsatisfiable.<locals>.<genexpr>  s     A=ayy E)=s   ),rH  Tc              3  D   <"   T F  qP                  S4      x  K  	  R # 5ir   r  )r1  rO  	candidates   & r   r2  r    s     ?hzz),,hs    )	rS  rR  rG   r   r7  r   r	  r   rx  )rN   rO  rA  standardr  r  s   &   @@r   r  +SpecifierSet._check_arbitrary_unsatisfiable  s    !%C1zzU/BQQ	C !$$**,3A9R=A333A9R=AAA $IaL$8$89	
 %%'''#{{B{!jjE.AAA{B3?h?33??3??3?h????= D, Cs   E5E5=E:E:c                    V ^8  d   QhRRRR/# )r   r  r   r   r-   r   )r   s   "r   r   rI    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   r	  r  	installedr   r-   r   )r   s   "r   r   rI    s8     +N +N+N !+N 	+N
 
+Nr   c           	        \        V4      pVe   V'       d   VP                  '       d   RpVe)   V P                  '       d   \        V\        4      '       g   Tp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   rT  r%   r   r-   r  r  )rN   r  r	  r  rG   
check_items   &&&&  r   r  SpecifierSet.contains  sn    @ "$'91F1F1FK ?t222:dG;T;TJ JDj\{KLMMr   c               (    V ^8  d   QhRRRRRRRR/# r  r   )r   s   "r   r   rI    r  r   c                	    R # r   r   r  s   &&&&r   r  SpecifierSet.filter  r  r   c               (    V ^8  d   QhRRRRRRRR/# r  r   )r   s   "r   r   rI    r   r   c                	    R # r   r   r  s   &&&&r   r  r    r"  r   c               (    V ^8  d   QhRRRRRRRR/# r$  r   )r   s   "r   r   rI    s8     ^9 ^9^9 !^9 5	^9
 
^9r   c                  aa Vf   V P                   e   V P                   pV P                  '       ds   \        V P                  4      ^8X  d-   V P                  ^ ,          P                  TVf   RMTSR7      pMT P	                  TSVf   RMTR7      pVe   V# \        VS4      # VRJ d   \        V4      # VRJ d   VV3R lV 4       # \        VS4      # )aC  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.
:param key:
    A callable that takes a single argument (an item from the iterable) and
    returns a version string or :class:`Version` instance to be used for
    filtering.

>>> 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']
>>> list(SpecifierSet(">=1.2.3").filter(
... [{"ver": "1.2"}, {"ver": "1.3"}],
... key=lambda x: x["ver"]))
[{'ver': '1.3'}]

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']
T)r	  r  r  Fc              3     <"   T F7  p\        Sf   TMS! V4      4      ;o e   SP                  '       d   K3  Vx  K9  	  R # 5ir   )r   r   )r1  r  r  rG   s   & r   r2  &SpecifierSet.filter.<locals>.<genexpr>^  sB      $D /T SSW"00 $s
   0A
A)r	  rS  r'   r  _filter_versionsr  r  )rN   r  r	  r  filteredrG   s   &&&f @r   r  r    s    d 4#3#3#?**K ;;; 4;;1$;;q>00(3(; 1   00(3(; 1  &-h<< $>!%$  *(C88r   c               (    V ^8  d   QhRRRRRRRR/# )	r   r  r%  r  r&  r	  r  r   r'  r   )r   s   "r   r   rI  k  s2     , ,, 5, !	,
 
,r   c              #  B  aaa"   V P                   f(   \        R V P                   4       \        R7      V n         V P                   pVRJ pV F  o\	        Sf   SMS! S4      4      oSfI   \
        ;QJ d    V3R lV 4       F  '       d   K   RM	  RM! V3R lV 4       4      '       d   Sx  Kd  Kf  V'       d   SP                  '       d   K  \
        ;QJ d!    VVV3R lV 4       F  '       d   K   RM	  RM! VVV3R lV 4       4      '       g   K  Sx  K  	  R# 5i)a  Filter versions against all specifiers in a single pass.

Uses Cost Based Ordering: specifiers are sorted by _operator_cost so
that cheap range operators reject versions early, avoiding expensive
wildcard or compatible operators on versions that would have been
rejected anyway.
Nc              3     "   T F7  pVP                  VP                  4      VP                  VP                  3x  K9  	  R # 5ir   )r  rR  rG   )r1  r"   s   & r   r2  0SpecifierSet._filter_versions.<locals>.<genexpr>{  s5       + ''6dmmT +s   ?Ar\  Fc              3     <"   T F?  w  rpVR 8H  ;'       d+    \        S4      P                  4       VP                  4       8H  x  KA  	  R# 5irM  r  )r1  r  rD  re  r  s   &   r   r2  r    sA      &)
 %KDDCIOO$5$DD&)s
   A
3A
Tc              3     <"   T FN  w  rpVR 8X  d7   \        Sf   SMS! S4      4      P                  4       VP                  4       8H  MV! SV4      x  KP  	  R# 5irM  r  )r1  op_fnrD  re  r  r  r  s   &   r   r2  r    s[       '*NE ; CKDSY7==?399;N63'( '*s   AA)rV  r^  rS  rE  r   rx  r   )rN   r  r  r	  opsexclude_prereleasesr  r  s   &&f&  @@r   r  SpecifierSet._filter_versionsk  s      %!' $ #"D   )U2D$S[Tc$iHF~3 &)333 &)   J	
 %)=)=)=  '*	  '*	   
' s6   A0D6DD+D;DDD3D
D)rU  rT  rW  rN  rV  rS  r  r*  r)  r   )r:   r;   r<   r=   r>   rw   rO   r_  r,  r	  r/  r  r  ru   r   rl   r  r_   r  r  r  r  r  r  r  r  r0  r1  r  r  rC   r   r   r   r   r   6  s    $I+3Z  & & &07GrB*A-BC4 !,B%@N#*+NZ __+ + __ ^9@, ,r   )rF  
   )r   r   r   r   )M__conditional_annotations__r>   
__future__r   r-  r?   	functoolsr  r  sysr0  r   r   r   r   r   r   r	   r
   r   utilsr   rG   r   r   version_infor   typing_extensionsr   r    r)   r.   r/   r(   r   r0   r-   r  r2   r  r7   Enumr9   total_orderingrE   ry   r   r|   r&   _VersionRangerm  rn  r   r   r   r   r   r   r   r   r   r   ru  r   ABCMetar   r   r  r%  r  r  r  r  r  r  rE  r   )r  s   @r   <module>r     s2   # 
    	 
 
 
 
 ( ,w +0 CL%1I WcND01   'x0n 0=DII  ;Q ;Q ;Q| %H %H %HP %H %H %HP 
w(8$>? +{23MtU#tU#&.%9$;! ;)4KS
+@29*	z 	Ockk Odr, r,j 

:;' T,'O26a	= a	r   