+
    yj>                      a  0 t $ R t^ RIHt ^ RIt^ RIt^ RIt^ RIHtHtH	t	H
t
HtHt ^RIHtHtHtHtHtHtHtHtHt ^RIHt ^RIHt ]'       d9   ^ RIt^ RIHtHtHt ]P@                  R)8  d   ^ RIH!t! M^ RI"H!t! ^R	I#H$t$ ^R
IH%t% . R*Ot&R R lt'R R lt(R R lt)]! R4      t*]]]+3,          t,]! R],R7      t-R]P\                  R]P^                  R]P`                  R]Pb                  /t2R]3R&   R R lt4 ! R  R]54      t6 ! R! R]Pn                  R"7      t8 ! R# R]84      t9R$ R% lt: ! R& R]84      t;R' R( lt<R# )+z
.. testsetup::

    from packaging.specifiers import Specifier, SpecifierSet, InvalidSpecifier
    from packaging.version import Version
)annotationsN)TYPE_CHECKINGAnyCallableFinalTypeVarUnion)	
FULL_RANGEbounds_for_speccoerce_versionfilter_by_rangesintersect_specifier_boundsmatches_bounds_onlyranges_are_prerelease_onlyresolve_prereleasestrim_release)canonicalize_version)Version)IterableIteratorSequence)	TypeGuard)ranges)IntervalBaseSpecifierInvalidSpecifier	SpecifierSpecifierSetc                   V ^8  d   QhRR/# )   returnz	list[str] )formats   "H/var/www/html/2rare/lib/python3.14/site-packages/packaging/specifiers.py__annotate__r$   <   s           c                     \         # N)__all__r!   r%   r#   __dir__r)   <   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$   @   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_specr2   @   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$   I   s     0 0v 0%; 0r%   c               :    V R J ;'       g    \        V \        4      # r'   )r.   bool)r4   s   "r#   _validate_prer7   I   s    $;//*S$//r%   TUnparsedVersionVar)bound>=<===!=z-dict[str, Callable[[Version, Version], bool]]_DIRECT_COMPARE_OPSc               $    V ^8  d   QhRRRRRR/# )r   	specifierr   parsedr   r    bool | Noner!   )r"   s   "r#   r$   r$   ]   s!      9 g + r%   c                   V P                   w  r#VP                  R4      '       g   VP                  e   R# \        P	                  V4      pVe   V! WP                  V4      4      # VR9   dk   V P                  V4      pVP                  VP                  8w  g.   \        VP                  4      \        VP                  4      8w  d   VR8X  d   W8  # W8  # R# R# )a  Match ``parsed`` against ``specifier`` without building a range.

Handles ``>=``, ``<=``, ``==``, ``!=``, ``<``, ``>`` when the spec is
not a wildcard and ``parsed`` has no local. Returns ``None`` when the
range path must be used. Pre-release policy is left to the caller.
.*N<)rF   >)	_specendswithlocalr?   get_require_spec_versionepochr   release)rA   rB   op_strver_strdirect_comparespec_vs   &&    r#   _fast_matchrS   ]   s      ooOF!9(,,V4N!f&E&Eg&NOO009 <<6<<'<+G<NNL
 ,
 '-m6?HHr%   c                      ] tR t^ztRtRtR# )r   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)__name__
