+
    %i0                      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	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 . REO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]PD                  4      t#]PH                   ! R R4      4       t%]PH                   ! R R4      4       t&]PH                   ! R R4      4       t']	PP                  '       d   ]]]%R3,          t)]*]&]'3,          t+]&! RR4      t,]'! RR4      t-],]-33t.R] R&   R R  lt/R! R" lt0R# R$ lt1R% R& lt2R' R( lt3R) R* lt4R+ R, lt5R- R. lt6R/ R0 lt7 ! R1 R]84      t9 ! R2 R]Pt                  R37      t; ! R4 R];4      t<]Pz                  ! R54      t>R6 R7 lt?R8 R9 lt@R: R; ltAR< R= ltBR> R? ltCR@ RA ltDRB RC ltE ! RD R	];4      tFR# )Fz
.. testsetup::

    from packaging.specifiers import Specifier, SpecifierSet, InvalidSpecifier
    from packaging.version import Version
)annotationsN)AnyCallableFinalIterableIteratorSequenceTypeVarUnion)canonicalize_version)InvalidVersionVersionBaseSpecifierInvalidSpecifier	SpecifierSpecifierSetc                   V ^8  d   QhRR/# )   return	list[str] )formats   "R/var/www/html/photoedit/myenv/lib/python3.14/site-packages/packaging/specifiers.py__annotate__r       s           c                     \         # N)__all__r   r   r   __dir__r       s    Nr   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   -   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)len)r$   ends   & r   _trim_releaser(   -   sE    
g,C
'gAg&!+qS\)7<wt}<r   c                  ^    ] tR t^5t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   r*   r*   5   s    ?99;L))+Kr   r*   c                  f    ] 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 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   kindr*   r   Noner   )r   s   "r   r   _BoundaryVersion.__annotate__T   s!     ? ? ?} ? ?r   c                	R    Wn         W n        \        VP                  4      V n        R # r   )r8   _kindr(   r$   _trimmed_release)selfr8   r9   s   &&&r   __init___BoundaryVersion.__init__T   s    
 -goo >r   c                    V ^8  d   QhRRRR/# )r   otherr   r   boolr   )r   s   "r   r   r;   Y   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)r8   epochr(   r$   r>   prer=   r*   r2   postdev)r?   rC   vs   && r   
