Team Ai
Datasetpublic

codekingpro/portable-devtools

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes15kdownloads
specifiers.cpython-313.pyc700 linesDownload Raw Back to __pycache__
1�

2
�jZ����%SrSSKJr SSKrSSKrSSKrSSKrSSKrSSKrSSK	r	SSK	J3r4JrJrJ
r
JrJrJrJrJr SSKJr SSKJrJr \R0S:�aSS	K	Jr O
\5(aSS	KJr /S6QrS:SjrS;SjrS<S
jr\"S5r\\\ 4r!\"S\!S9r"\\\ /\#4r$\"S5r%S\&S'S=Sjr'"SS\RP5r)\RT"SS55r+\RT"SS55r,\RT"SS55r-\	R(a\\\+S4r.\/\,\-4r0\,"SS5r1\-"SS5r2\1\244r3S\&S'S>S jr4S?S!jr5S@S"jr6S@S#jr7SAS$jr8S@S%jr9S@S&jr:S@S'jr;SBS(jr<"S)S*\=5r>"S+S,\R~S-9r@"S.S/\@5rA\R�"S05rCSCS1jrDSDS2jrESES3jrFSFS4jrGSGS5jrHSHS6jrISIS7jrJ"S8S9\@5rKg)Jz�7.. testsetup::8 9    from packaging.specifiers import Specifier, SpecifierSet, InvalidSpecifier10    from packaging.version import Version11�)�annotationsN)	�
TYPE_CHECKING�Any�Callable�Final�Iterable�Iterator�Sequence�TypeVar�Union�)�canonicalize_version)�InvalidVersion�Version)��12)�	TypeGuard)�
BaseSpecifier�InvalidSpecifier�	Specifier�SpecifierSetc��[$�N)�__all__���ZD:\code\apps\devtools\python\user_packages\Python313\site-packages\packaging/specifiers.py�__dir__r0s���Nrc��[U[5=(aB [U5S:H=(a- [US[5=(a [US[5$)N�rr
)�13isinstance�tuple�len�str)�specs r�_validate_specr&4sI���4���	%���I��N�	%��t�A�w��$�	%�
�t�A�w��$�	rc�8�USL=(d [U[5$r)r!�bool)�pres r�
_validate_prer*=s���$�;�/�*�S�$�/�/r�T�UnparsedVersionVar)�boundz0.dev0zFinal[Version]�_MIN_VERSIONc��[U5nUS:�a#XS-14S:XaUS-nUS:�a
XS-15S:XaMU[U5:XaU$USU$)zDStrip trailing zeros from a release tuple for normalized comparison.r
rN)r#)�release�ends  r�
_trim_releaser2Js\��16
�g�,�C�17
��'�g�A�g�&�!�+��q�����'�g�A�g�&�!�+��S��\�)�7�<�w�t��}�<rc�\�\rSrSrSr\R"5r\R"5rSr	g)�
_BoundaryKind�Rz5Where a boundary marker sits in the version ordering.rN)18�__name__�19__module__�__qualname__�__firstlineno__�__doc__�enum�auto�AFTER_LOCALS�AFTER_POSTS�__static_attributes__rrrr4r4Rs��?��9�9�;�L��)�)�+�Krr4c�X�\rSrSrSrSrSSjrSSjrS
SjrSSjr	SSjr20SS	jrSrg21)�_BoundaryVersion�Ya�A point on the version line between two real PEP 440 versions.22 23Some specifier semantics imply boundaries between real versions:24``<=1.0`` includes ``1.0+local`` and ``>1.0`` excludes25``1.0.post0``.  No real :class:`Version` falls on those boundaries,26so this class creates values that sort between the real versions27on either side.28 29Two kinds exist, shown relative to a base version V::30 31    V < V+local < AFTER_LOCALS(V) < V.post0 < AFTER_POSTS(V)32 33``AFTER_LOCALS`` sits after V and every V+local, but before34V.post0.  Upper bound of ``<=V``, ``==V``, ``!=V``.35 36``AFTER_POSTS`` sits after every V.postN, but before the next37release segment.  Lower bound of ``>V`` (final or pre-release V)38to exclude post-releases per PEP 440.39)�_kind�_trimmed_release�versionc�P�XlX l[UR5Ulgr)rErCr2r0rD)�selfrE�kinds   r�__init__�_BoundaryVersion.__init__qs�����40� -�g�o�o� >��rc���URnURUR:Xa=[UR5UR:XaUR41UR42:XdgUR[R:Xa9URUR:H=(a URUR:H$URUR:H=(d URSL$)z6Is ``other`` a version that this boundary sorts above?FN)rE�epochr2r0rDr)rCr4r=�post�dev)rG�other�vs   r�43_is_family�_BoundaryVersion._is_familyvs����L�L���K�K�1�7�7�"��e�m�m�,��0E�0E�E��	�	�Q�U�U�"���:�:��3�3�3��:�:����'�>�E�I�I����,>�>��y�y�A�E�E�!�;�U�Z�Z�t�%;�;rc��[U[5(a9URUR:H=(a URUR:H$[$r)r!rArErC�NotImplemented�rGrOs  r�__eq__�_BoundaryVersion.__eq__�s;���e�-�.�.��<�<�5�=�=�0�N�T�Z�Z�5�;�;�5N�N��rc�D�[U[5(a`URUR:waURUR:$URRURR:$URU5(+=(a URU:$r)r!rArErC�valuerQrUs  r�__lt__�_BoundaryVersion.__lt__�sr���e�-�.�.��|�|�u�}�}�,��|�|�e�m�m�3�3��:�:�#�#�e�k�k�&7�&7�7�7��?�?�5�)�)�B�d�l�l�U�.B�Brc�D�[URUR45$r)�hashrErC�rGs r�__hash__�_BoundaryVersion.__hash__�s���T�\�\�4�:�:�.�/�/rc�~�URRSUR<SURRS3$)N�(z, �))�	__class__r6rErC�namer^s r�__repr__�_BoundaryVersion.__repr__�s4���.�.�)�)�*�!�D�L�L�+;�2�d�j�j�o�o�=N�a�P�PrN)rErrHr4�return�None)rOrrhr(�rO�objectrhr()rOz_BoundaryVersion | Versionrhr(�rh�int�rhr$)
r6r7r8r9r:�	__slots__rIrQrVrZr_rfr?rrrrArAYs.���(9�I�?�44
<��45C�0�QrrAc�N�\rSrSrSrSrS46SjrSSjrSSjrS
Sjr	SSjr47Srg	)�_LowerBound�z�Lower bound of a version range.48 49A version *v* of ``None`` means unbounded below (-inf).50At equal versions, ``[v`` sorts before ``(v`` because an inclusive51bound starts earlier.52��	inclusiverEc��XlX lgr�rErt�rGrErts   rrI�_LowerBound.__init__������"�rc��[U[5(d[$URUR:H=(a URUR:H$r�r!rqrTrErtrUs  rrV�_LowerBound.__eq__��:���%��-�-�!�!��|�|�u�}�}�,�R����5�?�?�1R�Rrc�8�[U[5(d[$URcURSL$URcgURUR:waURUR:$UR=(a UR(+$)NFr{rUs  rrZ�_LowerBound.__lt__�st���%��-�-�!�!��<�<���=�=��,�,��=�=� ���<�<�5�=�=�(��<�<�%�-�-�/�/��~�~�5�e�o�o�"5�5rc�D�[URUR45$r�r]rErtr^s rr_�_LowerBound.__hash__�����T�\�\�4�>�>�2�3�3rc��UR(aSOSnSURRSUUR<S3$)N�[rb�<� �>�rtrdr6rE�rG�brackets  rrf�_LowerBound.__repr__�s8�����#�S���4�>�>�*�*�+�1�W�I�d�l�l�5E�Q�G�GrN�rE�_VersionOrBoundaryrtr(rhrirj)rOrqrhr(rlrn�r6r7r8r9r:rorIrVrZr_rfr?rrrrqrq��)���)�I�#�S�536�4�Hrrqc�N�\rSrSrSrSrS54SjrSSjrSSjrS
Sjr	SSjr55Srg	)�_UpperBound��z�Upper bound of a version range.56 57A version *v* of ``None`` means unbounded above (+inf).58At equal versions, ``v)`` sorts before ``v]`` because an exclusive59bound ends earlier.60rsc��XlX lgrrvrws   rrI�_UpperBound.__init__�ryrc��[U[5(d[$URUR:H=(a URUR:H$r�r!r�rTrErtrUs  rrV�_UpperBound.__eq__�r}rc��[U[5(d[$URcgURcgURUR:waURUR:$UR(+=(a UR$�NFTr�rUs  rrZ�_UpperBound.__lt__�sh���%��-�-�!�!��<�<����=�=� ���<�<�5�=�=�(��<�<�%�-�-�/�/��>�>�!�5�e�o�o�5rc�D�[URUR45$rr�r^s rr_�_UpperBound.__hash__�r�rc��UR(aSOSnSURRSUR<US3$)N�]rcr�r�r�r�r�s  rrf�_UpperBound.__repr__�s8�����#�S���4�>�>�*�*�+�1�T�\�\�,<�W�I�Q�G�GrNr�rj)rOr�rhr(rlrnr�rrrr�r��r�rr�Fztuple[_VersionRange]�_FULL_RANGEc���URb
URcgURUR:Xa$UR=(a UR(+$URUR:�$)zHTrue when the range defined by *lower* and *upper* contains no versions.Frv)�lower�uppers  r�_range_is_emptyr��sQ���}�}���
�
� 5���}�}��
�
�%��O�O�7����8�8��=�=�5�=�=�(�(rc�4�/nS=p4U[U5:a�U[U5:atXupVXupx[XW5n	[Xh5n61[X�5(dUR	X�45 Xh:aUS-
nOUS-
nU[U5:aU[U5:aMtU$)zFIntersect two sorted, non-overlapping range lists (two-pointer merge).rr
)r#�max�minr��append)�left�right�result�62left_index�right_index�63left_lower�64left_upper�right_lower�right_upperr�r�s           r�_intersect_rangesr��s���65#%�F� � �J�66�s�4�y�67 �[�3�u�:�%=�!%�!1��68�#(�#5� ���J�,���J�,���u�,�,��M�M�5�.�)��#��!�O�J��1��K��s�4�y�69 �[�3�u�:�%=� �Mrc��/URSSQURSS-P7n[R"URUSS9$)z5Smallest version in the next prefix: 1.2 -> 1.3.dev0.N�����r
r�rLr0rN)r0r�70from_partsrL)rEr0s  r�_next_prefix_dev0r�sC��>������$�>�g�o�o�b�&9�A�&=�>�G����G�M�M�7��J�Jrc�V�[R"URURSS9$)z7The .dev0 of a version's base release: 1.2 -> 1.2.dev0.rr�)rr�rLr0�rEs r�71_base_dev0r�s �����G�M�M�7�?�?�PQ�R�Rrc�l�[U[5(d[U5nU$U$![a gf=fr)r!rrr�s r�_coerce_versionr�$s=���g�w�'�'�	��g�&�G��N�7�N���	��	�s�&�723�3c�>�URcU$URSS9$)N)�local)r��__replace__r�s r�_public_versionr�-s%���}�}�������T��*�*rc�$�URSSSS9$)zqThe version that *version* is a post-release of.73 741.0.post1 -> 1.0, 1.0a1.post0 -> 1.0a1, 1.0.post0.dev1 -> 1.0.75N�rMrNr��r�r�s r�76_post_baser�3s��77���D�d�$��?�?rc�"�URSSS9$)zREarliest pre-release of *version*.78 791.2 -> 1.2.dev0, 1.2.post1 -> 1.2.post1.dev0.80rN�rNr�r�r�s r�_earliest_prereleaser�;s��81���1�D��1�1rc�4�Ucg[U[5(a\URnUR(aUR	SSSS9$UR82bUR83S-OSnUR	USS9$UR(dU$UR	SSSS9$)z:Smallest non-pre-release version at or above *v*, or None.N)r)rNr�r
r)rMr�)r!rArE�
is_prereleaser�rM)rP�inner�ks   r�_nearest_non_prereleaser�Cs���	�y���!�%�&�&��	�	������$�$��4�t�$�D�D�!&�84�85� 6�U�Z�Z�!�^�A��� � �a�t� �4�4��?�?����=�=�T�t�4�=�8�8rc��\rSrSrSrSrg)riXz�86Raised when attempting to create a :class:`Specifier` with a specifier87string that is invalid.88 89>>> Specifier("lolwat")90Traceback (most recent call last):91    ...92packaging.specifiers.InvalidSpecifier: Invalid specifier: 'lolwat'93rN)r6r7r8r9r:r?rrrrrXs��rrc���\rSrSrSrSr\SSj5r\RSSj5r94\RSSj5r\RSSj5r\\RSSj55r
\
RSS	j5r
\RSSSjj5r\R"SSSjj5r\R"SSS
jj5r\RSSSjj5rSrg95)ridr)�_strc��[U5$)z Internal property for match_args�r$r^s rr��BaseSpecifier._strhs���4�y�rc��g)zv96Returns the str representation of this Specifier-like object. This97should be representative of the Specifier itself.98Nrr^s r�__str__�BaseSpecifier.__str__m��rc��g)z699Returns a hash value for this Specifier-like object.100Nrr^s rr_�BaseSpecifier.__hash__tr�rc��g)z�101Returns a boolean representing whether or not the two Specifier-like102objects are equal.103 104:param other: The other object to check against.105NrrUs  rrV�BaseSpecifier.__eq__zr�rc��g)z�Whether or not pre-releases as a whole are allowed.106 107This can be set to either ``True`` or ``False`` to explicitly enable or disable108prereleases or it can be set to ``None`` (the default) to use default semantics.109Nrr^s r�prereleases�BaseSpecifier.prereleases�r�rc��g)zASetter for :attr:`prereleases`.110 111:param value: The value to set.112Nr�rGrYs  rr�r��r�rNc��g)zB113Determines if the given item is contained within this specifier.114Nr�rG�itemr�s   r�contains�BaseSpecifier.contains�r�rc��grr�rG�iterabler��keys    r�filter�BaseSpecifier.filter����(+rc��grrr�s    rr�r�����rc��g)z}115Takes an iterable of items and filters them so that only items which116are contained within this specifier are allowed in it.117Nrr�s    rr�r��r�rrnrlrj�rh�bool | None)rYr(rhrir)r�r$r�r�rhr(�N.�r�zIterable[UnparsedVersionVar]r�r�r�rirhzIterator[UnparsedVersionVar]�r�zIterable[T]r�r�r�zCallable[[T], UnparsedVersion]rhzIterator[T]�NN�r��
Iterable[Any]r�r�r��'Callable[[Any], UnparsedVersion] | Nonerh�
Iterator[Any])r6r7r8r9ro�__match_args__�propertyr��abc�abstractmethodr�r_rVr��setterr��typing�overloadr�r?rrrrrds����I��N�
����	������	������118	��������������������	������119�_�_�$(��	+�.�+�!�+��	+�120121&�+��+��_�_�$(�.1�	���!��,�	�122123����	���$(�7;�		��	�!�	�5�		�124125�	��	rr)�	metaclassc	��\rSrSr%SrSrSr\R"S\-S-\R\R-5rSSSS	S126SSS
S.rS\
S'S2S3SjjrS4SjrS5SjrS6SjrS7SjrS7Sjr\S8Sj5r\R,S9Sj5rS:SjrS;Sjr\S<Sj5r\S<Sj5rS<SjrS<Sjr\S=S j5rS>S!jrS?S"jrS@S#jr SAS$jr!SBS%jr"SAS&jr#SAS'jr$SAS(jr%SAS)jr&SCS*jr'SCS+jr(SDS,jr)SES-jr*SFSGS.jjr+\,RZSHSIS/jj5r.\,RZSHSJS0jj5r.SKSLS1jjr.Sr/g)Mri�a�This class abstracts handling of version specifiers.127 128.. tip::129 130    It is generally not required to instantiate this manually. You should instead131    prefer to work with :class:`SpecifierSet` instead, which can parse132    comma-separated version specifiers (which is what package metadata contains).133 134Instances are safe to serialize with :mod:`pickle`. They use a stable135format so the same pickle can be loaded in future packaging releases.136 137.. versionchanged:: 26.2138 139    Added a stable pickle format. Pickles created with packaging 26.2+ can140    be unpickled with future releases.  Backward compatibility with pickles141    from packaging < 26.2 is supported but may be removed in a future142    release.143)�_prereleases�_ranges�_spec�
_spec_version�_wildcard_splita144        (?:145            (?:146                # The identity operators allow for an escape hatch that will147                # do an exact string match of the version you wish to install.148                # This will not be parsed by PEP 440 and we cannot determine149                # any semantic meaning from it. This operator is discouraged150                # but included entirely as an escape hatch.151                ===  # Only match for the identity operator152                \s*153                [^\s;)]*  # The arbitrary version can be just about anything,154                          # we match everything except for whitespace, a155                          # semi-colon for marker support, and a closing paren156                          # since versions can be enclosed in them.157            )158            |159            (?:160                # The (non)equality operators allow for wild card and local161                # versions to be specified so we have to define these two162                # operators separately to enable that.163                (?:==|!=)            # Only match for equals and not equals164 165                \s*166                v?167                (?:[0-9]+!)?          # epoch168                [0-9]+(?:\.[0-9]+)*   # release169 170                # You cannot use a wild card and a pre-release, post-release, a dev or171                # local version together so group them with a | and make them optional.172                (?:173                    \.\*  # Wild card syntax of .*174                    |175                    (?a:                                  # pre release176                        [-_\.]?177                        (alpha|beta|preview|pre|a|b|c|rc)178                        [-_\.]?179                        [0-9]*180                    )?181                    (?a:                                  # post release182                        (?:-[0-9]+)|(?:[-_\.]?(post|rev|r)[-_\.]?[0-9]*)183                    )?184                    (?a:[-_\.]?dev[-_\.]?[0-9]*)?         # dev release185                    (?a:\+[a-z0-9]+(?:[-_\.][a-z0-9]+)*)? # local186                )?187            )188            |189            (?:190                # The compatible operator requires at least two digits in the191                # release segment.192                (?:~=)               # Only match for the compatible operator193 194                \s*195                v?196                (?:[0-9]+!)?          # epoch197                [0-9]+(?:\.[0-9]+)+   # release  (We have a + instead of a *)198                (?:                   # pre release199                    [-_\.]?200                    (alpha|beta|preview|pre|a|b|c|rc)201                    [-_\.]?202                    [0-9]*203                )?204                (?:                                   # post release205                    (?:-[0-9]+)|(?:[-_\.]?(post|rev|r)[-_\.]?[0-9]*)206                )?207                (?:[-_\.]?dev[-_\.]?[0-9]*)?          # dev release208            )209            |210            (?:211                # All other operators only allow a sub set of what the212                # (non)equality operators do. Specifically they do not allow213                # local versions to be specified nor do they allow the prefix214                # matching wild cards.215                (?:<=|>=|<|>)216 217                \s*218                v?219                (?:[0-9]+!)?          # epoch220                [0-9]+(?:\.[0-9]+)*   # release221                (?a:                   # pre release222                    [-_\.]?223                    (alpha|beta|preview|pre|a|b|c|rc)224                    [-_\.]?225                    [0-9]*226                )?227                (?a:                                   # post release228                    (?:-[0-9]+)|(?:[-_\.]?(post|rev|r)[-_\.]?[0-9]*)229                )?230                (?a:[-_\.]?dev[-_\.]?[0-9]*)?          # dev release231            )232        )233        z\s*�234compatible�equal�	not_equal�less_than_equal�greater_than_equal�	less_than�greater_than�	arbitrary)�~=�==�!=�<=�>=r�r��===r�235_operatorsNc��URRU5(d[SU<35eUR5nUR	S5(aUSSUSSR5pCOEUR	S5(aUSSUSSR5pCOUSSUSSR5pCX44UlX lSUlSUlSUl	g)a�Initialize a Specifier instance.236 237:param spec:238    The string representation of a specifier which will be parsed and239    normalized before use.240:param prereleases:241    This tells the specifier if it should accept prerelease versions if242    applicable or not. The default of ``None`` will autodetect it from the243    given specifiers.244:raises InvalidSpecifier:245    If the given specifier is invalid (i.e. bad syntax).246zInvalid specifier: rNr)rrrrrr r
)247�_regex�	fullmatchr�strip�248startswithrrrrr)rGr%r��operatorrEs     rrI�Specifier.__init__=s����{�{�$�$�T�*�*�"�%8���#A�B�B��z�z�|���?�?�5�!�!� $�R�a��$�q�r�(�.�.�*:�g�
�_�_�;�
<�
<� $�R�a��$�q�r�(�.�.�*:�g� $�R�a��$�q�r�(�.�.�*:�g�'/�&9��249�(��:>���>B���8<��rc��URb"URSU:XaURS$[U5nUcgX4UlU$)zDOne element cache, as only one spec Version is needed per Specifier.Nrr
)rr�)rGrE�version_specifiers   r�_get_spec_version�Specifier._get_spec_versioncsV�����)�d�.@�.@��.C�w�.N��%�%�a�(�(�+�G�4���$��%�9��� � rc�2�URU5nUceU$)z�Get spec version, asserting it's valid (not for === operator).250 251This method should only be called for operators where version252strings are guaranteed to be valid PEP 440 versions (not ===).253)r )rGrE�spec_versions   r�_require_spec_version�Specifier._require_spec_versionos&���-�-�g�6���'�'�'��rc��URbUR$URnURnUS:Xa[Ul[$UR	S5(aURX5nOUR
X5nX0lU$)z�Convert this specifier to sorted, non-overlapping version ranges.254 255Each standard operator maps to one or two ranges.  ``===`` is256modeled as full range (actual check done separately).  Cached.257r�.*)rrrEr��endswith�_wildcard_ranges�_standard_ranges)rG�op�ver_strr�s    r�258_to_ranges�Specifier._to_rangesysy���<�<�#��<�<��
�]�]���,�,��
��;�&�D�L������D�!�!��*�*�2�7�F��*�*�2�7�F����
rc���URUSS5n[U5n[U5nUS:Xa[US5[	US54/$[259[	US54[US5[4/$)N�����rTF)r$r�r�rqr��_NEG_INF�_POS_INF)rGr+r,�baser�r�s      rr)�Specifier._wildcard_ranges�sy���)�)�'�#�2�,�7���4� ��!�$�'��
��:� ���-�{�5�%�/H�I�J�J��{�5�%�0�1�
���
%�x�0�260�	261rc�,�URU5nUS:Xa[US5[4/$US:Xa+[[	[U[R5S54/$US:Xa�URb0URURS-SS9n[US5[4/$URb1URURS-SSS9n[US5[4/$[[U[R5S	5[4/$US262:XaBUR(aUOURSSS9nU[::a/$[[	US	54/$SU;n[U[R5nU(aUOUnUS:Xa[US5[	US54/$US
:Xa$[[	US	54[US	5[4/$US:Xa>URURSSS9n	[US5[	[U	5S	54/$[!SU<35e)NrTrr�r
r�rr�Fr��+rrrr�)r0�Unknown operator: )r$rqr2r1r�rAr4r=rNr�rMr>r�r.r0r��263ValueError)264rGr+r,rP�	lower_verr-�	has_local�after_localsr��prefixs265          rr*�Specifier._standard_ranges�s+���&�&�w�/��
��:� ��D�)�8�4�5�5�
��:��� 0��M�4N�4N� O�QU�V���
���9��u�u� ��M�M�a�e�e�a�i�t�M�D�	�$�Y��5�x�@�A�A��v�v�!��M�M�q�v�v��z�q��M�M�	�$�Y��5�x�@�A�A� � 0��M�4M�4M� N�PU�V����
���9����A�a�m�m���m�.N�E���$��	��{�5�%�8�9�:�:��7�N�	�'��=�+E�+E�F����L��
��:� ��D�)�;�u�d�+C�D�E�E�
��:��;�q�%�0�1��U�E�*�H�5��
�266��:��]�]�1�9�9�S�b�>�]�:�F��Q��%�{�3D�V�3L�e�'T�U��
��-�b�V�4�5�5rc���URbUR$URupUS:XagUS:XaURS5(agURU5nUcgUR$)NrFrr')rrr(r r�)rGr�version_strrEs    rr��Specifier.prereleases�sz�����(��$�$�$�!%�267�268����t����t��� 4� 4�T� :� :���(�(��5���?���$�$�$rc��Xlgr)rr�s  rr�r@�s��!�rc�2�URUR4$r)rrr^s r�__getstate__�Specifier.__getstate__�s���269�270�D�-�-�.�.rc��SUlSUlSUl[U[5(a�[U5S:Xa1Uup#[
U5(a[U5(a
X lX0l	g[U5S:Xal[US[5(aTUupEURS5nURSS5n[
U5(a[U5(a
X lX0l	g[U[5(aPURS5nURSS5n[
U5(a[U5(a
X lX0l	g[SU<35e)Nr r
rr�invalidzCannot restore Specifier from )
rrrr!r"r#r&r*rr�dict�get�	TypeError)rG�stater%r��_�	slot_dicts      r�__setstate__�Specifier.__setstate__s ��!���#�������e�U�#�#��5�z�Q��$)�!��!�$�'�'�M�+�,F�,F�!%�J�(3�%���5�z�Q��:�e�A�h��#=�#=�$��� �}�}�W�-��'�m�m�N�I�F��!�$�'�'�M�+�,F�,F�!%�J�(3�%���e�T�"�"��9�9�W�%�D��)�)�N�I�>�K��d�#�#�
�k�(B�(B�!�271�$/�!���8��	�B�C�Crc� �URS$)zHThe operator of this specifier.272 273>>> Specifier("==1.2.3").operator274'=='275r�rr^s rr�Specifier.operator$����z�z�!�}�rc� �URS$)zIThe version of this specifier.276 277>>> Specifier("==1.2.3").version278'1.2.3'279r
rPr^s rrE�Specifier.version-rRrc��URbSUR<3OSnSURRS[	U5<US3$)aA representation of the Specifier that shows all internal state.280 281>>> Specifier('>=1.0.0')282<Specifier('>=1.0.0')>283>>> Specifier('>=1.0.0', prereleases=False)284<Specifier('>=1.0.0', prereleases=False)>285>>> Specifier('>=1.0.0', prereleases=True)286<Specifier('>=1.0.0', prereleases=True)>287�, prereleases=�r�rb�)>�rr�rdr6r$�rGr)s  rrf�Specifier.__repr__6sU��� � �,��T�-�-�0�1��	��4�>�>�*�*�+�1�S��Y�M�#��b�A�Arc�4�SR"UR6$)z�A string representation of the Specifier that can be round-tripped.288 289>>> str(Specifier('>=1.0.0'))290'>=1.0.0'291>>> str(Specifier('>=1.0.0', prereleases=False))292'>=1.0.0'293z{}{})�formatrr^s rr��Specifier.__str__Hs���}�}�d�j�j�)�)rc��URupUS:XdURS5(aX4$URU5n[X1S:gS9nX4$)Nrr'r��strip_trailing_zero)rr(r$r)rGrrEr#�canonical_versions     r�_canonical_spec�Specifier._canonical_specRs]�� �J�J����u��� 0� 0�� 6� 6��$�$��1�1�'�:��0��4�/?�294���*�*rc�,�[UR5$r)r]rcr^s rr_�Specifier.__hash__`s���D�(�(�)�)rc��[U[5(aUR[U55nO [XR5(d[$UR295UR296:H$![a	 [s$f=f)a�Whether or not the two Specifier-like objects are equal.297 298:param other: The other object to check against.299 300The value of :attr:`prereleases` is ignored.301 302>>> Specifier("==1.2.3") == Specifier("== 1.2.3.0")303True304>>> (Specifier("==1.2.3", prereleases=False) ==305...  Specifier("==1.2.3", prereleases=True))306True307>>> Specifier("==1.2.3") == "==1.2.3"308True309>>> Specifier("==1.2.3") == Specifier("==1.2.4")310False311>>> Specifier("==1.2.3") == Specifier("~=1.2.3")312False313)r!r$rdrrTrcrUs  rrV�Specifier.__eq__csm��&�e�S�!�!�
&����s�5�z�2���E�>�>�2�2�!�!��#�#�u�'<�'<�<�<��$�
&�%�%�
&�s�A+�+A>�=A>c�>�[USURU35nU$)N�	_compare_)�getattrr)rGr+�operator_callables   r�
_get_operator�Specifier._get_operator�s+��.5��I�d�o�o�b�1�2�3�/314��!� rc315���[[[R"[[U555SS5nUS-
nUR
X5=(a URX5$)Nr�r')�
_version_join�list�	itertools�	takewhile�_is_not_suffix�_version_split�_compare_greater_than_equal�_compare_equal)rG�prospectiver%r<s    r�_compare_compatible�Specifier._compare_compatible�s`�����$�$�^�^�D�5I�J�K�C�R�P�316��317	�$����0�0��C�318�����4�	319rc�z�URnUc+[USSSS9n[U5nU[U54nX lU$)z�Cached split of a wildcard spec into components and numeric length.320 321>>> Specifier("==1.*")._get_wildcard_split("1.*")322(['0', '1'], 2)323>>> Specifier("==3.10.*")._get_wildcard_split("3.10.*")324(['0', '3', '10'], 3)325Nr0Fr`)rrru�_numeric_prefix_len)rGr%�wildcard_split�326normalized�327split_specs     r�_get_wildcard_split�Specifier._get_wildcard_split�sM���-�-���!�-�d�3�B�i�U�S�J�'�328�3�J�(�*=�j�*I�J�N�#1� ��rc�,�URS5(aNURU5up4[[U5SS9n[	U5n[Xd5nUS[
U5nX�:H$URU5n	U	R(d[U5nX:H$)Nr'Fr`)	r(r�rr�ru�	_left_padr#r$r�)329rGrxr%r�spec_numeric_len�normalized_prospective�split_prospective�padded_prospective�shortened_prospectiver#s330          rrw�Specifier._compare_equal�s����=�=����+/�+C�+C�D�+I�(�J�&:���,�%�&�"�!/�/E� F��"+�+<�!O��331%7�7H��Z��$I�!�(�6�6� �5�5�d�;�L�332 �%�%�-�k�:���.�.rc�.�URX5(+$r)rw�rGrxr%s   r�_compare_not_equal�Specifier._compare_not_equal�s���&�&�{�9�9�9rc�<�[U5URU5:*$r�r�r$r�s   r�_compare_less_than_equal�"Specifier._compare_less_than_equal�����{�+�t�/I�/I�$�/O�O�Orc�<�[U5URU5:�$rr�r�s   rrv�%Specifier._compare_greater_than_equal�r�rc��URU5nX:dgUR(d!UR(aU[U5:�aggr�)r$r�r��rGrx�spec_strr%s    r�_compare_less_than�Specifier._compare_less_than�sI���)�)�(�3��333�!��334�"�"��)�)��3�D�9�9��335rc���URU5nX:�dgUR(d!UR(a[U5U:XagURb[	U5U:Xaggr�)r$�is_postreleaser�r�r�r�s    r�_compare_greater_than�Specifier._compare_greater_than�se���)�)�(�3��336�!��337�#�#��*�*��;�'�4�/�����(�_�[�-I�T�-Q��338rc�h�[U5R5[U5R5:H$r�r$r�r�s   r�_compare_arbitrary�Specifier._compare_arbitrarys&���;��%�%�'�3�t�9�?�?�+<�<�<rc�$�URU5$)a�Return whether or not the item is contained in this specifier.339 340:param item: The item to check for.341 342This is used for the ``in`` operator and behaves the same as343:meth:`contains` with no ``prereleases`` argument passed.344 345>>> "1.2.3" in Specifier(">=1.2.3")346True347>>> Version("1.2.3") in Specifier(">=1.2.3")348True349>>> "1.0.0" in Specifier(">=1.2.3")350False351>>> "1.3.0a1" in Specifier(">=1.2.3")352True353>>> "1.3.0a1" in Specifier(">=1.2.3", prereleases=True)354True355�r��rGr�s  r�__contains__�Specifier.__contains__���&�}�}�T�"�"rc	�H�[[URU/US955$)a�Return whether or not the item is contained in this specifier.356 357:param item:358    The item to check for, which can be a version string or a359    :class:`Version` instance.360:param prereleases:361    Whether or not to match prereleases with this Specifier. If set to362    ``None`` (the default), it will follow the recommendation from363    :pep:`440` and match prereleases, as there are no other versions.364 365>>> Specifier(">=1.2.3").contains("1.2.3")366True367>>> Specifier(">=1.2.3").contains(Version("1.2.3"))368True369>>> Specifier(">=1.2.3").contains("1.0.0")370False371>>> Specifier(">=1.2.3").contains("1.3.0a1")372True373>>> Specifier(">=1.2.3", prereleases=False).contains("1.3.0a1")374False375>>> Specifier(">=1.2.3").contains("1.3.0a1")376True377�r�)r(rqr�r�s   rr��Specifier.contains.s#��2�D����d�V���E�F�G�Grc��grrr�s    rr��Specifier.filterIr�rc��grrr�s    rr�r�Qr�rc#�# �/nSnUbUOURnURUR5nUH�n[UcUOU"U55n	Sn378U	c5URS:Xa$UR	X�R3795(aUv� OJURS:Xa(UR	UcUOU"U5UR3805n381OU"X�R3825n383U384(dM�U	cM�U	R(aU(aSnUv� M�UbM�URSLdM�URU5 M� U(dUcURSLaUShv�N ggggN7f)a�Filter items in the given iterable, that match the specifier.385 386:param iterable:387    An iterable that can contain version strings and :class:`Version` instances.388    The items in the iterable will be filtered according to the specifier.389:param prereleases:390    Whether or not to allow prereleases in the returned iterator. If set to391    ``None`` (the default), it will follow the recommendation from :pep:`440`392    and match prereleases if there are no other versions.393:param key:394    A callable that takes a single argument (an item from the iterable) and395    returns a version string or :class:`Version` instance to be used for396    filtering.397 398>>> list(Specifier(">=1.2.3").filter(["1.2", "1.3", "1.5a1"]))399['1.3']400>>> list(Specifier(">=1.2.3").filter(["1.2", "1.2.3", "1.3", Version("1.4")]))401['1.2.3', '1.3', <Version('1.4')>]402>>> list(Specifier(">=1.2.3").filter(["1.2", "1.5a1"]))403['1.5a1']404>>> list(Specifier(">=1.2.3").filter(["1.3", "1.5a1"], prereleases=True))405['1.3', '1.5a1']406>>> list(Specifier(">=1.2.3", prereleases=True).filter(["1.3", "1.5a1"]))407['1.3', '1.5a1']408>>> list(Specifier(">=1.2.3").filter(409... [{"ver": "1.2"}, {"ver": "1.3"}],410... key=lambda x: x["ver"]))411[{'ver': '1.3'}]412FNrT)	r�rmrr�r�rEr�rr�)rGr�r�r��prereleases_versions�found_non_prereleases�include_prereleasesrlrE�parsed_version�matchs           rr�r�YsQ���F "�� %��'�2�K��8H�8H�	�413!�.�.�t�}�}�=�� �G�,���W��W��V�N��E��%��=�=�E�)�d�.E�.E��\�\�/�/�"�M�����%�'��/�/�"�{�G��G��d�l�l���*�.�,�,�G���u��3�%�3�3�7J�,0�)�!�M� �(�T�->�->�e�-K�(�/�/��8�/ �8&��#��!�!��.�+�+�+�/�$�&�
,�s*�CE�E� !E�
E�3E�	E�414	E�rWN)r%r$r�r�rhri)rEr$rh�Version | None)rEr$rhr�rh�Sequence[_VersionRange])r+r$r,r$rh�list[_VersionRange]r��rYr�rhri)rhz#tuple[tuple[str, str], bool | None]�rJrkrhrirn)rhztuple[str, str]rlrj)r+r$rh�CallableOperator)rxrr%r$rhr()r%r$rhztuple[list[str], int])rxrr�r$rhr()rxz
Version | strr%r$rhr()r�z
str | Versionrhr(r)r��UnparsedVersionr�r�rhr(r�r�r�r�r�)0r6r7r8r9r:ro�_specifier_regex_str�re�compile�VERBOSE�415IGNORECASErr�__annotations__rIr r$r-r)r*r�r�r�rCrMrrErfr�rcr_rVrmryr�rwr�r�rvr�r�r�r�r�r�rr�r?rrrrr�s#���&�I�Z��x�Z�Z��%�%��.��416�417�R�]�]�0J��F�418����"�
�
��	�J��	�$<�L419!���0420�<6�|�%��%�6���"��"�/� D�D��������B�$*��+��+�*�=�:!�421�(� "/�H:�P�P��2�@=�#�*H�6�_�_�$(��	+�.�+�!�+��	+�422423&�+��+��_�_�$(�.1�	���!��,�	�424425����$(�7;�	O,��O,�!�O,�5�	O,�426427�O,�O,rrz([0-9]+)((?:a|b|c|rc)[0-9]+)c#�p# �/n/nSnUH�n[UcUOU"U55nUc0U(aUv� O"URU5 URU5 MLUR(dU(dUShv�N SnUv� MvU(aMURU5 M� U(dUShv�N ggN=N7f)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���>���428�!�(�(��.��#�#�D�)���#�#��,�,�,�"���J���{�����%�1�6�����-�	 �s*�A2B6�4B2�5B6�429!B6�+B4�,B6�4B6c�2�/nURS5up#nURU=(d S5 URS5HQn[R	U5nU(a!URUR
55 M@URU5 MS U$)aSplit version into components.430 431The split components are intended for version comparison. The logic does432not attempt to retain the original version string, so joining the433components back with :func:`_version_join` may not produce the original434version string.435�!�0�.)�436rpartitionr��split�
_prefix_regexr�extend�groups)rEr�rLrK�restr�r�s       rruru�sw���F��'�'��,�N�E�d�437�M�M�%�,�3���438�439�3����'�'��-����M�M�%�,�,�.�)��M�M�$�� ��Mrc�4�UtpUSSRU53$)z�Join split version components into a version string.440 441This function assumes the input came from :func:`_version_split`, where the442first component must be the epoch (either empty or numeric), and all other443components numeric.444r�r�)�join)�445componentsrLr�s   rrprp�s%���L�E��W�A�c�h�h�t�n�%�&�&rc�8^�[U4SjS55(+$)Nc3�F># �UHnTRU5v� M g7fr)r)�.0r<�segments  �r�	<genexpr>�!_is_not_suffix.<locals>.<genexpr>�s#�����1P�v����6�"�"�1P�s�!)rN�a�b�rcrM)�any)r�s`rrtrt�s"�����1P����rc�V�SnUH nUR5(d U$US-
nM" U$)zwCount leading numeric components in a :func:`_version_split` result.446 447>>> _numeric_prefix_len(["0", "1", "2", "a1"])4483449rr
)�isdigit)r��countr�s   rr|r|�s:��
�E������ � ���L�	��450����Lrc�R�[U5nX-451nUS::aU$/USUQS/U-QXSQ$)z�Pad a :func:`_version_split` result with ``"0"`` segments to reach452``target_numeric_len`` numeric components.  Suffix segments are preserved.453 454>>> _left_pad(["0", "1", "a1"], 4)455['0', '1', '0', '0', 'a1']456rNr�)r|)r��target_numeric_len�numeric_len�457pad_neededs    rr�r�
sJ��&�e�,�K�#�1�J��Q����N�U�<�K�
 �N�S�E�J�$6�N�%��:M�N�Nrc���UupnUS:XaURS5(dS$S$US;agUS:XagUS:XaURS5(dS	$S458$US:Xag[SU<35e)
a,Sort key for Cost Based Ordering of specifier operators in _filter_versions.459 460Operators run sequentially on a shrinking candidate set, so operators that461reject the most versions should run first to minimize work for later ones.462 463Tier 0: Exact equality (==, ===), likely to narrow candidates to one version464Tier 1: Range checks (>=, <=, >, <), cheap and usually reject a large portion465Tier 2: Wildcard equality (==.*) and compatible release (~=), more expensive466Tier 3: Exact !=, cheap but rarely rejects467Tier 4: Wildcard !=.*, expensive and rarely rejects468rr'rr )rrr�r�r
rrr�rr7)r(r8)�op_entryrK�verr+s    r�_operator_costr�s����J�A�B�	�T�z����T�*�*�q�1��1�	�
#�#��	�T�z��	�T�z����T�*�*�q�1��1�	�U�{��469�)�"��0�4701�1rc���\rSrSrSrSrSSSjjrSSjr\SSj5r	\	RS Sj5r	S!S	jrS"S471jrS#Sjr
S#SjrS$S
jrS%SjrS&SjrS$SjrS'SjrS(SjrS)SjrS)SjrS)SjrS*SjrS+S,Sjjr\R6S-S.Sjj5r\R6S-S/Sjj5rS+S0SjjrS1S2SjjrSrg)3ri6aUThis class abstracts handling of a set of version specifiers.472 473It can be passed a single specifier (``>=3.0``), a comma-separated list of474specifiers (``>=3.0,!=3.1``), or no specifier at all.475 476Instances are safe to serialize with :mod:`pickle`. They use a stable477format so the same pickle can be loaded in future packaging478releases.479 480.. versionchanged:: 26.2481 482    Added a stable pickle format. Pickles created with483    packaging 26.2+ can be unpickled with future releases.484    Backward compatibility with pickles from485    packaging < 26.2 is supported but may be removed in a future486    release.487)�_canonicalized�_has_arbitrary�_is_unsatisfiabler�
_resolved_ops�_specsNc���[U[5(anURS5Vs/sH)o3R5(dMUR5PM+ nn[	[[U55UlSU;UlO1[	U5Ul[SUR55Ul[UR5S:*UlSUlX l
SUlgs snf)aLInitialize a SpecifierSet instance.488 489:param specifiers:490    The string representation of a specifier or a comma-separated list of491    specifiers which will be parsed and normalized before use.492    May also be an iterable of ``Specifier`` instances, which will be used493    as is.494:param prereleases:495    This tells the SpecifierSet if it should accept prerelease versions if496    applicable or not. The default of ``None`` will autodetect it from the497    given specifiers.498 499:raises InvalidSpecifier:500    If the given ``specifiers`` are not parseable than this exception will be501    raised.502�,rc3�># �UHnS[U5;v� M g7f�rNr��r��ss  rr��(SpecifierSet.__init__.<locals>.<genexpr>ts���%K�{�!�e�s�1�v�o�{���r
N)r!r$r�rr"�maprr�r�r�r#r�r�rr�)rG�503specifiersr�r��split_specifierss     rrI�SpecifierSet.__init__Rs���,�j�#�&�&�4>�3C�3C�C�3H�V�3H�a�G�G�I�	����	�3H��V�16�s�9�FV�7W�1X�D�K�"'�:�"5�D���504�+�D�K�#&�%K�t�{�{�%K�"K�D��!�$�+�+�.�!�3���MQ���(��.2����% Ws�C'�C'c	���UR(dN[[R[	UR505[S955UlSUlSUlSUlUR506$)zBDeduplicate, sort, and cache specs for order-sensitive operations.�r�TN)	r�r"rG�fromkeys�sortedr�r$r�r�r^s r�_canonical_specs�SpecifierSet._canonical_specssM���"�"���
�
�f�T�[�[�c�.J� K�L�D�K�"&�D��!%�D��%)�D�"��{�{�rc��URbUR$UR(dg[SUR55(agg)Nc3�8# �UHoRv� M g7frr�r�s  rr��+SpecifierSet.prereleases.<locals>.<genexpr>�s���2�k��}�}�k���T)rr�r�r^s rr��SpecifierSet.prereleases�sE�����(��$�$�$�507�{�{���2�d�k�k�2�2�2��rc��XlSUlgr)rr�r�s  rr�r�s��!��!%��rc�2�URUR4$r)r�rr^s rrC�SpecifierSet.__getstate__�s�����T�.�.�/�/rc�L�SUlSUl[U[5(Ga�[	U5S:XawUup#[U[5(a^[SU55(aG[
U5(a7X lX0l[	U5S:*Ul	[SU55Ulg[	U5S:Xa�[US[5(a�UupEURSS5nURS5n[U[5(a[[U[ S95n[U[5(ar[S	U55(a[[
U5(aKX lX0l[	UR5S:*Ul	[S508UR55Ulg[U[5(a�URSS5nURS5n[U[5(a[[U[ S95n[U[5(ar[SU55(a[[
U5(aKX lX0l[	UR5S:*Ul	[SUR55Ulg[#S
U<35e)Nr c3�B# �UHn[U[5v� M g7fr�r!rr�s  rr��,SpecifierSet.__setstate__.<locals>.<genexpr>�����D�e��J�q�)�4�4�e���r
c3�># �UHnS[U5;v� M g7fr�r�r�s  rr�r�s���-M�u�!�e�s�1�v�o�u�r�r�rrr�c3�B# �UHn[U[5v� M g7frrr�s  rr�r�rrc3�># �UHnS[U5;v� M g7fr�r�r�s  rr�r�s���-S�{�!�e�s�1�v�o�{�r�c3�B# �UHn[U[5v� M g7frrr�s  rr�r�s���@�%�Q�509�1�i�0�0�%�rc3�># �UHnS[U5;v� M g7fr�r�r�s  rr�r�s���)O�;�a�%�3�q�6�/�;�r�z!Cannot restore SpecifierSet from )r�r�r!r"r#�allr*r�rr�r�r�rGrH�	frozensetrr$rI)rGrJ�specsr�rKrLs      rrM�SpecifierSet.__setstate__�s��!���!%����e�U�#�#��5�z�Q��%*�"���u�e�,�,��D�e�D�D�D�%�k�2�2�"'�K�(3�%�*-�e�*��/�D�'�*-�-M�u�-M�*M�D�'���5�z�Q��:�e�A�h��#=�#=�$���!�
�
�h��3��'�m�m�N�;���e�Y�/�/�!�&��C�"8�9�E��u�e�,�,��D�e�D�D�D�%�k�2�2�"'�K�(3�%�*-�d�k�k�*:�a�*?�D�'�*-�-S�t�{�{�-S�*S�D�'���e�T�"�"��I�I�h��+�E��)�)�N�3�K��%��+�+��f�U��4�5���5�%�(�(��@�%�@�@�@�!�+�.�.�#��$/�!�&)�$�+�+�&6�!�&;��#�&)�)O�4�;�;�)O�&O��#���;�E�9�E�F�Frc��URbSUR<3OSnSURRS[	U5<US3$)a�A representation of the specifier set that shows all internal state.510 511Note that the ordering of the individual specifiers within the set may not512match the input string.513 514>>> SpecifierSet('>=1.0.0,!=2.0.0')515<SpecifierSet('!=2.0.0,>=1.0.0')>516>>> SpecifierSet('>=1.0.0,!=2.0.0', prereleases=False)517<SpecifierSet('!=2.0.0,>=1.0.0', prereleases=False)>518>>> SpecifierSet('>=1.0.0,!=2.0.0', prereleases=True)519<SpecifierSet('!=2.0.0,>=1.0.0', prereleases=True)>520rVrWr�rbrXrYrZs  rrf�SpecifierSet.__repr__�sU��� � �,��T�-�-�0�1��	��4�>�>�*�*�+�1�S��Y�M�#��b�A�Arc�N�SRSUR555$)a6A string representation of the specifier set that can be round-tripped.521 522Note that the ordering of the individual specifiers within the set may not523match the input string.524 525>>> str(SpecifierSet(">=1.0.0,!=1.0.1"))526'!=1.0.1,>=1.0.0'527>>> str(SpecifierSet(">=1.0.0,!=1.0.1", prereleases=False))528'!=1.0.1,>=1.0.0'529r�c3�8# �UHn[U5v� M g7frr�r�s  rr��'SpecifierSet.__str__.<locals>.<genexpr>s���@�(?�1��A���(?�r)r�rr^s rr��SpecifierSet.__str__�s"���x�x�@��(=�(=�(?�@�@�@rc�4�[UR55$r)r]rr^s rr_�SpecifierSet.__hash__s���D�)�)�+�,�,rc�$�[U[5(a[U5nO[U[5(d[$[5nURUR-Ul[UR5S:*UlUR=(d URUlSUlURbURUR:XaURUl	U$URcURUl	U$[S5e)aRReturn a SpecifierSet which is a combination of the two sets.530 531:param other: The other object to combine with.532 533>>> SpecifierSet(">=1.0.0,!=1.0.1") & '<=2.0.0,!=2.0.1'534<SpecifierSet('!=1.0.1,!=2.0.1,<=2.0.0,>=1.0.0')>535>>> SpecifierSet(">=1.0.0,!=1.0.1") & SpecifierSet('<=2.0.0,!=2.0.1')536<SpecifierSet('!=1.0.1,!=2.0.1,<=2.0.0,>=1.0.0')>537r
NzFCannot combine SpecifierSets with True and False prerelease overrides.)r!r$rrTr�r#r�r�r�rr8)rGrO�	specifiers   r�__and__�SpecifierSet.__and__s����e�S�!�!� ��'�E��E�<�0�0�!�!� �N�	��;�;����5�	��#&�y�'7�'7�#8�A�#=�	� �#'�#6�#6�#N�%�:N�:N�	� �"&�	�����$��(9�(9�U�=O�=O�(O�%*�%7�%7�I�"����
�
�
'�%)�%6�%6�I�"���	�X��
rc���[U[[45(a[[U55nO[U[5(d[$UR5UR5:H$)a1Whether or not the two SpecifierSet-like objects are equal.538 539:param other: The other object to check against.540 541The value of :attr:`prereleases` is ignored.542 543>>> SpecifierSet(">=1.0.0,!=1.0.1") == SpecifierSet(">=1.0.0,!=1.0.1")544True545>>> (SpecifierSet(">=1.0.0,!=1.0.1", prereleases=False) ==546...  SpecifierSet(">=1.0.0,!=1.0.1", prereleases=True))547True548>>> SpecifierSet(">=1.0.0,!=1.0.1") == ">=1.0.0,!=1.0.1"549True550>>> SpecifierSet(">=1.0.0,!=1.0.1") == SpecifierSet(">=1.0.0")551False552>>> SpecifierSet(">=1.0.0,!=1.0.1") == SpecifierSet(">=1.0.0,!=1.0.2")553False554)r!r$rrrTrrUs  rrV�SpecifierSet.__eq__&sT��&�e�c�9�-�.�.� ��U��,�E��E�<�0�0�!�!��$�$�&�%�*@�*@�*B�B�Brc�,�[UR5$)z7Returns the number of specifiers in this specifier set.)r#r�r^s r�__len__�SpecifierSet.__len__@s���4�;�;��rc�,�[UR5$)z�555Returns an iterator over all the underlying :class:`Specifier` instances556in this specifier set.557 558>>> sorted(SpecifierSet(">=1.0.0,!=1.0.1"), key=str)559[<Specifier('!=1.0.1')>, <Specifier('>=1.0.0')>]560)�iterr�r^s r�__iter__�SpecifierSet.__iter__Ds���D�K�K� � rc��URnSnUH:nUcUR5nM[X#R55nU(aM: O Uc[S5eU$)z�Intersect all specifiers into a single list of version ranges.561 562Returns an empty list when unsatisfiable.  ``===`` specs are563modeled as full range; string matching is checked separately564by :meth:`_check_arbitrary_unsatisfiable`.565Nz _get_ranges called with no specs)r�r-r��RuntimeError)rGrr�r�s    r�_get_ranges�SpecifierSet._get_rangesNs\������15���A��~������*�6�<�<�>�B���v��
��>��A�B�B��
rc�566�URnUbU$UR(dSUlgUR5(+nU(dUR5nU(dURSLaUR5nX lU$)aVCheck whether this specifier set can never be satisfied.567 568Returns True if no version can satisfy all specifiers simultaneously.569 570>>> SpecifierSet(">=2.0,<1.0").is_unsatisfiable()571True572>>> SpecifierSet(">=1.0,<2.0").is_unsatisfiable()573False574>>> SpecifierSet("").is_unsatisfiable()575False576>>> SpecifierSet("==1.0,!=1.0").is_unsatisfiable()577True578F)r�r�r2�_check_arbitrary_unsatisfiabler��_check_prerelease_only_ranges)rG�cachedr�s   r�is_unsatisfiable�SpecifierSet.is_unsatisfiabledsw���'�'�����M��{�{�%*�D�"���%�%�'�'����8�8�:�F��$�*�*�e�3��7�7�9�F�!'���
rc���UR5Haup[UR5nUc gURbX2R:a gX2R:XdMNUR(dMa g g)zxWith prereleases=False, check if every range contains only579pre-release versions (which would be excluded from matching).FT)r2r�rErt)rGr�r��nearests    rr6�*SpecifierSet._check_prerelease_only_ranges�s_��!�,�,�.�L�E�-�e�m�m�<�G�����}�}�$��-�-�(?���-�-�'�E�O�O�O��/�rc�^^�URVs/sHoRS:XdMUPM nnU(dgUSRR5m[	U4SjUSS55(ag[USR5mURSLaTbTR(agURVs/sHoRS:wdMUPM nnU(dgTcg[U4SjU55(+$s snfs snf)	z�Check === (arbitrary equality) specs for unsatisfiability.580 581=== uses case-insensitive string comparison, so the only candidate582that can match ``===V`` is the literal string V.  This method583checks whether that candidate is excluded by other specifiers.584rFrc3�\># �UH!oRR5T:gv� M# g7fr)rEr�)r�r��firsts  �rr��>SpecifierSet._check_arbitrary_unsatisfiable.<locals>.<genexpr>�s����A�=�a�y�y��� �E�)�=�s�),r
NTc3�D># �UHoRT5v� M g7frr�)r�r��	candidates  �rr�r@�s����?�h��z�z�)�,�,�h�s� )	r�rrEr�r�r�r�r�r)rGr�r�standardrBr?s    @@rr5�+SpecifierSet._check_arbitrary_unsatisfiable�s����!%���C��1�z�z�U�/B�Q��	�C����!��$�$�*�*�,���A�9�Q�R�=�A�A�A��$�I�a�L�$8�$8�9�	�585
����%��%��'�'��#�{�{�B�{�!�j�j�E�.A�A�{��B�������?�h�?�?�?�?��=D��,Cs�D�D�=D�Dc�$�URU5$)aReturn whether or not the item is contained in this specifier.586 587:param item: The item to check for.588 589This is used for the ``in`` operator and behaves the same as590:meth:`contains` with no ``prereleases`` argument passed.591 592>>> "1.2.3" in SpecifierSet(">=1.0.0,!=1.0.1")593True594>>> Version("1.2.3") in SpecifierSet(">=1.0.0,!=1.0.1")595True596>>> "1.0.1" in SpecifierSet(">=1.0.0,!=1.0.1")597False598>>> "1.3.0a1" in SpecifierSet(">=1.0.0,!=1.0.1")599True600>>> "1.3.0a1" in SpecifierSet(">=1.0.0,!=1.0.1", prereleases=True)601True602r�r�s  rr��SpecifierSet.__contains__�r�rc	���[U5nUbU(aUR(aSnUb&UR(a[U[5(dUnOUn[[
URU/US955$)a�Return whether or not the item is contained in this SpecifierSet.603 604:param item:605    The item to check for, which can be a version string or a606    :class:`Version` instance.607:param prereleases:608    Whether or not to match prereleases with this SpecifierSet. If set to609    ``None`` (the default), it will follow the recommendation from :pep:`440`610    and match prereleases, as there are no other versions.611:param installed:612    Whether or not the item is installed. If set to ``True``, it will613    accept prerelease versions even if the specifier does not allow them.614 615>>> SpecifierSet(">=1.0.0,!=1.0.1").contains("1.2.3")616True617>>> SpecifierSet(">=1.0.0,!=1.0.1").contains(Version("1.2.3"))618True619>>> SpecifierSet(">=1.0.0,!=1.0.1").contains("1.0.1")620False621>>> SpecifierSet(">=1.0.0,!=1.0.1").contains("1.3.0a1")622True623>>> SpecifierSet(">=1.0.0,!=1.0.1", prereleases=False).contains("1.3.0a1")624False625>>> SpecifierSet(">=1.0.0,!=1.0.1").contains("1.3.0a1", prereleases=True)626True627Tr�)r�r�r�r!rr(rqr�)rGr�r��	installedrE�628check_items      rr��SpecifierSet.contains�sh��@"�$�'����9��1F�1F��K��?�t�2�2�:�d�G�;T�;T��J� �J��D����j�\�{��K�L�M�Mrc��grrr�s    rr��SpecifierSet.filter�r�rc��grrr�s    rr�rLr�rc�^^�UcURbURnUR(ad[UR5S:Xa$URSRUUcSOUTS9nOUR	UTUcSOUS9nUbU$[UT5$USLa[
U5$USLa
UU4SjU5$[UT5$)aCFilter items in the given iterable, that match the specifiers in this set.629 630:param iterable:631    An iterable that can contain version strings and :class:`Version` instances.632    The items in the iterable will be filtered according to the specifier.633:param prereleases:634    Whether or not to allow prereleases in the returned iterator. If set to635    ``None`` (the default), it will follow the recommendation from :pep:`440`636    and match prereleases if there are no other versions.637:param key:638    A callable that takes a single argument (an item from the iterable) and639    returns a version string or :class:`Version` instance to be used for640    filtering.641 642>>> list(SpecifierSet(">=1.2.3").filter(["1.2", "1.3", "1.5a1"]))643['1.3']644>>> list(SpecifierSet(">=1.2.3").filter(["1.2", "1.3", Version("1.4")]))645['1.3', <Version('1.4')>]646>>> list(SpecifierSet(">=1.2.3").filter(["1.2", "1.5a1"]))647['1.5a1']648>>> list(SpecifierSet(">=1.2.3").filter(["1.3", "1.5a1"], prereleases=True))649['1.3', '1.5a1']650>>> list(SpecifierSet(">=1.2.3", prereleases=True).filter(["1.3", "1.5a1"]))651['1.3', '1.5a1']652>>> list(SpecifierSet(">=1.2.3").filter(653... [{"ver": "1.2"}, {"ver": "1.3"}],654... key=lambda x: x["ver"]))655[{'ver': '1.3'}]656 657An "empty" SpecifierSet will filter items based on the presence of prerelease658versions in the set.659 660>>> list(SpecifierSet("").filter(["1.3", "1.5a1"]))661['1.3']662>>> list(SpecifierSet("").filter(["1.5a1"]))663['1.5a1']664>>> list(SpecifierSet("", prereleases=True).filter(["1.3", "1.5a1"]))665['1.3', '1.5a1']666>>> list(SpecifierSet("").filter(["1.3", "1.5a1"], prereleases=True))667['1.3', '1.5a1']668r
rT)r�r�r�Fc3�># �UH4n[TcUOT"U55=mbTR(aM0Uv� M6 g7fr)r�r�)r�r�r�rEs  ��rr��&SpecifierSet.filter.<locals>.<genexpr>^sB�����$�D� /�����T�� S�S�W���"�0�0���$�s�/?�	?)r�r�r#r��_filter_versionsr�r-)rGr�r�r��filteredrEs   ` @rr�rLs����d��4�#3�#3�#?��*�*�K��;�;��4�;�;��1�$��;�;�q�>�0�0��(3�(;����1��� �0�0���(3�(;���1����&���-�h��<�<��$����>�!��%���$��
�*�(�C�8�8rc#�^^^# �URc$[SUR5[S9UlURnUSLnUHzm[	TcTOT"T55mTc"[U4SjU55(aTv� M<M>U(aTR(aMX[UUU4SjU55(dMvTv� M| g7f)aFilter versions against all specifiers in a single pass.669 670Uses Cost Based Ordering: specifiers are sorted by _operator_cost so671that cheap range operators reject versions early, avoiding expensive672wildcard or compatible operators on versions that would have been673rejected anyway.674Nc3�# �UH7nURUR5URUR4v� M9 g7fr)rmrrE)r�r%s  rr��0SpecifierSet._filter_versions.<locals>.<genexpr>{s5���� +���'�'��
�
�6����d�m�m�T� +�s�?Ar�Fc3�># �UH>upnUS:H=(a* [T5R5UR5:Hv� M@ g7fr�r�)r�rKr�r+r�s    �rr�rU�s>�����&)�675����%�K�D�C��I�O�O�$5�����$D�D�&)�s�AA	c3�># �UHLupnUS:Xa5[TcTOT"T55R5UR5:HOU"TU5v� MN g7fr�r�)r��op_fnr�r+r�r�r�s    ���rr�rU�s[�����'*�N�E����;��C�K�D�S��Y�7�=�=�?�3�9�9�;�N��6�3�'�(�'*�s�AA)r�rr�r�r�rr�)rGr�r�r��ops�exclude_prereleasesr�r�s  `   @@rrQ�SpecifierSet._filter_versionsks��������%�!'�� $����#�"�D��� � ��)�U�2���D�$�S�[�T�c�$�i�H�F��~���&)�����J�	�676%��)=�)=����'*�	����677�'�s�B6C�?	Cr�)r�zstr | Iterable[Specifier]r�r�rhri)rhztuple[Specifier, ...]r�r�)rhz)tuple[tuple[Specifier, ...], bool | None]r�rnrl)rOzSpecifierSet | strrhrrj)rhzIterator[Specifier]r�)rhr()r�r�rhr(r�)r�r�r�r�rHr�rhr(r�r�r�r�r)r�r�r�r�r�r�rhr�)r6r7r8r9r:rorIrr�r�r�rCrMrfr�r_r%rVr*r.r2r8r6r5r�r�r�rr�rQr?rrrrr6s����$�I�13�#'�+3�-�+3�!�+3�678�	+3�Z�����&���&��&�0�7G�rB�*A�-��BC�4 �!��,�B�%@�N#�0$(�!%�	+N��+N�!�+N��	+N�679680�+N�Z�_�_�$(��	+�.�+�!�+��	+�681682&�+��+��_�_�$(�.1�	���!��,�	�683684����$(�7;�	^9��^9�!�^9�5�	^9�685686�^9�H$(�	,��,�5�,�!�	,�687688�,�,rr)rh�	list[str])r%rkrhzTypeGuard[tuple[str, str]])r)rkrhzTypeGuard[bool | None])r0�tuple[int, ...]rhr])r�rqr�r�rhr()r�r�r�r�rhr�)rErrhr)rEr�rhr�)rPr�rhr�)r�r�r�r�rhr�)rEr$rhr\)r�r\rhr$)r�r$rhr()r�r\rhrm)r�r\r�rmrhr\)r�z!tuple[CallableOperator, str, str]rhrm)Lr:�689__future__rr�r;�	functoolsrrr��sysr�rrrrrr	r690rr�utilsrrErr�version_infor�typing_extensionsrrr&r*r+r$r�r,r(r�r.r�r2�Enumr4�total_orderingrArqr�r�r"�
_VersionRanger1r2r�r�r�r�r�r�r�r�r�r�r8r�ABCMetarrr�r�r�rurprtr|r�r�rrrr�<module>rhsp���#�691����	�692�
�693�694�695�(�,����w�� ��+�����0��C�L������%���1��I���W�c�N�D�0�1�� '�x�0��n�0�=��D�I�I�����;Q�;Q��;Q�|���%H�%H��%H�P���%H�%H��%H�P696����w�(8�$�>�?���+�{�2�3�M��t�U�#���t�U�#��&.��%9�$;��
!�;�)��697!��"����4K�S�698�+�@�2�9��9��9�*	�z�	�O�c�k�k�O�dr,�
�r,�j�699�700�:�;�
�' ��' �"I�' ��' �T�,'���O�2�6a	�=�a	r
codekingpro/portable-devtools · Team Ai