__module____qualname____firstlineno____doc____static_attributes__r!   r%   r#   r   r   z   s    r%   c                     ] tR t^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   zG
Abstract base class for :class:`Specifier` and :class:`SpecifierSet`.
c                   V ^8  d   QhRR/# r   r    r1   r!   )r"   s   "r#   r$   BaseSpecifier.__annotate__   s      c r%   c                    \        V 4      # )z Internal property for match_argsr1   selfs   &r#   _strBaseSpecifier._str   s     4yr%   c                   V ^8  d   QhRR/# r]   r!   )r"   s   "r#   r$   r^      s       r%   c                    R# )zv
Returns the str representation of this Specifier-like object. This
should be representative of the Specifier itself.
Nr!   ra   s   &r#   __str__BaseSpecifier.__str__       r%   c                   V ^8  d   QhRR/# r   r    intr!   )r"   s   "r#   r$   r^      s      # r%   c                    R# )z6
Returns a hash value for this Specifier-like object.
Nr!   ra   s   &r#   __hash__BaseSpecifier.__hash__   ri   r%   c                    V ^8  d   QhRRRR/# r   otherr,   r    r6   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!   rb   rr   s   &&r#   __eq__BaseSpecifier.__eq__   ri   r%   c                   V ^8  d   QhRR/# r   r    rC   r!   )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!   ra   s   &r#   prereleasesBaseSpecifier.prereleases   ri   r%   c                    V ^8  d   QhRRRR/# )r   valuer6   r    Noner!   )r"   s   "r#   r$   r^      s       $ r%   c                    R# )zASetter for :attr:`prereleases`.

:param value: The value to set.
Nr!   rb   r}   s   &&r#   rz   r{      ri   r%   Nc               $    V ^8  d   QhRRRRRR/# )r   itemr1   rz   rC   r    r6   r!   )r"   s   "r#   r$   r^      s!      S { d r%   c                    R# )zB
Determines if the given item is contained within this specifier.
Nr!   )rb   r   rz   s   &&&r#   containsBaseSpecifier.contains   ri   r%   c               (    V ^8  d   QhRRRRRRRR/# 	r   iterablezIterable[UnparsedVersionVar]rz   rC   keyr~   r    zIterator[UnparsedVersionVar]r!   )r"   s   "r#   r$   r^      2     + +.+ !+ 	+
 
&+r%   c                	    R # r'   r!   rb   r   rz   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]rz   rC   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]rz   rC   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      ri   r%   r!   )rc   r'   N.NN)rU   rV   rW   rX   rY   	__slots____match_args__propertyrc   abcabstractmethodrg   rn   ru   rz   setterr   typingoverloadr   rZ   r!   r%   r#   r   r      s    IN  	  	 
 	       	 
 __+ + __  		 	r%   )	metaclassc                  P   ] tR t^t$ RtR?tRt]P                  ! R],           R,           ]P                  ]P                  ,          4      tRRRRRR	R
RRRRRRRRR/tR]R&   R@R R l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R+ R, ltR- R. lt]R/ R0 l4       tR1 R2 ltR3 R4 ltR5 R6 ltRAR7 R8 llt] PB                  RBR9 R: ll4       t"] PB                  RBR; R< ll4       t"RCR= R> llt"R?t#R# )Dr   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*~=
compatibler=   equalr>   	not_equalr<   less_than_equalr;   greater_than_equalrF   	less_thanrG   greater_than===	arbitraryr   
_operatorsNc               $    V ^8  d   QhRRRRRR/# )r   r+   r1   rz   rC   r    r~   r!   )r"   s   "r#   r$   Specifier.__annotate__c  s!     !7 !7S !7K !74 !7r%   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	# )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:r   NN:Nr   N:r   NN:N   Nr   NNN)r   r=   r>   r<   r;   )	_regex	fullmatchr   strip
startswithrH   _prereleases_spec_version_ranges)rb   r+   rz   operatorversions   &&&  r#   __init__Specifier.__init__c  s     {{$$T**"%8#ABBzz|??5!! $R$r(..*:g__;<< $R$r(..*:g $R$r(..*:g'/&9
 ( :> 37r%   c                    V ^8  d   QhRRRR/# )r   r   r1   r    zVersion | Noner!   )r"   s   "r#   r$   r     s     
! 
! 
! 
!r%   c                    V P                   e,   V P                   ^ ,          V8X  d   V P                   ^,          # \        V4      pVf   R# W3V n         V# )zDOne element cache, as only one spec Version is needed per Specifier.N)r   r   )rb   r   version_specifiers   && r#   _get_spec_versionSpecifier._get_spec_version  sV    )d.@.@.Cw.N%%a((*73$%9  r%   c                    V ^8  d   QhRRRR/# )r   r   r1   r    r   r!   )r"   s   "r#   r$   r     s      S W r%   c                4    V P                  V4      pVf   Q hV# )zGet spec version, asserting it's valid (not for === operator).

This method should only be called for operators where version
strings are guaranteed to be valid PEP 440 versions (not ===).
)r   )rb   r   spec_versions   && r#   rL   Specifier._require_spec_version  s&     --g6'''r%   c                   V ^8  d   QhRR/# r   r    zSequence[Interval]r!   )r"   s   "r#   r$   r     s      . r%   c                    V P                   e   V P                   # V P                  pV P                  pVR8X  d   \        pM,V P	                  VP                  R4      4      p\        WV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   rE   )r   r   r   r	   rL   removesuffixr
   )rb   oprP   resultr   s   &    r#   