_is_family_BoundaryVersion._is_familyY   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   rC   objectr   rD   r   )r   s   "r   r   r;   h   s      F t r   c                	    \        V\        4      '       d;   V P                  VP                  8H  ;'       d    V P                  VP                  8H  # \        # r   )
isinstancer6   r8   r=   NotImplementedr?   rC   s   &&r   __eq___BoundaryVersion.__eq__h   s>    e-..<<5==0NNTZZ5;;5NNr   c                    V ^8  d   QhRRRR/# )r   rC   z_BoundaryVersion | Versionr   rD   r   )r   s   "r   r   r;   m   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   )rQ   r6   r8   r=   valuerK   rS   s   &&r   __lt___BoundaryVersion.__lt__m   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   r;   t   s     0 0# 0r   c                	D    \        V P                  V P                  34      # r   )hashr8   r=   r?   s   &r   __hash___BoundaryVersion.__hash__t   s    T\\4::.//r   c                   V ^8  d   QhRR/# r   r   strr   )r   s   "r   r   r;   w   s     Q Q# Qr   c                	~    V P                   P                   R V P                  : RV P                  P                   R2# )(z, ))	__class__r+   r8   r=   namer`   s   &r   __repr___BoundaryVersion.__repr__w   s4    ..))*!DLL+;2djjoo=NaPPr   )r=   r>   r8   N)r+   r,   r-   r.   r/   	__slots__r@   rK   rT   rY   ra   rk   r4   r   r   r   r6   r6   <   s4    ( 9I?
<
C0Q Qr   r6   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   r8   _VersionOrBoundary	inclusiverD   r   r:   r   )r   s   "r   r   _LowerBound.__annotate__   "     # # 2 #t # #r   c                	    Wn         W n        R # r   r8   rs   r?   r8   rs   s   &&&r   r@   _LowerBound.__init__       "r   c                    V ^8  d   QhRRRR/# rN   r   )r   s   "r   r   rt           S SF St Sr   c                	    \        V\        4      '       g   \        # V P                  VP                  8H  ;'       d    V P                  VP                  8H  # r   rQ   ro   rR   r8   rs   rS   s   &&r   rT   _LowerBound.__eq__   =    %--!!||u}},RR5??1RRr   c                    V ^8  d   QhRRRR/# )r   rC   ro   r   rD   r   )r   s   "r   r   rt           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~   rS   s   &&r   rY   _LowerBound.__lt__   sw    %--!!<<==,,== <<5==(<<%--//~~55eoo"55r   c                   V ^8  d   QhRR/# r\   r   )r   s   "r   r   rt           4 4# 4r   c                	D    \        V P                  V P                  34      # r   r_   r8   rs   r`   s   &r   ra   _LowerBound.__hash__       T\\4>>233r   c                   V ^8  d   QhRR/# rd   r   )r   s   "r   r   rt           H H# Hr   c                	    V P                   '       d   R MRpRV P                  P                   RV V P                  : R2# )[rg   < >rs   ri   r+   r8   r?   brackets   & r   rk   _LowerBound.__repr__   s:    #S4>>**+1WIdll5EQGGr   rs   r8   Nr+   r,   r-   r.   r/   rm   r@   rT   rY   ra   rk   r4   r   r   r   ro   ro   {   /     )I#S
64H Hr   ro   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/# rq   r   )r   s   "r   r   _UpperBound.__annotate__   ru   r   c                	    Wn         W n        R # r   rw   rx   s   &&&r   r@   _UpperBound.__init__   rz   r   c                    V ^8  d   QhRRRR/# rN   r   )r   s   "r   r   r      r|   r   c                	    \        V\        4      '       g   \        # V P                  VP                  8H  ;'       d    V P                  VP                  8H  # r   rQ   r   rR   r8   rs   rS   s   &&r   rT   _UpperBound.__eq__   r   r   c                    V ^8  d   QhRRRR/# )r   rC   r   r   rD   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   rS   s   &&r   rY   _UpperBound.__lt__   sk    %--!!<<== <<5==(<<%--//>>!55eoo5r   c                   V ^8  d   QhRR/# r\   r   )r   s   "r   r   r      r   r   c                	D    \        V P                  V P                  34      # r   r   r`   s   &r   ra   _UpperBound.__hash__   r   r   c                   V ^8  d   QhRR/# rd   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# )]rh   r   r   r   r   r   s   & r   rk   _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   lowerro   upperr   r   rD   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.Frw   )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   r8   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rF   r$   rI   )r$   r   
from_partsrF   )r8   r$   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   rF   r$   r8   s   &r   
_base_dev0r     s     GMM7??PQRRr   c                    V ^8  d   QhRRRR/# )r   r8   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   )rQ   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     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rH   rI   r   r   r   s   &r   
_post_baser     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rI   r   r   r   s   &r   _earliest_prereleaser     s    
 1D11r   c                    V ^8  d   QhRRRR/# )r   rJ   rr   r   r   r   )r   s   "r   r   r   &  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)rG   rI   r   )rH   r   )rQ   r6   r8   is_prereleaser   rH   )rJ   innerks   &  r   _nearest_non_prereleaser   &  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   i;  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/   r4   r   r   r   r   r   ;  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   iG  c                   V ^8  d   QhRR/# rd   r   )r   s   "r   r   BaseSpecifier.__annotate__L  s      c r   c                    \        V 4      # )z Internal property for match_argsre   r`   s   &r   _strBaseSpecifier._strK  s     4yr   c                   V ^8  d   QhRR/# rd   r   )r   s   "r   r   r   Q  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__P      r   c                   V ^8  d   QhRR/# r\   r   )r   s   "r   r   r   X  s      # r   c                    R# )z6