_to_rangesSpecifier._to_ranges  sg     <<#<<]],,;)3F001E1Ed1KLG$R':Fr%   c                   V ^8  d   QhRR/# rx   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=   rE   )r   rH   rI   r   is_prerelease)rb   r   version_strr   s   &   r#   rz   Specifier.prereleases  sz     ($$$ !%

t t 4 4T : : ((5? $$$r%   c                    V ^8  d   QhRRRR/# r   r}   rC   r    r~   r!   )r"   s   "r#   r$   r     s     " " " "r%   c                	    Wn         R # r'   )r   r   s   &&r#   rz   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$   r     s     / /A /r%   c                	2    V P                   V P                  3# r'   )rH   r   ra   s   &r#   __getstate__Specifier.__getstate__  s     

D--..r%   c                    V ^8  d   QhRRRR/# r   stater,   r    r~   r!   )r"   s   "r#   r$   r     s     D D& DT Dr%   c                	   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)NrH   r   invalidzCannot restore Specifier from )r   r   r.   r/   r0   r2   r7   rH   r   dictrK   	TypeError)rb   r   r+   rz   _	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/# r]   r!   )r"   s   "r#   r$   r     s      # r%   c                (    V P                   ^ ,          # )zHThe operator of this specifier.

>>> Specifier("==1.2.3").operator
'=='
rH   ra   s   &r#   r   Specifier.operator       zz!}r%   c                   V ^8  d   QhRR/# r]   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   ra   s   &r#   r   Specifier.version  r   r%   c                   V ^8  d   QhRR/# r]   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= rF   ()>r   rz   	__class__rU   r1   rb   r4   s   & r#   __repr__Specifier.__repr__
  sU       , T--01 	 4>>**+1SYM#bAAr%   c                   V ^8  d   QhRR/# r]   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"   rH   ra   s   &r#   rg   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# )r   rE   r   )strip_trailing_zero)rH   rI   rL   r   )rb   r   r   r   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/# rk   r!   )r"   s   "r#   r$   r   4  s     * *# *r%   c                	,    \        V P                  4      # r'   )hashr  ra   s   &r#   rn   Specifier.__hash__4  s    D(())r%   c                    V ^8  d   QhRRRR/# rq   r!   )r"   s   "r#   r$   r   7  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.   r1   r   r   NotImplementedr  rt   s   &&r#   ru   Specifier.__eq__7  sm    & eS!!&s5z2 E>>22!!##u'<'<<< $ &%%&s   A- -B Bc                    V ^8  d   QhRRRR/# )r   r   zstr | Versionr    r6   r!   )r"   s   "r#   r$   r   T  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   rb   r   s   &&r#   __contains__Specifier.__contains__T      & }}T""r%   c               $    V ^8  d   QhRRRRRR/# )r   r   UnparsedVersionrz   rC   r    r6   r!   )r"   s   "r#   r$   r   i  s"     6> 6>_ 6>; 6>RV 6>r%   c           	     r   V P                   ^ ,          R8X  d'   \        \        V P                  V.VR7      4      4      # \	        V4      pVf   R# Vf!   \        V P                  V P                  4      pVRJ d   VP                  '       d   R# \        W4      pVe   V# \        V P                  4       V4      # )aW  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:`~packaging.version.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

.. versionchanged:: 26.0

    With ``prereleases=None``, a prerelease now matches. A single
    version has no alternatives, so the :pep:`440` rule to accept
    prereleases when nothing else satisfies the specifier applies.
    Earlier versions rejected it. An unparsable version now returns
    ``False`` instead of raising :exc:`~packaging.version.InvalidVersion`.
r   rz   F)rH   r6   listr   r   r   r   rz   r   rS   r   r   )rb   r   rz   rB   matchs   &&&  r#   r   Specifier.containsi  s    D ::a=E!T[[$[[IJKK%>-d.?.?AQAQRK%F$8$8$8 D)L"4??#4f==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   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     4O 4O4O !4O 5	4O
 
4Or%   c                  aa Vf!   \        V P                  V P                  4      pV P                  R8X  d5   V P                  P                  4       oVV3R lV 4       p\        VSV4      # \        V P                  4       VSV4      # )a  Filter items in the given iterable, that match the specifier.

:param iterable:
    An iterable that can contain version strings and
    :class:`~packaging.version.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:`~packaging.version.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'}]

.. versionchanged:: 26.1

    Added the ``key`` parameter.
r   c              3     <"   T F3  p\        Sf   TMS! V4      4      P                  4       S8X  g   K/  Vx  K5  	  R # 5ir'   )r1   lower).0r   r   
spec_lowers   & r#   	<genexpr>#Specifier.filter.<locals>.<genexpr>  s:      $Ds{tD	:@@BjP $s   ,>
>)	r   r   rz   r   r   r%  _apply_prereleases_filterr   r   )rb   r   rz   r   matchesr'  s   &&&f @r#   r   r    sz    P -d.?.?AQAQRK==E!++-J$G
 -Wc;GG 18S+NNr%   )r   r   rH   r   r   Nr'   r   r   )$rU   rV   rW   rX   rY   r   _specifier_regex_strrecompileVERBOSE
IGNORECASEr   r   __annotations__r   r   rL   r   r   rz   r   r   r   r   r   r   rg   r  rn   ru   r  r   r   r   r   rZ   r!   r%   r#   r   r      sf   &IZx ZZ%%.

R]]0JF 	lgk"[^{	J 	!7F
!* % %6 " "/DB    B$* + +*=:#*6>p __+ + __ 4O 4Or%   c               (    V ^8  d   QhRRRRRRRR/# )	r   r+  r   r   r   rz   rC   r    r   r!   )r"   s   "r#   r$   r$     s0      	0  	r%   c                f   aa Vf   \        V S4      # V'       d   \        V 4      # VV3R lV  4       # )zApply ``prereleases=`` handling to an already-matched iterable.

``None`` means PEP 440 default (buffer pre-releases until a final
appears); ``True`` yields everything; ``False`` drops pre-releases.
c              3     <"   T F6  p\        Sf   TMS! V4      4      ;oe   SP                  '       d   K2  Vx  K8  	  R # 5ir'   )r   r   )r&  r   r   rB   s   & r#   r(  ,_apply_prereleases_filter.<locals>.<genexpr>  s=      D$S[Tc$iHHFQ## 	s
   /A