Returns a hash value for this Specifier-like object.
Nr   r`   s   &r   ra   BaseSpecifier.__hash__W  r   r   c                    V ^8  d   QhRRRR/# rN   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   rS   s   &&r   rT   BaseSpecifier.__eq__]  r   r   c                   V ^8  d   QhRR/# r   r   bool | Noner   )r   s   "r   r   r   h  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.prereleasesf  r   r   c                    V ^8  d   QhRRRR/# )r   rX   rD   r   r:   r   )r   s   "r   r   r   p  s       $ r   c                    R# )zASetter for :attr:`prereleases`.

:param value: The value to set.
Nr   r?   rX   s   &&r   r   r   o  r   r   Nc               $    V ^8  d   QhRRRRRR/# )r   itemre   r   r   r   rD   r   )r   s   "r   r   r   w  s!      S { d r   c                    R# )zB
Determines if the given item is contained within this specifier.
Nr   r?   r  r   s   &&&r   containsBaseSpecifier.containsv  r   r   c               (    V ^8  d   QhRRRRRRRR/# 	r   iterablezIterable[UnparsedVersionVar]r   r   keyr:   r   zIterator[UnparsedVersionVar]r   )r   s   "r   r   r   }  2     + +.+ !+ 	+
 
&+r   c                	    R # r   r   r?   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.   rm   __match_args__propertyr   abcabstractmethodr   ra   rT   r   setterr  typingoverloadr  r4   r   r   r   r   r   G  s   IN  	  	 
 	       	 
 __+ + __  		 	r   )	metaclassc                     ] tR tRt$ RtRTt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&   RUR 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4       t]R* R+ l4       tR, R- ltR. R/ lt]R0 R1 l4       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$RD RE lt%RF RG lt&RH RI lt'RJ RK lt(RVRL RM llt)]*PV                  RWRN RO ll4       t,]*PV                  RWRP RQ ll4       t,RXRR RS llt,RTt-R# )Yr   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).
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   specre   r   r   r   r:   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: r6  :N   N:r=  NN:Nr   N:r   NN:N   Nr>  NNN)r*  r,  r.  r0  r2  )
_regex	fullmatchr   strip
startswith_spec_prereleases_spec_version_wildcard_split_ranges)r?   r:  r   operatorr8   s   &&&  r   r@   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   r8   re   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)rF  r   )r?   r8   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   r8   re   r   r   r   )r   s   "r   r   r;  H  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 ===).
)rN  )r?   r8   spec_versions   && r   _require_spec_versionSpecifier._require_spec_versionH  s&     --g6'''r   c                   V ^8  d   QhRR/# r   r   r   r   )r   s   "r   r   r;  R  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.
r6  .*)rH  rI  r8   r   endswith_wildcard_ranges_standard_ranges)r?   opver_strr   s   &   r   
_to_rangesSpecifier._to_rangesR  sy     <<#<<]],,;&DLD!!**27F**27Fr   c               $    V ^8  d   QhRRRRRR/# r   r\  re   r]  r   r   r   )r   s   "r   r   r;  j  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.# )Nr,  TF)rS  r   r   ro   r   _NEG_INF_POS_INF)r?   r\  r]  baser   r   s   &&&   r   rZ  Specifier._wildcard_rangesj  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/# ra  r   )r   s   "r   r   r;  w  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)r2  Tr0  r   Nr   r   Fr   +r,  r.  r*  )r$   Unknown operator: r   )rS  ro   re  rd  r   r6   r*   r2   rI   r   rH   r3   r   r"   r$   r   
ValueError)
r?   r\  r]  rJ   	lower_verr!   	has_localafter_localsr   prefixs
   &&&       r   r[  Specifier._standard_rangesw  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   r;    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                  # )Nr.  Fr,  rX  )rE  rD  rY  rN  r   )r?   rI  version_strr8   s   &   r   r   Specifier.prereleases  sz     ($$$ !%

t t 4 4T : : ((5? $$$r   c                    V ^8  d   QhRRRR/# r   rX   r   r   r:   r   )r   s   "r   r   r;    s     " " " "r   c                	    Wn         R # r   )rE  r  s   &&r   r   ru    s    !r   c                   V ^8  d   QhRR/# rd   r   )r   s   "r   r   r;    s      # r   c                (    V P                   ^ ,          # )zHThe operator of this specifier.

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

>>> Specifier("==1.2.3").version
'1.2.3'
r{  r`   s   &r   r8   Specifier.version  r}  r   c                   V ^8  d   QhRR/# rd   r   )r   s   "r   r   r;    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   rg   )>rE  r   ri   r+   re   r?   rG   s   & r   rk   Specifier.__repr__  sU       , T--01 	 4>>**+1SYM#bAAr   c                   V ^8  d   QhRR/# rd   r   )r   s   "r   r   r;    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   rD  r`   s   &r   r   Specifier.__str__  s     }}djj))r   c                   V ^8  d   QhRR/# )r   r   ztuple[str, str]r   )r   s   "r   r   r;    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# )r6  rX  r*  strip_trailing_zero)rD  rY  rS  r   )r?   rI  r8   rR  canonical_versions   &    r   _canonical_specSpecifier._canonical_spec  s]     JJu 0 0 6 6$$11':04/?
 **r   c                   V ^8  d   QhRR/# r\   r   )r   s   "r   r   r;    s     * *# *r   c                	,    \        V P                  4      # r   )r_   r  r`   s   &r   ra   Specifier.__hash__  s    D(())r   c                    V ^8  d   QhRRRR/# rN   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
)rQ   re   ri   r   rR   r  rS   s   &&r   rT   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   r\  re   r   CallableOperatorr   )r   s   "r   r   r;  1  s     ! ! !(8 !r   c                	F    \        V R V P                  V,           24      pV# )	_compare_)getattrr8  )r?   r\  operator_callables   && r   _get_operatorSpecifier._get_operator1  s+    .5Idoob123/
 ! r   c               $    V ^8  d   QhRRRRRR/# r   prospectiver   r:  re   r   rD   r   )r   s   "r   r   r;  7  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      # )NrX  r   )_version_joinlist	itertools	takewhile_is_not_suffix_version_split_compare_greater_than_equal_compare_equal)r?   r  r:  rp  s   &&& r   _compare_compatibleSpecifier._compare_compatible7  se     $$^^D5IJKCRP

 	$00C 
 