A)_pep440_filter_prereleasesiter)r+  r   rz   rB   s   &f&@r#   r*  r*    s7     )'377G} r%   c                     ] tR tRtRtR8tR9R 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R( R) ltR* R+ ltR, R- ltR. R/ ltR:R0 R1 llt]P>                  R;R2 R3 ll4       t ]P>                  R;R4 R5 ll4       t R:R6 R7 llt R8t!R# )<r   i  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]rz   rC   r    r~   r!   )r"   s   "r#   r$   SpecifierSet.__annotate__  s(     *( *(-*( !*( 
	*(r%   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        RV n        W n        R# u upi )aL  Initialize a SpecifierSet instance.

:param specifiers:
    The string representation of a specifier or a comma-separated list of
    specifiers which will be parsed and normalized before use.
    May also be an iterable of ``Specifier`` instances, which will be used
    as is.
:param prereleases:
    This tells the SpecifierSet if it should accept prerelease versions if
    applicable or not. The default of ``None`` will autodetect it from the
    given specifiers.

:raises InvalidSpecifier:
    If the given ``specifiers`` are not parseable than this exception will be
    raised.
,r   c              3  >   "   T F  pR \        V4      9   x  K  	  R# 5ir   Nr`   r&  ss   & r#   r(  (SpecifierSet.__init__.<locals>.<genexpr><  s     %K{!es1vo{   TFN)r.   r1   splitr   r/   mapr   _specs_has_arbitraryanyr0   _canonicalized_is_unsatisfiabler   r   )rb   r;  rz   rB  split_specifierss   &&&  r#   r   SpecifierSet.__init__  s    , j#&& 4>3C3CC3HV3HaGGI		3HV16s9FV7W1XDK"':"5D
+DK #&#%Kt{{%K###%Kt{{%K"KD!$++.!3.226 (#  Ws   DDc                   V ^8  d   QhRR/# )r   r    ztuple[Specifier, ...]r!   )r"   s   "r#   r$   r<  F  s      "7 r%   c           	         V P                   '       gD   \        \        P                  \	        V P
                  \        R7      4      4      V n        RV n         V P
                  # )zBDeduplicate, sort, and cache specs for order-sensitive operations.r   T)rJ  r/   r   fromkeyssortedrG  r1   ra   s   &r#   _canonical_specsSpecifierSet._canonical_specsF  s@    """fT[[c.J KLDK"&D{{r%   c                   V ^8  d   QhRR/# rx   r!   )r"   s   "r#   r$   r<  N  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  rA  s   & r#   r(  +SpecifierSet.prereleases.<locals>.<genexpr>\  s     2k}}k   TF)r   rG  rI  ra   s   &r#   rz   SpecifierSet.prereleasesM  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$   r<  b  s     & & & &r%   c                	     Wn         R V n        R # r'   )r   rK  r   s   &&r#   rz   rZ  a  s    !!%r%   c                   V ^8  d   QhRR/# )r   r    z)tuple[tuple[Specifier, ...], bool | None]r!   )r"   s   "r#   r$   r<  f  s     0 0G 0r%   c                	2    V P                   V P                  3# r'   )rG  r   ra   s   &r#   r   SpecifierSet.__getstate__f  s     T..//r%   c                    V ^8  d   QhRRRR/# r   r!   )r"   s   "r#   r$   r<  l  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   rA  s   & r#   r(  ,SpecifierSet.__setstate__.<locals>.<genexpr>w       DeJq)44e   FTc              3  >   "   T F  pR \        V4      9   x  K  	  R# 5ir@  r`   rA  s   & r#   r(  rd  }  s     -Mu!es1vourD  rG  r   rP  c              3  B   "   T F  p\        V\        4      x  K  	  R # 5ir'   rc  rA  s   & r#   r(  rd    re  rf  c              3  >   "   T F  pR \        V4      9   x  K  	  R# 5ir@  r`   rA  s   & r#   r(  rd    s     -S{!es1vo{rD  c              3  B   "   T F  p\        V\        4      x  K  	  R # 5ir'   rc  rA  s   & r#   r(  rd    s     @%Q
1i00%rf  c              3  >   "   T F  pR \        V4      9   x  K  	  R# 5ir@  r`   rA  s   & r#   r(  rd    s     )O;a%3q6/;rD  z!Cannot restore SpecifierSet from r!   )r   rK  r.   r/   r0   allr7   rG  r   rJ  rI  rH  r   rK   	frozensetrR  r1   r   )rb   r   specsrz   r   r   s   &&    r#   r   SpecifierSet.__setstate__l  su   !%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/# r]   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 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   rF   r   r   r   r   s   & r#   r   SpecifierSet.__repr__  sU       , T--01 	 4>>**+1SYM#bAAr%   c                   V ^8  d   QhRR/# r]   r!   )r"   s   "r#   r$   r<    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'
r>  c              3  8   "   T F  p\        V4      x  K  	  R # 5ir'   r`   rA  s   & r#   r(  'SpecifierSet.__str__.<locals>.<genexpr>  s     @(?1A(?rY  )joinrS  ra   s   &r#   rg   SpecifierSet.__str__  s"     xx@(=(=(?@@@r%   c                   V ^8  d   QhRR/# rk   r!   )r"   s   "r#   r$   r<    s     - -# -r%   c                	4    \        V P                  4       4      # r'   )r	  rS  ra   s   &r#   rn   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$   r<    s      / L r%   c                *   \        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        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')>
zFCannot combine SpecifierSets with True and False prerelease overrides.)
r.   r1   r   r  rG  r0   rJ  rH  r   
ValueError)rb   rr   rA   s   && 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/# rq   r!   )r"   s   "r#   r$   r<    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.   r1   r   r   r  rS  rt   s   &&r#   ru   SpecifierSet.__eq__  sT    & ec9-.. U,EE<00!!$$&%*@*@*BBBr%   c                   V ^8  d   QhRR/# rk   r!   )r"   s   "r#   r$   r<    s          r%   c                ,    \        V P                  4      # )z7Returns the number of specifiers in this specifier set.)r0   rG  ra   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$   r<    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')>]
)r8  rG  ra   s   &r#   __iter__SpecifierSet.__iter__  s     DKK  r%   c                   V ^8  d   QhRR/# r   r!   )r"   s   "r#   r$   r<    s     
 
/ 
r%   c                    V P                   e   V P                   # \        R V P                   4       4      V n         V P                   # )zIntersect all specifiers into a single sequence of version ranges.

Empty when unsatisfiable. Callers must ensure ``self._specs``
is non-empty.
c              3  @   "   T F  qP                  4       x  K  	  R # 5ir'   )r   rA  s   & r#   r(  +SpecifierSet._get_ranges.<locals>.<genexpr>  s     1V+Q,,..+s   )r   r   rG  ra   s   &r#   _get_rangesSpecifierSet._get_ranges  s8     <<#<<11V$++1VV||r%   c                   V ^8  d   QhRR/# r   r    r6   r!   )r"   s   "r#   r$   r<    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       4      pW n         V# )an  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

.. versionadded:: 26.1
F)rK  rG  r  _check_arbitrary_unsatisfiablerz   r   )rb   cachedr   s   &  r#   is_unsatisfiableSpecifierSet.is_unsatisfiable  s~      ''M{{{%*D"%%''88:F$**e3/0@0@0BCF!'r%   c                   V ^8  d   QhRR/# r  r!   )r"   s   "r#   r$   r<  A  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'   )r   r%  )r&  rB  firsts   & r#   r(  >SpecifierSet._check_arbitrary_unsatisfiable.<locals>.<genexpr>N  s     A=ayy E)=s   ),r   Tc              3  D   <"   T F  qP                  S4      x  K  	  R # 5ir'   r  )r&  rB  	candidates   & r#   r(  r  f  s     ?hzz),,hs    )	rG  r   r   r%  rI  r   rz   r   rl  )rb   rB  r   standardr  r  s   &   @@r#   r  +SpecifierSet._check_arbitrary_unsatisfiableA  s    !%C1zzU/BQQ	C !$$**,3A9R=A333A9R=AAA #9Q<#7#78	
 %%'''#{{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    zranges.VersionRanger!   )r"   s   "r#   r$   r<  h  s     6 6- 6r%   c                0    ^RI Hp VP                  V 4      # )a3  Return the :class:`~packaging.ranges.VersionRange` this set accepts.

An empty set yields the full range; an unsatisfiable set yields the
empty range. ``===`` specifiers contribute literal-string admission.

>>> SpecifierSet(">=1.0,<2.0").to_range()
<VersionRange '[1.0, 2.0.dev0)'>

.. versionadded:: 26.3
)VersionRange)r   r  _from_specifier_set)rb   r  s   & r#   to_rangeSpecifierSet.to_rangeh  s     	)//55r%   c                    V ^8  d   QhRRRR/# )r   rr   r,   r    r~   r!   )r"   s   "r#   r$   r<  w  s     L LV L Lr%   c                	    \        V\        4      '       g   \        R 4      hV P                  '       g   VP                  '       d   \	        R4      hR# )zexpected a SpecifierSetz+set relations do not support === specifiersN)r.   r   r   rH  r~  rt   s   &&r#   _check_relation_operand$SpecifierSet._check_relation_operandw  sC    %..566%"6"6"6JKK #7r%   c                    V ^8  d   QhRRRR/# r   rr   r   r    r6   r!   )r"   s   "r#   r$   r<  }  s     ; ;| ; ;r%   c                ~    V P                  V4       V P                  4       P                  VP                  4       4      # )a  Return whether every version matching this set also matches other.

:raises ValueError:
    If either set uses ``===`` specifiers, or the two sets were
    given different ``prereleases`` arguments (unset on one side
    counts as different).
:raises TypeError:
    If other is not a :class:`SpecifierSet`.

>>> SpecifierSet(">=3.12,<3.13").is_subset(SpecifierSet(">=3.12"))
True
>>> SpecifierSet(">=3.12").is_subset(SpecifierSet(">=3.12,<3.13"))
False

.. versionadded:: 26.3
)r  r  	is_subsetrt   s   &&r#   r  SpecifierSet.is_subset}  s0    " 	$$U+}}(()9::r%   c                    V ^8  d   QhRRRR/# r  r!   )r"   s   "r#   r$   r<    s     = = =$ =r%   c                ~    V P                  V4       V P                  4       P                  VP                  4       4      # )a  Return whether every version matching other also matches this set.

:raises ValueError:
    If either set uses ``===`` specifiers, or the two sets were
    given different ``prereleases`` arguments (unset on one side
    counts as different).
:raises TypeError:
    If other is not a :class:`SpecifierSet`.

>>> SpecifierSet(">=3.12").is_superset(SpecifierSet(">=3.12,<3.13"))
True

.. versionadded:: 26.3
)r  r  is_supersetrt   s   &&r#   r  SpecifierSet.is_superset  s0     	$$U+}}**5>>+;<<r%   c                    V ^8  d   QhRRRR/# r  r!   )r"   s   "r#   r$   r<    s     = = =$ =r%   c                ~    V P                  V4       V P                  4       P                  VP                  4       4      # )a  Return whether this set and other share no matching versions.

:raises ValueError:
    If either set uses ``===`` specifiers, or the two sets were
    given different ``prereleases`` arguments (unset on one side
    counts as different).
:raises TypeError:
    If other is not a :class:`SpecifierSet`.

>>> SpecifierSet("<3.12").is_disjoint(SpecifierSet(">=3.12"))
True
>>> SpecifierSet("<3.12").is_disjoint(SpecifierSet(">=3.11"))
False

.. versionadded:: 26.3
)r  r  is_disjointrt   s   &&r#   r  SpecifierSet.is_disjoint  s0    " 	$$U+}}**5>>+;<<r%   c                    V ^8  d   QhRRRR/# )r   r   r  r    r6   r!   )r"   s   "r#   r$   r<    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  rz   rC   	installedr    r6   r!   )r"   s   "r#   r$   r<    s>     VN VNVN !VN 	VN
 
V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e   V P                  '       g   VP
                  f   V P                  '       d   VP                  '       d   VRJ g   Vf   V P                  RJ d   R# V P                  pVfH   V P                   F  p\        Wt4      pVf    MV'       d   K   R# 	  R# V P                  4       ;q`n        \        Wd4      # \        \        V P                  V.VR7      4      4      # )aT  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:`~packaging.version.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

.. versionchanged:: 26.0

    With ``prereleases=None``, a prerelease now matches. A single
    version has no alternatives, so the :pep:`440` rule to accept
    prereleases when nothing else satisfies the specifiers applies.
    Earlier versions rejected it. An unparsable version now returns
    ``False`` instead of raising :exc:`~packaging.version.InvalidVersion`.
TFr  )r   r   rH  r.   r   rJ   rG  r   r   rS   r  r   r6   r  r   )	rb   r   rz   r  r   
check_itemboundsr+   r  s	   &&&&     r#   r   SpecifierSet.contains  s   P !&91F1F1FK ?t222:dG;T;TJ J '''%$$$u$'D,=,=,F\\F~
 !KKD'6E} 5$ (  (,(8(8(::&v77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$   r<  %  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$   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<  4  s>     SE SESE !SE 5	SE
 
SEr%   c                J  aa Vf   V P                   e   V P                   pV P                  '       df   V P                  '       d'   V P                  oVV3R lV 4       p\        VSV4      # V P                  pVf   V P                  4       p\        WQSV4      # \        VSV4      # )aG  Filter items in the given iterable, that match the specifiers in this set.

:param iterable:
    An iterable that can contain version strings and
    :class:`~packaging.version.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:`~packaging.version.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']

.. versionchanged:: 26.0

    Prerelease filtering now follows the PEP 440 recommendation of
    yielding prereleases only when no final release is present.

.. versionchanged:: 26.1

    Added the ``key`` parameter.
c              3     <a"   T FK  o\         ;QJ d     VV3R  lS 4       F  '       d   K   RM	  RM! VV3R  lS 4       4      '       g   KG  Sx  KM  	  R# 5i)c              3  b   <"   T F$  pTP                  Sf   SMS! S4      RR7      x  K&  	  R # 5i)NTr  r  )r&  rB  r   r   s   & r#   r(  0SpecifierSet.filter.<locals>.<genexpr>.<genexpr>z  s3      !&A 

3;4CISW
XX!&s   ,/FTN)rl  )r&  r   r   rn  s   &@r#   r(  &SpecifierSet.filter.<locals>.<genexpr>w  sD       (s !&sss !&  D (s   AAA
A)rz   rG  rH  r*  r   r  r   )rb   r   rz   r   r+  r   rn  s   &&&f  @r#   r   r  4  s    x 4#3#3#?**K;;;""" ( 1#{KK\\F~))+#Fc;GG )3DDr%   )rJ  rH  rK  r   r   rG  r,  r   r   )"rU   rV   rW   rX   rY   r   r   rS  r   rz   r   r   r   r   rg   rn   r  ru   r  r  r  r  r  r  r  r  r  r  r  r   r   r   r   rZ   r!   r%   r#   r   r     s    $I*(X  & & &07GrB*A-@C4 !
!F%@N6L;(=$=(#*VNp __+ + __ SE SE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$   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   appendr   )r   r   all_nonfinalarbitrary_stringsfound_finalr   rB   s   &&     r#   r7  r7    s      !L#%KTC> 
!((.##D)###,,,"J {%1 6   - 	 s@   .B?:B?,B?4B?9B;:B?B?-B?2B=3	B?=B?)r   
   )r   r   r   r   )=__conditional_annotations__rY   
__future__r   r   r.  r   r   r   r   r   r   r   r   r	   r
   r   r   r   r   r   r   r   utilsr   r   r   syscollections.abcr   r   r   version_infor   typing_extensionsr   r   r   r(   r)   r2   r7   r8   r1   r  r9   __ge____le__ru   __ne__r?   r2  rS   r~  r   ABCMetar   r   r*  r   r7  )r  s   @r#   <module>r     s$   # 
 	  
 
 
 ( <<
7"$/!0 CL%1I  	'..'..'..'..	F B :	z 	Sckk SlIO IOX,I
E= I
EX' r%   