4	
r   c                    V ^8  d   QhRRRR/# )r   r:  re   r   ztuple[list[str], int]r   )r   s   "r   r   r;  K  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  rc  )rG  r   r  _numeric_prefix_len)r?   r:  wildcard_split
normalized
split_specs   &&   r   _get_wildcard_splitSpecifier._get_wildcard_splitK  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   r;  [  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  # )rX  Fr  N)	rY  r  r   r   r  	_left_padr&   rS  r   )
r?   r  r:  r  spec_numeric_lennormalized_prospectivesplit_prospectivepadded_prospectiveshortened_prospectiverR  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   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   rS  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   r  %Specifier._compare_greater_than_equal  r  r   c               $    V ^8  d   QhRRRRRR/# r   r  r   spec_strre   r   rD   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\        V4      8  d   R # R# FT)rS  r   r   r?   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   r;    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  )rS  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:  re   r   rD   r   )r   s   "r   r   r;    s!     = =m =3 =4 =r   c                	h    \        V4      P                  4       \        V4      P                  4       8H  # r   re   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   rD   r   )r   s   "r   r   r;    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  r?   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   rD   r   )r   s   "r   r   r;    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   )rD   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   r;    r  r   c                	    R # r   r   r  s   &&&&r   r  Specifier.filter  r  r   c               (    V ^8  d   QhRRRRRRRR/# r  r   )r   s   "r   r   r;    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   r;  
  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'}]
FNr6  T)	r   r  rI  r   r  r8   r   rE  r   )r?   r  r   r  prereleases_versionsfound_non_prereleasesinclude_prereleasesr  r8   parsed_versionmatchs   &&&&       r   r  r  
  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))rE  rH  rD  rF  rG  r  Nr   r  r   ).r+   r,   r-   r.   r/   rm   _specifier_regex_strrecompileVERBOSE
IGNORECASEr@  r8  __annotations__r@   rN  rS  r^  rZ  r[  r"  r   r%  rI  r8   rk   r   r  ra   rT   r  r  r  r  r  r  r  r  r  r  r  r  r&  r'  r  r4   r   r   r   r   r     s   IZx ZZ%%.

R]]0JF
 	lgk"[^{	J 	$<L
!0
<6| % %6 " "    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   r8   re   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_regexrA  extendgroups)r8   r   rF   _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   re   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  rF   r  s   &  r   r  r    s%     LEWAchhtn%&&r   c                    V ^8  d   QhRRRR/# )r   segmentre   r   rD   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   )rC  ).0rp  r  s   & r   	<genexpr>!_is_not_suffix.<locals>.<genexpr>  s#      1Pv6""1Ps   !TF)rI   abrcrH   )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   r]   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_lenr]   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   r]   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
r,  rX  r*  r.  r6  rk  )r2  r0  r   r   )rY  rl  )r*  r  verr\  s   &   r   _operator_costr-    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R.tR/R 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R0R$ R% llt]P2                  R1R& R' ll4       t]P2                  R1R( R) ll4       tR0R* R+ lltR2R, R- lltR.tR# )3r   i  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]r   r   r   r:   r   )r   s   "r   r   SpecifierSet.__annotate__  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.
,r6  c              3  >   "   T F  pR \        V4      9   x  K  	  R# 5ir6  Nr   r  ss   & r   r  (SpecifierSet.__init__.<locals>.<genexpr>  s     %K{!es1vo{s   TFN)rQ   re   r  rB  tuplemapr   _specs_has_arbitraryr  r&   _canonicalized_resolved_opsrE  _is_unsatisfiable)r?   r0  r   r7  split_specifierss   &&&  r   r@   SpecifierSet.__init__  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   r1  $  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)	r=  r9  dictfromkeyssortedr;  re   r>  r?  r`   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   r1  .  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  r6  s   & r   r  +SpecifierSet.prereleases.<locals>.<genexpr><  s     2k}}k   TF)rE  r;  r  r`   s   &r   r   SpecifierSet.prereleases-  s[     ($$$
 {{{ 32dkk23332dkk222r   c                    V ^8  d   QhRRRR/# rw  r   )r   s   "r   r   r1  B  s     & & & &r   c                	     Wn         R V n        R # r   )rE  r?  r  s   &&r   r   rO  A  s    !!%r   c                   V ^8  d   QhRR/# rd   r   )r   s   "r   r   r1  F  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   rg   r  r  r  s   & r   rk   SpecifierSet.__repr__F  sU       , T--01 	 4>>**+1SYM#bAAr   c                   V ^8  d   QhRR/# rd   r   )r   s   "r   r   r1  [  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'
r3  c              3  8   "   T F  p\        V4      x  K  	  R # 5ir   r   r6  s   & r   r  'SpecifierSet.__str__.<locals>.<genexpr>f  s     @(?1A(?rN  )r  rH  r`   s   &r   r   SpecifierSet.__str__[  s"     xx@(=(=(?@@@r   c                   V ^8  d   QhRR/# r\   r   )r   s   "r   r   r1  h  s     - -# -r   c                	4    \        V P                  4       4      # r   )r_   rH  r`   s   &r   ra   SpecifierSet.__hash__h  s    D))+,,r   c                    V ^8  d   QhRRRR/# )r   rC   zSpecifierSet | strr   r   r   )r   s   "r   r   r1  k  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.)rQ   re   r   rR   r;  r&   r=  r<  r>  rE  rl  )r?   rC   	specifiers   && r   __and__SpecifierSet.__and__k  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/# rN   r   )r   s   "r   r   r1    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
)rQ   re   r   r   rR   rH  rS   s   &&r   rT   SpecifierSet.__eq__  sT    & ec9-.. U,EE<00!!$$&%*@*@*BBBr   c                   V ^8  d   QhRR/# r\   r   )r   s   "r   r   r1    s          r   c                ,    \        V P                  4      # )z7Returns the number of specifiers in this specifier set.)r&   r;  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   r1    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')>]
)iterr;  r`   s   &r   __iter__SpecifierSet.__iter__  s     DKK  r   c                   V ^8  d   QhRR/# rV  r   )r   s   "r   r   r1    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)r;  r^  r   RuntimeError)r?   specsr   r7  s   &   r   _get_rangesSpecifierSet._get_ranges  s\     15A~*6<<>Bv  >ABBr   c                   V ^8  d   QhRR/# r   r   rD   r   )r   s   "r   r   r1    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)r?  r;  rr  _check_arbitrary_unsatisfiabler   _check_prerelease_only_ranges)r?   cachedr   s   &  r   is_unsatisfiableSpecifierSet.is_unsatisfiable  sy     ''M{{{%*D"%%''88:F$**e3779F!'r   c                   V ^8  d   QhRR/# ru  r   )r   s   "r   r   r1    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)rr  r   r8   rs   )r?   r   r   nearests   &   r   rx  *SpecifierSet._check_prerelease_only_ranges  s_     !,,.LE-emm<G}}$--(?--'EOOO / r   c                   V ^8  d   QhRR/# ru  r   )r   s   "r   r   r1    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.
r6  Fc              3  \   <"   T F!  qP                   P                  4       S8g  x  K#  	  R # 5ir   )r8   r   )r  r7  firsts   & r   r  >SpecifierSet._check_arbitrary_unsatisfiable.<locals>.<genexpr>  s     A=ayy E)=s   ),r?  Tc              3  D   <"   T F  qP                  S4      x  K  	  R # 5ir   r  )r  r7  	candidates   & r   r  r    s     ?hzz),,hs    )	r;  rI  r8   r   r  r   r   r   all)r?   r7  r7  standardr  r  s   &   @@r   rw  +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   rD   r   )r   s   "r   r   r1    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   rD   r   )r   s   "r   r   r1  4  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   r<  rQ   r   rD   r  r  )r?   r  r   r  r8   
check_items   &&&&  r   r  SpecifierSet.contains4  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   r1  b  r  r   c                	    R # r   r   r  s   &&&&r   r  SpecifierSet.filtera  r  r   c               (    V ^8  d   QhRRRRRRRR/# r  r   )r   s   "r   r   r1  j  r  r   c                	    R # r   r   r  s   &&&&r   r  r  i  r  r   c               (    V ^8  d   QhRRRRRRRR/# r  r   )r   s   "r   r   r1  q  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   )r  r  r  r8   s   & r   r  &SpecifierSet.filter.<locals>.<genexpr>  sB      $D /T SSW"00 $s
   0A
A)r   r;  r&   r  _filter_versionsr  rk  )r?   r  r   r  filteredr8   s   &&&f @r   r  r  q  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   r1    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  rI  r8   )r  r:  s   & r   r  0SpecifierSet._filter_versions.<locals>.<genexpr>  s5       + ''6dmmT +s   ?ArD  Fc              3     <"   T F?  w  rpVR 8H  ;'       d+    \        S4      P                  4       VP                  4       8H  x  KA  	  R# 5ir5  r  )r  r  r,  r\  r  s   &   r   r  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r5  r  )r  op_fnr,  r\  r  r  r  s   &   r   r  r    s[       '*NE ; CKDSY7==?399;N63'( '*s   AA)r>  rG  r;  r-  r   r  r   )r?   r  r  r   opsexclude_prereleasesr  r  s   &&f&  @@r   r  SpecifierSet._filter_versions  s      %!' $ #"D   )U2D$S[Tc$iHF~3 &)333 &)   J	
 %)=)=)=  '*	  '*	   
' s6   A0D6DD+D;DDD3D
D)r=  r<  r?  rE  r>  r;  r  r   r  r   )r+   r,   r-   r.   r/   rm   r@   rH  r"  r   r%  rk   r   ra   r`  rT   rg  rl  rr  rz  rx  rw  r  r  r&  r'  r  r  r4   r   r   r   r   r     s    I+3Z  & & &B*A-BC4 !,B%@N#*+NZ __+ + __ ^9@, ,r   )r   r   r   r   )G__conditional_annotations__r/   
__future__r   r#  r0   	functoolsr  r  r&  r   r   r   r   r   r   r	   r
   utilsr   r8   r   r   r   r   r   re   r   r    rD   r  r"   r  r(   Enumr*   total_orderingr6   ro   r   TYPE_CHECKINGrr   r9  _VersionRangerd  re  r   r   r   r   r   r   r   r   r   r   rl  r   ABCMetar   r   r  r  r  r  r  r  r  r  r-  r   )r  s   @r   <module>r     s   # 
    	  U U U ' , 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@, @,F 

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