Your IP : 216.73.216.189


Current Path : /snap/certbot/5603/lib64/python3.12/site-packages/packaging/__pycache__/
Upload File :
Current File : //snap/certbot/5603/lib64/python3.12/site-packages/packaging/__pycache__/specifiers.cpython-312.pyc

�

�jZ���UdZddlmZddlZddlZddlZddlZddlZddlZddl	Z	ddl	m
Z
mZmZm
Z
mZmZmZmZmZddlmZddlmZmZej0dk\rdd	l	mZne
rdd	lmZgd
�Zd:d�Zd;d�Zd<d
�Zed�Zeee fZ!ede!��Z"eee ge#fZ$ed�Z%de&d<d=d�Z'Gd�dejP�Z)ejTGd�d��Z+ejTGd�d��Z,ejTGd�d��Z-e	jreee+dfZ.e/e,e-fZ0e,dd�Z1e-dd�Z2e1e2ffZ3de&d<d>d �Z4						d?d!�Z5d@d"�Z6d@d#�Z7dAd$�Z8d@d%�Z9d@d&�Z:d@d'�Z;				dBd(�Z<Gd)�d*e=�Z>Gd+�d,ej~�-�Z@Gd.�d/e@�ZAej�d0�ZC						dCd1�ZDdDd2�ZEdEd3�ZFdFd4�ZGdGd5�ZHdHd6�ZIdId7�ZJGd8�d9e@�ZKy)Jz�
.. testsetup::

    from packaging.specifiers import Specifier, SpecifierSet, InvalidSpecifier
    from packaging.version import Version
�)�annotationsN)	�
TYPE_CHECKING�Any�Callable�Final�Iterable�Iterator�Sequence�TypeVar�Union�)�canonicalize_version)�InvalidVersion�Version)��
)�	TypeGuard)�
BaseSpecifier�InvalidSpecifier�	Specifier�SpecifierSetc��tS�N)�__all__����/build/snapcraft-certbot-54d6d23c1eba5f776fc280588daee8b3/parts/certbot/install/lib/python3.12/site-packages/packaging/specifiers.py�__dir__r0s���Nrc��t|t�xr8t|�dk(xr(t|dt�xrt|dt�S)N�rr
)�
isinstance�tuple�len�str)�specs r�_validate_specr&4sI���4���	%���I��N�	%��t�A�w��$�	%�
�t�A�w��$�	rc�.�|duxst|t�Sr)r!�bool)�pres r�
_validate_prer*=s���$�;�/�*�S�$�/�/r�T�UnparsedVersionVar)�boundz0.dev0zFinal[Version]�_MIN_VERSIONc��t|�}|dkDr!||dz
dk(r|dz}|dkDr||dz
dk(r�|t|�k(r|S|d|S)zDStrip trailing zeros from a release tuple for normalized comparison.r
rN)r#)�release�ends  r�
_trim_releaser2Js`��

�g�,�C�

��'�g�c�A�g�&�!�+��q�����'�g�c�A�g�&�!�+��S��\�)�7�<�w�t��}�<rc�T�eZdZdZej
�Zej
�Zy)�
_BoundaryKindz5Where a boundary marker sits in the version ordering.N)�__name__�
__module__�__qualname__�__doc__�enum�auto�AFTER_LOCALS�AFTER_POSTSrrrr4r4Rs��?��4�9�9�;�L��$�)�)�+�Krr4c�D�eZdZdZdZd
d�Zdd�Zdd�Zd
d�Zdd�Z	dd�Z
y	)�_BoundaryVersiona
A point on the version line between two real PEP 440 versions.

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

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

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

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

    ``AFTER_POSTS`` sits after every V.postN, but before the next
    release segment.  Lower bound of ``>V`` (final or pre-release V)
    to exclude post-releases per PEP 440.
    )�_kind�_trimmed_release�versionc�T�||_||_t|j�|_yr)rAr?r2r0r@)�selfrA�kinds   r�__init__z_BoundaryVersion.__init__qs!�������
� -�g�o�o� >��rc��|j}|j|jk(r;t|j�|jk(r|j
|j
k(sy|jtjk(r4|j|jk(xr|j|jk(S|j|jk(xs|jduS)z6Is ``other`` a version that this boundary sorts above?FN)rA�epochr2r0r@r)r?r4r;�post�dev)rC�other�vs   r�
_is_familyz_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��t|t�r4|j|jk(xr|j|jk(StSr)r!r>rAr?�NotImplemented�rCrJs  r�__eq__z_BoundaryVersion.__eq__�s8���e�-�.��<�<�5�=�=�0�N�T�Z�Z�5�;�;�5N�N��rc�&�t|t�r_|j|jk7r|j|jkS|jj|jjkS|j|�xr|j|kSr)r!r>rAr?�valuerLrOs  r�__lt__z_BoundaryVersion.__lt__�so���e�-�.��|�|�u�}�}�,��|�|�e�m�m�3�3��:�:�#�#�e�k�k�&7�&7�7�7��?�?�5�)�)�B�d�l�l�U�.B�Brc�D�t|j|jf�Sr)�hashrAr?�rCs r�__hash__z_BoundaryVersion.__hash__�s���T�\�\�4�:�:�.�/�/rc�|�|jj�d|j�d|jj�d�S)N�(z, �))�	__class__r5rAr?�namerVs r�__repr__z_BoundaryVersion.__repr__�s4���.�.�)�)�*�!�D�L�L�+;�2�d�j�j�o�o�=N�a�P�PrN)rArrDr4�return�None)rJrr^r(�rJ�objectr^r()rJz_BoundaryVersion | Versionr^r(�r^�int�r^r$)r5r6r7r8�	__slots__rErLrPrSrWr]rrrr>r>Ys.���(9�I�?�

<��
C�0�Qrr>c�<�eZdZdZdZd	d�Zd
d�Zdd�Zdd�Zd
d�Z	y)�_LowerBoundz�Lower bound of a version range.

    A version *v* of ``None`` means unbounded below (-inf).
    At equal versions, ``[v`` sorts before ``(v`` because an inclusive
    bound starts earlier.
    ��	inclusiverAc� �||_||_yr�rAri�rCrAris   rrEz_LowerBound.__init__�������"��rc��t|t�stS|j|jk(xr|j|jk(Sr�r!rgrNrArirOs  rrPz_LowerBound.__eq__��7���%��-�!�!��|�|�u�}�}�,�R����5�?�?�1R�Rrc��t|t�stS|j�|jduS|j�y|j|jk7r|j|jkS|jxr
|jS)NFrorOs  rrSz_LowerBound.__lt__�sq���%��-�!�!��<�<���=�=��,�,��=�=� ���<�<�5�=�=�(��<�<�%�-�-�/�/��~�~�5�e�o�o�"5�5rc�D�t|j|jf�Sr�rUrArirVs rrWz_LowerBound.__hash__�����T�\�\�4�>�>�2�3�3rc�t�|jrdnd}d|jj�d|�|j�d�S)N�[rY�<� �>�rir[r5rA�rC�brackets  rr]z_LowerBound.__repr__�s8�����#�S���4�>�>�*�*�+�1�W�I�d�l�l�5E�Q�G�GrN�rA�_VersionOrBoundaryrir(r^r_r`)rJrgr^r(rbrd�
r5r6r7r8rerErPrSrWr]rrrrgrg��)���)�I�#�S�
6�4�Hrrgc�<�eZdZdZdZd	d�Zd
d�Zdd�Zdd�Zd
d�Z	y)�_UpperBoundz�Upper bound of a version range.

    A version *v* of ``None`` means unbounded above (+inf).
    At equal versions, ``v)`` sorts before ``v]`` because an exclusive
    bound ends earlier.
    rhc� �||_||_yrrkrls   rrEz_UpperBound.__init__�rmrc��t|t�stS|j|jk(xr|j|jk(Sr�r!r�rNrArirOs  rrPz_UpperBound.__eq__�rprc��t|t�stS|j�y|j�y|j|jk7r|j|jkS|jxr|jS�NFTr�rOs  rrSz_UpperBound.__lt__�se���%��-�!�!��<�<����=�=� ���<�<�5�=�=�(��<�<�%�-�-�/�/��>�>�!�5�e�o�o�5rc�D�t|j|jf�SrrsrVs rrWz_UpperBound.__hash__�rtrc�t�|jrdnd}d|jj�d|j�|�d�S)N�]rZrwrxryrzr{s  rr]z_UpperBound.__repr__�s8�����#�S���4�>�>�*�*�+�1�T�\�\�,<�W�I�Q�G�GrNr}r`)rJr�r^r(rbrdrrrrr�r��r�rr�Fztuple[_VersionRange]�_FULL_RANGEc���|j�|j�y|j|jk(r|jxr|jS|j|jkDS)zHTrue when the range defined by *lower* and *upper* contains no versions.Frk)�lower�uppers  r�_range_is_emptyr��sQ���}�}���
�
� 5���}�}��
�
�%��O�O�7����8�8��=�=�5�=�=�(�(rc�2�g}dx}}|t|�kr�|t|�krt||\}}||\}}t||�}	t||�}
t|	|
�s|j	|	|
f�||kr|dz
}n|dz
}|t|�kr|t|�kr�t|S)zFIntersect two sorted, non-overlapping range lists (two-pointer merge).rr
)r#�max�minr��append)�left�right�result�
left_index�right_index�
left_lower�
left_upper�right_lower�right_upperr�r�s           r�_intersect_rangesr��s���
#%�F� � �J��
�s�4�y�
 �[�3�u�:�%=�!%�j�!1��
�J�#(��#5� ��[��J��,���J��,���u�e�,��M�M�5�%�.�)���#��!�O�J��1��K��s�4�y�
 �[�3�u�:�%=� �Mrc��g|jdd�|jddz��}tj|j|d��S)z5Smallest version in the next prefix: 1.2 -> 1.3.dev0.N���r
r�rGr0rI)r0r�
from_partsrG)rAr0s  r�_next_prefix_dev0r�sC��>������$�>�g�o�o�b�&9�A�&=�>�G����G�M�M�7��J�Jrc�Z�tj|j|jd��S)z7The .dev0 of a version's base release: 1.2 -> 1.2.dev0.rr�)rr�rGr0�rAs r�
_base_dev0r�s �����G�M�M�7�?�?�PQ�R�Rrc�`�t|t�s	t|�}|S|S#t$rYywxYwr)r!rrr�s r�_coerce_versionr�$s:���g�w�'�	��g�&�G��N�7�N���	��	�s�!�	-�-c�B�|j�|S|jd��S)N)�local)r��__replace__r�s r�_public_versionr�-s%���}�}�������T��*�*rc�*�|jddd��S)zyThe version that *version* is a post-release of.

    1.0.post1 -> 1.0, 1.0a1.post0 -> 1.0a1, 1.0.post0.dev1 -> 1.0.
    N�rHrIr��r�r�s r�
_post_baser�3s��
���D�d�$��?�?rc�(�|jdd��S)zZEarliest pre-release of *version*.

    1.2 -> 1.2.dev0, 1.2.post1 -> 1.2.post1.dev0.
    rN�rIr�r�r�s r�_earliest_prereleaser�;s��
���1�D��1�1rc�$�|�yt|t�r\|j}|jr|j	ddd��S|j
�|j
dznd}|j	|d��S|js|S|j	ddd��S)z:Smallest non-pre-release version at or above *v*, or None.N)r)rIr�r
r)rHr�)r!r>rA�
is_prereleaser�rH)rK�inner�ks   r�_nearest_non_prereleaser�Cs���	�y���!�%�&��	�	������$�$��4�t�$�D�D�!&�
�
� 6�U�Z�Z�!�^�A��� � �a�t� �4�4��?�?����=�=�T�t�4�=�8�8rc��eZdZdZy)ra
    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'
    N)r5r6r7r8rrrrrXs��rrc���eZdZdZdZedd��Zejdd��Z	ejdd��Z
ejdd��Zeejdd���Zejdd��Zejddd
��Zej 		d							dd��Zej 		d							dd��Zej		d							dd
��Zy	)rr)�_strc��t|�S)z Internal property for match_args�r$rVs rr�zBaseSpecifier._strhs���4�y�rc��y)z�
        Returns the str representation of this Specifier-like object. This
        should be representative of the Specifier itself.
        NrrVs r�__str__zBaseSpecifier.__str__m��rc��y)zF
        Returns a hash value for this Specifier-like object.
        NrrVs rrWzBaseSpecifier.__hash__tr�rc��y)z�
        Returns a boolean representing whether or not the two Specifier-like
        objects are equal.

        :param other: The other object to check against.
        NrrOs  rrPzBaseSpecifier.__eq__zr�rc��y)z�Whether 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.
        NrrVs r�prereleaseszBaseSpecifier.prereleases�r�rc��y)zQSetter for :attr:`prereleases`.

        :param value: The value to set.
        Nr�rCrRs  rr�zBaseSpecifier.prereleases�r�rNc��y)zR
        Determines if the given item is contained within this specifier.
        Nr�rC�itemr�s   r�containszBaseSpecifier.contains�r�rc��yrr�rC�iterabler��keys    r�filterzBaseSpecifier.filter����(+rc��yrrr�s    rr�zBaseSpecifier.filter����rc��y)z�
        Takes an iterable of items and filters them so that only items which
        are contained within this specifier are allowed in it.
        Nrr�s    rr�zBaseSpecifier.filter�r�rrdrbr`�r^�bool | None)rRr(r^r_r)r�r$r�r�r^r(�N.�r�zIterable[UnparsedVersionVar]r�r�r�r_r^zIterator[UnparsedVersionVar]�r�zIterable[T]r�r�r�zCallable[[T], UnparsedVersion]r^zIterator[T]�NN�r��
Iterable[Any]r�r�r��'Callable[[Any], UnparsedVersion] | Noner^�
Iterator[Any])r5r6r7re�__match_args__�propertyr��abc�abstractmethodr�rWrPr��setterr��typing�overloadr�rrrrrds����I��N�
����	������	������
	��������������������	������
�_�_�$(��	+�.�+�!�+��	+�

&�+��+��_�_�$(�.1�	���!��,�	�

����	���$(�7;�		��	�!�	�5�		�

�	��	rr)�	metaclassc	�\�eZdZUdZdZdZejdezdzejejz�Z
ddddd	d
ddd
�Zded<d1d2d�Z
d3d�Zd4d�Zd5d�Zd6d�Zd6d�Zed7d��Zej*d8d��Zd9d�Zd:d�Zed;d��Zed;d��Zd;d�Zd;d�Zed<d��Zd=d �Zd>d!�Zd?d"�Zd@d#�Z dAd$�Z!d@d%�Z"d@d&�Z#d@d'�Z$d@d(�Z%dBd)�Z&dBd*�Z'dCd+�Z(dDd,�Z)dEdFd-�Z*e+jX		dG							dHd.��Z-e+jX		dG							dId/��Z-		dJ							dKd0�Z-y)Lra�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.
    )�_prereleases�_ranges�_spec�
_spec_version�_wildcard_splita
        (?:
            (?:
                # The identity operators allow for an escape hatch that will
                # do an exact string match of the version you wish to install.
                # This will not be parsed by PEP 440 and we cannot determine
                # any semantic meaning from it. This operator is discouraged
                # but included entirely as an escape hatch.
                ===  # Only match for the identity operator
                \s*
                [^\s;)]*  # The arbitrary version can be just about anything,
                          # we match everything except for whitespace, a
                          # semi-colon for marker support, and a closing paren
                          # since versions can be enclosed in them.
            )
            |
            (?:
                # The (non)equality operators allow for wild card and local
                # versions to be specified so we have to define these two
                # operators separately to enable that.
                (?:==|!=)            # Only match for equals and not equals

                \s*
                v?
                (?:[0-9]+!)?          # epoch
                [0-9]+(?:\.[0-9]+)*   # release

                # You cannot use a wild card and a pre-release, post-release, a dev or
                # local version together so group them with a | and make them optional.
                (?:
                    \.\*  # Wild card syntax of .*
                    |
                    (?a:                                  # pre release
                        [-_\.]?
                        (alpha|beta|preview|pre|a|b|c|rc)
                        [-_\.]?
                        [0-9]*
                    )?
                    (?a:                                  # post release
                        (?:-[0-9]+)|(?:[-_\.]?(post|rev|r)[-_\.]?[0-9]*)
                    )?
                    (?a:[-_\.]?dev[-_\.]?[0-9]*)?         # dev release
                    (?a:\+[a-z0-9]+(?:[-_\.][a-z0-9]+)*)? # local
                )?
            )
            |
            (?:
                # The compatible operator requires at least two digits in the
                # release segment.
                (?:~=)               # Only match for the compatible operator

                \s*
                v?
                (?:[0-9]+!)?          # epoch
                [0-9]+(?:\.[0-9]+)+   # release  (We have a + instead of a *)
                (?:                   # pre release
                    [-_\.]?
                    (alpha|beta|preview|pre|a|b|c|rc)
                    [-_\.]?
                    [0-9]*
                )?
                (?:                                   # post release
                    (?:-[0-9]+)|(?:[-_\.]?(post|rev|r)[-_\.]?[0-9]*)
                )?
                (?:[-_\.]?dev[-_\.]?[0-9]*)?          # dev release
            )
            |
            (?:
                # All other operators only allow a sub set of what the
                # (non)equality operators do. Specifically they do not allow
                # local versions to be specified nor do they allow the prefix
                # matching wild cards.
                (?:<=|>=|<|>)

                \s*
                v?
                (?:[0-9]+!)?          # epoch
                [0-9]+(?:\.[0-9]+)*   # release
                (?a:                   # pre release
                    [-_\.]?
                    (alpha|beta|preview|pre|a|b|c|rc)
                    [-_\.]?
                    [0-9]*
                )?
                (?a:                                   # post release
                    (?:-[0-9]+)|(?:[-_\.]?(post|rev|r)[-_\.]?[0-9]*)
                )?
                (?a:[-_\.]?dev[-_\.]?[0-9]*)?          # dev release
            )
        )
        z\s*�
compatible�equal�	not_equal�less_than_equal�greater_than_equal�	less_than�greater_than�	arbitrary)�~=�==�!=�<=�>=rwry�===r�
_operatorsNc��|jj|�std|����|j�}|j	d�r|dd|ddj�}}nB|j	d�r|dd|ddj�}}n|dd|ddj�}}||f|_||_d|_d|_d|_	y)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).
        zInvalid specifier: r�Nr)r�r�r�r�r�r r
)
�_regex�	fullmatchr�strip�
startswithr�r�r�r�r�)rCr%r��operatorrAs     rrEzSpecifier.__init__=s����{�{�$�$�T�*�"�%8���#A�B�B��z�z�|���?�?�5�!� $�R�a��$�q�r�(�.�.�*:�g�H�
�_�_�;�
<� $�R�a��$�q�r�(�.�.�*:�g�H� $�R�a��$�q�r�(�.�.�*:�g�H�'/��&9��
�(���:>���>B���8<��rc��|j�!|jd|k(r|jdSt|�}|�y||f|_|S)zDOne element cache, as only one spec Version is needed per Specifier.Nrr
)r�r�)rCrA�version_specifiers   r�_get_spec_versionzSpecifier._get_spec_versioncsY�����)�d�.@�.@��.C�w�.N��%�%�a�(�(�+�G�4���$��%�'8�9��� � rc�0�|j|�}|�J�|S)z�Get 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)rCrA�spec_versions   r�_require_spec_versionzSpecifier._require_spec_versionos&���-�-�g�6���'�'�'��rc��|j�|jS|j}|j}|dk(rt|_tS|j	d�r|j||�}n|j
||�}||_|S)z�Convert 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��.*)r�r�rAr��endswith�_wildcard_ranges�_standard_ranges)rC�op�ver_strr�s    r�
_to_rangeszSpecifier._to_rangesys|���<�<�#��<�<��
�]�]���,�,��
��;�&�D�L������D�!��*�*�2�w�7�F��*�*�2�w�7�F�����
rc���|j|dd�}t|�}t|�}|dk(rt|d�t	|d�fgSt
t	|d�ft|d�tfgS)N���r�TF)rr�r�rgr��_NEG_INF�_POS_INF)rCrr�baser�r�s      rr	zSpecifier._wildcard_ranges�sy���)�)�'�#�2�,�7���4� ��!�$�'��
��:� ���-�{�5�%�/H�I�J�J��{�5�%�0�1�
���
%�x�0�
�	
rc��|j|�}|dk(rt|d�tfgS|dk(r+tt	t|tj�d�fgS|dk(r�|j�3|j|jdzd��}t|d�tfgS|j�4|j|jdzdd��}t|d�tfgStt|tj�d	�tfgS|d
k(r?|jr|n|jdd��}|tkrgStt	|d	�fgSd|v}t|tj�}|r|n|}|dk(rt|d�t	|d�fgS|d
k(r$tt	|d	�ft|d	�tfgS|dk(rA|j|jdd��}	t|d�t	t|	�d	�fgSt!d|����)Nr�Tr�ryr
r�rr�Frw�+r�r�r�r�)r0�Unknown operator: )rrgrrr�r>r4r;rIr�rHr<r�r.r0r��
ValueError)
rCrrrK�	lower_verr-�	has_local�after_localsr��prefixs
          rr
zSpecifier._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��
�
��:��]�]�1�9�9�S�b�>�]�:�F��Q��%�{�3D�V�3L�e�'T�U��
��-�b�V�4�5�5rc���|j�|jS|j\}}|dk(ry|dk(r|jd�ry|j|�}|�y|jS)Nr�Fr�r)r�r�rrr�)rCr��version_strrAs    rr�zSpecifier.prereleases�sy�����(��$�$�$�!%�
�
���+��t����t��� 4� 4�T� :���(�(��5���?���$�$�$rc��||_yr)r�r�s  rr�zSpecifier.prereleases�s
��!��rc�2�|j|jfSr)r�r�rVs r�__getstate__zSpecifier.__getstate__�s���
�
�D�-�-�.�.rc�d�d|_d|_d|_t|t�r�t|�dk(r*|\}}t
|�rt|�r||_||_	yt|�dk(r`t|dt�rM|\}}|jd�}|jdd�}t
|�rt|�r||_||_	yt|t�rH|jd�}|jdd�}t
|�rt|�r||_||_	ytd|����)Nr r
r�r��invalidzCannot restore Specifier from )
r�r�r�r!r"r#r&r*r�r��dict�get�	TypeError)rC�stater%r��_�	slot_dicts      r�__setstate__zSpecifier.__setstate__s��!���#�������e�U�#��5�z�Q��$)�!��k�!�$�'�M�+�,F�!%�D�J�(3�D�%���5�z�Q��:�e�A�h��#=�$���9� �}�}�W�-��'�m�m�N�I�F��!�$�'�M�+�,F�!%�D�J�(3�D�%���e�T�"��9�9�W�%�D��)�)�N�I�>�K��d�#�
�k�(B�!��
�$/��!���8��	�B�C�Crc� �|jdS)z`The operator of this specifier.

        >>> Specifier("==1.2.3").operator
        '=='
        r�r�rVs rr�zSpecifier.operator$����z�z�!�}�rc� �|jdS)zaThe version of this specifier.

        >>> Specifier("==1.2.3").version
        '1.2.3'
        r
r*rVs rrAzSpecifier.version-r+rc��|j�d|j��nd}d|jj�dt	|��|�d�S)aTA 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=�rwrY�)>�r�r�r[r5r$�rCr)s  rr]zSpecifier.__repr__6sU��� � �,��T�-�-�0�1��	��4�>�>�*�*�+�1�S��Y�M�#��b�A�Arc�4�dj|j�S)z�A 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{}{})�formatr�rVs rr�zSpecifier.__str__Hs���v�}�}�d�j�j�)�)rc��|j\}}|dk(s|jd�r||fS|j|�}t||dk7��}||fS)Nr�rr���strip_trailing_zero)r�rrr)rCr�rAr�canonical_versions     r�_canonical_speczSpecifier._canonical_specRsc�� �J�J���'��u��� 0� 0�� 6��W�$�$��1�1�'�:��0��x�4�/?�
���*�*�*rc�,�t|j�Sr)rUr9rVs rrWzSpecifier.__hash__`s���D�(�(�)�)rc���t|t�r	|jt|��}nt||j�stS|j
|j
k(S#t$r	tcYSwxYw)a>Whether or not the two Specifier-like objects are equal.

        :param other: The other object to check against.

        The value of :attr:`prereleases` is ignored.

        >>> Specifier("==1.2.3") == Specifier("== 1.2.3.0")
        True
        >>> (Specifier("==1.2.3", prereleases=False) ==
        ...  Specifier("==1.2.3", prereleases=True))
        True
        >>> Specifier("==1.2.3") == "==1.2.3"
        True
        >>> Specifier("==1.2.3") == Specifier("==1.2.4")
        False
        >>> Specifier("==1.2.3") == Specifier("~=1.2.3")
        False
        )r!r$r[rrNr9rOs  rrPzSpecifier.__eq__csi��&�e�S�!�
&����s�5�z�2���E�4�>�>�2�!�!��#�#�u�'<�'<�<�<��$�
&�%�%�
&�s�A"�"A4�3A4c�>�t|d|j|���}|S)N�	_compare_)�getattrr�)rCr�operator_callables   r�
_get_operatorzSpecifier._get_operator�s+��.5��I�d�o�o�b�1�2�3�/
��!� rc
���tttjtt|���dd�}|dz
}|j
||�xr|j||�S)Nr�r)�
_version_join�list�	itertools�	takewhile�_is_not_suffix�_version_split�_compare_greater_than_equal�_compare_equal)rC�prospectiver%rs    r�_compare_compatiblezSpecifier._compare_compatible�sd�����$�$�^�^�D�5I�J�K�C�R�P�
��
	�$����0�0��d�C�
�����V�4�	
rc��|j}|�/t|ddd��}t|�}|t|�f}||_|S)z�Cached split of a wildcard spec into components and numeric length.

        >>> Specifier("==1.*")._get_wildcard_split("1.*")
        (['0', '1'], 2)
        >>> Specifier("==3.10.*")._get_wildcard_split("3.10.*")
        (['0', '3', '10'], 3)
        NrFr6)r�rrG�_numeric_prefix_len)rCr%�wildcard_split�
normalized�
split_specs     r�_get_wildcard_splitzSpecifier._get_wildcard_split�sO���-�-���!�-�d�3�B�i�U�S�J�'�
�3�J�(�*=�j�*I�J�N�#1�D� ��rc�&�|jd�rT|j|�\}}tt|�d��}t	|�}t||�}|dt
|�}||k(S|j|�}	|	jst|�}||	k(S)NrFr6)	rrQrr�rG�	_left_padr#rr�)
rCrJr%rP�spec_numeric_len�normalized_prospective�split_prospective�padded_prospective�shortened_prospectivers
          rrIzSpecifier._compare_equal�s����=�=���+/�+C�+C�D�+I�(�J�(�&:���,�%�&�"�!/�/E� F��"+�+<�>N�!O��
%7�7H��Z��$I�!�(�J�6�6� �5�5�d�;�L�
 �%�%�-�k�:���,�.�.rc�(�|j||�Sr)rI�rCrJr%s   r�_compare_not_equalzSpecifier._compare_not_equal�s���&�&�{�D�9�9�9rc�<�t|�|j|�kSr�r�rrZs   r�_compare_less_than_equalz"Specifier._compare_less_than_equal�����{�+�t�/I�/I�$�/O�O�Orc�<�t|�|j|�k\Srr]rZs   rrHz%Specifier._compare_greater_than_equal�r_rc��|j|�}||ksy|js|jr|t|�k\ryyr�)rr�r��rCrJ�spec_strr%s    r�_compare_less_thanzSpecifier._compare_less_than�sK���)�)�(�3��
�T�!��
�"�"��)�)��3�D�9�9��
rc��|j|�}||kDsy|js|jrt|�|k(ry|j�t	|�|k(ryyr�)r�is_postreleaser�r�r�rbs    r�_compare_greater_thanzSpecifier._compare_greater_than�sg���)�)�(�3��
�T�!��
�#�#��*�*��;�'�4�/�����(�_�[�-I�T�-Q��
rc�h�t|�j�t|�j�k(Sr�r$r�rZs   r�_compare_arbitraryzSpecifier._compare_arbitrarys&���;��%�%�'�3�t�9�?�?�+<�<�<rc�$�|j|�S)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��rCr�s  r�__contains__zSpecifier.__contains__���&�}�}�T�"�"rc�N�tt|j|g|����S)asReturn whether or not the item is contained in this specifier.

        :param item:
            The item to check for, which can be a version string or a
            :class:`Version` instance.
        :param prereleases:
            Whether or not to match prereleases with this Specifier. If set to
            ``None`` (the default), it will follow the recommendation from
            :pep:`440` and match prereleases, as there are no other versions.

        >>> Specifier(">=1.2.3").contains("1.2.3")
        True
        >>> Specifier(">=1.2.3").contains(Version("1.2.3"))
        True
        >>> Specifier(">=1.2.3").contains("1.0.0")
        False
        >>> Specifier(">=1.2.3").contains("1.3.0a1")
        True
        >>> Specifier(">=1.2.3", prereleases=False).contains("1.3.0a1")
        False
        >>> Specifier(">=1.2.3").contains("1.3.0a1")
        True
        �r�)r(rCr�r�s   rr�zSpecifier.contains.s#��2�D����d�V���E�F�G�Grc��yrrr�s    rr�zSpecifier.filterIr�rc��yrrr�s    rr�zSpecifier.filterQr�rc#�ZK�g}d}|�|n|j}|j|j�}|D]�}t|�|n||��}	d}
|	�0|jdk(rj|j	||j
�rN|��nI|jdk(r'|j	|�|n||�|j
�}
n||	|j
�}
|
s��|	���|	jr|rd}|����|���|jdus��|j|���|s|�|jdur|Ed{���yyyy7��w)a�Filter items in the given iterable, that match the specifier.

        :param iterable:
            An iterable that can contain version strings and :class:`Version` instances.
            The items in the iterable will be filtered according to the specifier.
        :param prereleases:
            Whether or not to allow prereleases in the returned iterator. If set to
            ``None`` (the default), it will follow the recommendation from :pep:`440`
            and match prereleases if there are no other versions.
        :param key:
            A callable that takes a single argument (an item from the iterable) and
            returns a version string or :class:`Version` instance to be used for
            filtering.

        >>> list(Specifier(">=1.2.3").filter(["1.2", "1.3", "1.5a1"]))
        ['1.3']
        >>> list(Specifier(">=1.2.3").filter(["1.2", "1.2.3", "1.3", Version("1.4")]))
        ['1.2.3', '1.3', <Version('1.4')>]
        >>> list(Specifier(">=1.2.3").filter(["1.2", "1.5a1"]))
        ['1.5a1']
        >>> list(Specifier(">=1.2.3").filter(["1.3", "1.5a1"], prereleases=True))
        ['1.3', '1.5a1']
        >>> list(Specifier(">=1.2.3", prereleases=True).filter(["1.3", "1.5a1"]))
        ['1.3', '1.5a1']
        >>> list(Specifier(">=1.2.3").filter(
        ... [{"ver": "1.2"}, {"ver": "1.3"}],
        ... key=lambda x: x["ver"]))
        [{'ver': '1.3'}]
        FNr�T)	r�r@r�r�rjrAr�r�r�)rCr�r�r��prereleases_versions�found_non_prereleases�include_prereleasesr?rA�parsed_version�matchs           rr�zSpecifier.filterYsS����F "�� %��'�2�K��8H�8H�	�
!�.�.�t�}�}�=�� �	9�G�,���W��W��V�N��E��%��=�=�E�)�d�.E�.E��T�\�\�/�"�M����%�'��/�/�"�{�G��G��d�l�l���*�.�$�,�,�G����3�%�3�3�7J�,0�)�!�M� �(�T�->�->�e�-K�(�/�/��8�/	9�8&��#��!�!��.�+�+�+�/�$�&�
,�s*�C	D+�D+�D+�'D+�6*D+� D)�!	D+�r/N)r%r$r�r�r^r_)rAr$r^�Version | None)rAr$r^r�r^�Sequence[_VersionRange])rr$rr$r^�list[_VersionRange]r��rRr�r^r_)r^z#tuple[tuple[str, str], bool | None]�r%rar^r_rd)r^ztuple[str, str]rbr`)rr$r^�CallableOperator)rJrr%r$r^r()r%r$r^ztuple[list[str], int])rJrrcr$r^r()rJz
Version | strr%r$r^r()r�z
str | Versionr^r(r)r��UnparsedVersionr�r�r^r(r�r�r�r�r�).r5r6r7r8re�_specifier_regex_str�re�compile�VERBOSE�
IGNORECASEr�r��__annotations__rErrr
r	r
r�r�r�rr(r�rAr]r�r9rWrPr@rKrQrIr[r^rHrdrgrjrnr�r�r�r�rrrrr�s���&�I�Z��x�R�Z�Z��%�%��.��
�
�R�]�]�0J��F�
����"�
�
��	�J��	�$<�L
!���0
�<6�|�%��%�6���"��"�/� D�D��������B�$*��+��+�*�=�:!�
�(� "/�H:�P�P��2�@=�#�*H�6�_�_�$(��	+�.�+�!�+��	+�

&�+��+��_�_�$(�.1�	���!��,�	�

����$(�7;�	O,��O,�!�O,�5�	O,�

�O,rrz([0-9]+)((?:a|b|c|rc)[0-9]+)c#�0K�g}g}d}|D]v}t|�|n||��}|�*|r|��n"|j|�|j|��D|js|s|Ed{���d}|���c|r�f|j|��x|s|Ed{���yy7�/7��w)z?Filter per PEP 440: exclude prereleases unless no finals exist.FNT)r�r�r�)r�r��all_nonfinal�arbitrary_strings�found_finalr��parseds       r�_pep440_filter_prereleasesr��s�����!�L�#%���K��&�� ����#�d�)�D���>���
�!�(�(��.��#�#�D�)���#�#��,�,�,�"���J�������%�1&�6�����-��	 �s*�A B�"B�#
B�1B�B�B�Bc��g}|jd�\}}}|j|xsd�|jd�D]J}tj	|�}|r |j|j
���:|j|��L|S)aSplit version into components.

    The split components are intended for version comparison. The logic does
    not attempt to retain the original version string, so joining the
    components back with :func:`_version_join` may not produce the original
    version string.
    �!�0�.)�
rpartitionr��split�
_prefix_regexr��extend�groups)rAr�rGr&�restr�rys       rrGrG�s~���F��'�'��,�N�E�1�d�
�M�M�%�,�3���
�
�3�� ���'�'��-����M�M�%�,�,�.�)��M�M�$�� ��Mrc�6�|^}}|�ddj|���S)z�Join split version components into a version string.

    This function assumes the input came from :func:`_version_split`, where the
    first component must be the epoch (either empty or numeric), and all other
    components numeric.
    r�r�)�join)�
componentsrGr�s   rrBrB�s'���L�E�D��W�A�c�h�h�t�n�%�&�&rc�.��t�fd�dD��S)Nc3�@�K�|]}�j|����y�wr)r�)�.0r�segments  �r�	<genexpr>z!_is_not_suffix.<locals>.<genexpr>�s!������'-����6�"����)rI�a�b�rcrH)�any)r�s`rrFrF�s"�����1P����rc�H�d}|D]}|j�s|S|dz
}�|S)z�Count leading numeric components in a :func:`_version_split` result.

    >>> _numeric_prefix_len(["0", "1", "2", "a1"])
    3
    rr
)�isdigit)r��countr�s   rrMrM�s<��
�E������� ���L�	��
����Lrc�T�t|�}||z
}|dkr|Sg|d|�dg|z�||d�S)z�Pad a :func:`_version_split` result with ``"0"`` segments to reach
    ``target_numeric_len`` numeric components.  Suffix segments are preserved.

    >>> _left_pad(["0", "1", "a1"], 4)
    ['0', '1', '0', '0', 'a1']
    rNr�)rM)r��target_numeric_len�numeric_len�
pad_neededs    rrSrS
sN��&�e�,�K�#�k�1�J��Q����N�U�<�K�
 �N�S�E�J�$6�N�%���:M�N�Nrc��|\}}}|dk(r|jd�sdSdS|dvry|dk(ry|dk(r|jd�sd	Sd
S|dk(rytd|����)
aLSort key for Cost Based Ordering of specifier operators in _filter_versions.

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

    Tier 0: Exact equality (==, ===), likely to narrow candidates to one version
    Tier 1: Range checks (>=, <=, >, <), cheap and usually reject a large portion
    Tier 2: Wildcard equality (==.*) and compatible release (~=), more expensive
    Tier 3: Exact !=, cheap but rarely rejects
    Tier 4: Wildcard !=.*, expensive and rarely rejects
    r�rrr )r�r�ryrwr
r�r�r�r�r)rr)�op_entryr&�verrs    r�_operator_costr�s|���J�A�s�B�	�T�z����T�*�q�1��1�	�
#�#��	�T�z��	�T�z����T�*�q�1��1�	�U�{��
�)�"��0�
1�1rc��eZdZdZdZ		d					dd�Zdd�Zedd��Zejdd��Zd d�Z
d!d	�Zd"d
�Zd"d�Z
d#d�Zd$d
�Zd%d�Zd#d�Zd&d�Zd'd�Zd(d�Zd(d�Zd(d�Zd)d�Z		d*							d+d�Zej4		d,							d-d��Zej4		d,							d.d��Z		d*							d/d�Z	d0							d1d�Zy)2ra�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.
    )�_canonicalized�_has_arbitrary�_is_unsatisfiabler��
_resolved_ops�_specsNc��t|t�re|jd�D�cgc]#}|j�s�|j���%}}t	tt|��|_d|v|_n1t	|�|_td�|jD��|_t|j�dk|_d|_||_
d|_ycc}w)a�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�c3�6K�|]}dt|�v���y�w�r�Nr��r��ss  rr�z(SpecifierSet.__init__.<locals>.<genexpr>ts����%K�!�e�s�1�v�o�%K���r
N)r!r$r�r�r"�maprr�r�r�r#r�r�r�r�)rC�
specifiersr�r��split_specifierss     rrEzSpecifierSet.__init__Rs���,�j�#�&�4>�3C�3C�C�3H�V�a�A�G�G�I����	�V��V�16�s�9�FV�7W�1X�D�K�"'�:�"5�D���
�+�D�K�#&�%K�t�{�{�%K�"K�D��!�$�+�+�.�!�3���MQ���(���.2����% Ws
�C�Cc���|jsQttjt	|j
t����|_d|_d|_d|_|j
S)zBDeduplicate, sort, and cache specs for order-sensitive operations.�r�TN)	r�r"r"�fromkeys�sortedr�r$r�r�rVs r�_canonical_specszSpecifierSet._canonical_specssM���"�"���
�
�f�T�[�[�c�.J� K�L�D�K�"&�D��!%�D��%)�D�"��{�{�rc��|j�|jS|jsytd�|jD��ryy)Nc3�4K�|]}|j���y�wrrqr�s  rr�z+SpecifierSet.prereleases.<locals>.<genexpr>�s����2��q�}�}�2�s�T)r�r�r�rVs rr�zSpecifierSet.prereleases�sB�����(��$�$�$�
�{�{���2�d�k�k�2�2��rc� �||_d|_yr)r�r�r�s  rr�zSpecifierSet.prereleases�s��!���!%��rc�2�|j|jfSr)r�r�rVs rrzSpecifierSet.__getstate__�s�����T�.�.�/�/rc���d|_d|_t|t��rft	|�dk(rk|\}}t|t�rVtd�|D��rDt
|�r9||_||_t	|�dk|_	td�|D��|_yt	|�dk(r�t|dt�r�|\}}|jdd�}|jd�}t|t�rtt|t ���}t|t�rjtd	�|D��rXt
|�rM||_||_t	|j�dk|_	td
�|jD��|_yt|t�r�|jdd�}|jd�}t|t�rtt|t ���}t|t�rjtd�|D��rXt
|�rM||_||_t	|j�dk|_	td�|jD��|_yt#d
|����)Nr c3�<K�|]}t|t����y�wr�r!rr�s  rr�z,SpecifierSet.__setstate__.<locals>.<genexpr>������D��J�q�)�4�D���r
c3�6K�|]}dt|�v���y�wr�r�r�s  rr�z,SpecifierSet.__setstate__.<locals>.<genexpr>�s����-M�!�e�s�1�v�o�-M�r�r�rr�r�c3�<K�|]}t|t����y�wrr�r�s  rr�z,SpecifierSet.__setstate__.<locals>.<genexpr>�r�r�c3�6K�|]}dt|�v���y�wr�r�r�s  rr�z,SpecifierSet.__setstate__.<locals>.<genexpr>�s����-S�!�e�s�1�v�o�-S�r�c3�<K�|]}t|t����y�wrr�r�s  rr�z,SpecifierSet.__setstate__.<locals>.<genexpr>�s����@�Q�
�1�i�0�@�r�c3�6K�|]}dt|�v���y�wr�r�r�s  rr�z,SpecifierSet.__setstate__.<locals>.<genexpr>�s����)O�a�%�3�q�6�/�)O�r�z!Cannot restore SpecifierSet from )r�r�r!r"r#�allr*r�r�r�r�r�r"r#�	frozensetr�r$r$)rCr%�specsr�r&r's      rr(zSpecifierSet.__setstate__�s���!���!%����e�U�#��5�z�Q��%*�"��{��u�e�,��D�e�D�D�%�k�2�"'�D�K�(3�D�%�*-�e�*��/�D�'�*-�-M�u�-M�*M�D�'���5�z�Q��:�e�A�h��#=�$���9�!�
�
�h��3��'�m�m�N�;���e�Y�/�!�&��C�"8�9�E��u�e�,��D�e�D�D�%�k�2�"'�D�K�(3�D�%�*-�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��|j�d|j��nd}d|jj�dt	|��|�d�S)aA 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/rwrYr0r1r2s  rr]zSpecifierSet.__repr__�sU��� � �,��T�-�-�0�1��	��4�>�>�*�*�+�1�S��Y�M�#��b�A�Arc�N�djd�|j�D��S)anA 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�c3�2K�|]}t|����y�wrr�r�s  rr�z'SpecifierSet.__str__.<locals>.<genexpr>s����@�1��A��@�s�)r�r�rVs rr�zSpecifierSet.__str__�s"���x�x�@��(=�(=�(?�@�@�@rc�4�t|j��Sr)rUr�rVs rrWzSpecifierSet.__hash__s���D�)�)�+�,�,rc��t|t�rt|�}nt|t�stSt�}|j|jz|_t|j�dk|_|jxs|j|_d|_|j�|j|jk(r|j|_	|S|j�|j|_	|Std��)a�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')>
        r
NzFCannot combine SpecifierSets with True and False prerelease overrides.)r!r$rrNr�r#r�r�r�r�r)rCrJ�	specifiers   r�__and__zSpecifierSet.__and__s����e�S�!� ��'�E��E�<�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���t|ttf�rtt|��}nt|t�stS|j�|j�k(S)a�Whether or not the two SpecifierSet-like objects are equal.

        :param other: The other object to check against.

        The value of :attr:`prereleases` is ignored.

        >>> SpecifierSet(">=1.0.0,!=1.0.1") == SpecifierSet(">=1.0.0,!=1.0.1")
        True
        >>> (SpecifierSet(">=1.0.0,!=1.0.1", prereleases=False) ==
        ...  SpecifierSet(">=1.0.0,!=1.0.1", prereleases=True))
        True
        >>> SpecifierSet(">=1.0.0,!=1.0.1") == ">=1.0.0,!=1.0.1"
        True
        >>> SpecifierSet(">=1.0.0,!=1.0.1") == SpecifierSet(">=1.0.0")
        False
        >>> SpecifierSet(">=1.0.0,!=1.0.1") == SpecifierSet(">=1.0.0,!=1.0.2")
        False
        )r!r$rrrNr�rOs  rrPzSpecifierSet.__eq__&sN��&�e�c�9�-�.� ��U��,�E��E�<�0�!�!��$�$�&�%�*@�*@�*B�B�Brc�,�t|j�S)z7Returns the number of specifiers in this specifier set.)r#r�rVs r�__len__zSpecifierSet.__len__@s���4�;�;��rc�,�t|j�S)z�
        Returns an iterator over all the underlying :class:`Specifier` instances
        in this specifier set.

        >>> sorted(SpecifierSet(">=1.0.0,!=1.0.1"), key=str)
        [<Specifier('!=1.0.1')>, <Specifier('>=1.0.0')>]
        )�iterr�rVs r�__iter__zSpecifierSet.__iter__Ds���D�K�K� � rc��|j}d}|D]3}|�|j�}�t||j��}|r�3n|�td��|S)aIntersect all specifiers into a single list of version ranges.

        Returns an empty list when unsatisfiable.  ``===`` specs are
        modeled as full range; string matching is checked separately
        by :meth:`_check_arbitrary_unsatisfiable`.
        Nz _get_ranges called with no specs)r�r
r��RuntimeError)rCr�r�r�s    r�_get_rangeszSpecifierSet._get_rangesNsa������15���	�A��~������*�6�1�<�<�>�B����
	��>��A�B�B��
rc���|j}|�|S|jsd|_y|j�}|s|j�}|s|jdur|j�}||_|S)a�Check whether this specifier set can never be satisfied.

        Returns True if no version can satisfy all specifiers simultaneously.

        >>> SpecifierSet(">=2.0,<1.0").is_unsatisfiable()
        True
        >>> SpecifierSet(">=1.0,<2.0").is_unsatisfiable()
        False
        >>> SpecifierSet("").is_unsatisfiable()
        False
        >>> SpecifierSet("==1.0,!=1.0").is_unsatisfiable()
        True
        F)r�r�r��_check_arbitrary_unsatisfiabler��_check_prerelease_only_ranges)rC�cachedr�s   r�is_unsatisfiablezSpecifierSet.is_unsatisfiabledsy���'�'�����M��{�{�%*�D�"���%�%�'�'����8�8�:�F��$�*�*�e�3��7�7�9�F�!'����
rc���|j�D]Y\}}t|j�}|�y|j�||jkry||jk(s�L|js�Yyy)z�With prereleases=False, check if every range contains only
        pre-release versions (which would be excluded from matching).FT)r�r�rAri)rCr�r��nearests    rr�z*SpecifierSet._check_prerelease_only_ranges�sh��!�,�,�.�	�L�E�5�-�e�m�m�<�G�����}�}�$��%�-�-�(?���%�-�-�'�E�O�O��	�rc�����|jD�cgc]}|jdk(s�|��}}|sy|djj��t	�fd�|ddD��ryt|dj��|jdur��
�jry|jD�cgc]}|jdk7s�|��}}|sy��yt�fd�|D��Scc}wcc}w)	aCheck === (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�Frc3�X�K�|]!}|jj��k7���#y�wr)rAr�)r�r��firsts  �rr�z>SpecifierSet._check_arbitrary_unsatisfiable.<locals>.<genexpr>�s!�����A�a�q�y�y��� �E�)�A�s�'*r
NTc3�@�K�|]}|j�����y�wrrl)r�r��	candidates  �rr�z>SpecifierSet._check_arbitrary_unsatisfiable.<locals>.<genexpr>�s�����?��q�z�z�)�,�?�r�)	r�r�rAr�r�r�r�r�r�)rCr�r��standardr�r�s    @@rr�z+SpecifierSet._check_arbitrary_unsatisfiable�s����!%���C�1�q�z�z�U�/B�Q�C�	�C����!��$�$�*�*�,���A�9�Q�R�=�A�A��$�I�a�L�$8�$8�9�	�

����%��%��'�'��#�{�{�B�!�a�j�j�E�.A�A�B��B�������?�h�?�?�?�?��=D��,Cs�C�C�'C"�<C"c�$�|j|�S)aqReturn 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
        rlrms  rrnzSpecifierSet.__contains__�rorc���t|�}|�|r|jrd}|�|jrt|t�s|}n|}tt
|j|g|����S)a�Return whether or not the item is contained in this SpecifierSet.

        :param item:
            The item to check for, which can be a version string or a
            :class:`Version` instance.
        :param prereleases:
            Whether or not to match prereleases with this SpecifierSet. If set to
            ``None`` (the default), it will follow the recommendation from :pep:`440`
            and match prereleases, as there are no other versions.
        :param installed:
            Whether or not the item is installed. If set to ``True``, it will
            accept prerelease versions even if the specifier does not allow them.

        >>> SpecifierSet(">=1.0.0,!=1.0.1").contains("1.2.3")
        True
        >>> SpecifierSet(">=1.0.0,!=1.0.1").contains(Version("1.2.3"))
        True
        >>> SpecifierSet(">=1.0.0,!=1.0.1").contains("1.0.1")
        False
        >>> SpecifierSet(">=1.0.0,!=1.0.1").contains("1.3.0a1")
        True
        >>> SpecifierSet(">=1.0.0,!=1.0.1", prereleases=False).contains("1.3.0a1")
        False
        >>> SpecifierSet(">=1.0.0,!=1.0.1").contains("1.3.0a1", prereleases=True)
        True
        Trq)r�r�r�r!rr(rCr�)rCr�r��	installedrA�
check_items      rr�zSpecifierSet.contains�se��@"�$�'����9��1F�1F��K��?�t�2�2�:�d�G�;T��J� �J��D����j�\�{��K�L�M�Mrc��yrrr�s    rr�zSpecifierSet.filter�r�rc��yrrr�s    rr�zSpecifierSet.filterr�rc�t���|�|j�|j}|jrft|j�dk(r&|jdj||�dn|���}n|j	|�|�dn|��}|�|St|��S|durt
|�S|dur��fd�|D�St|��S)acFilter items in the given iterable, that match the specifiers in this set.

        :param iterable:
            An iterable that can contain version strings and :class:`Version` instances.
            The items in the iterable will be filtered according to the specifier.
        :param prereleases:
            Whether or not to allow prereleases in the returned iterator. If set to
            ``None`` (the default), it will follow the recommendation from :pep:`440`
            and match prereleases if there are no other versions.
        :param key:
            A callable that takes a single argument (an item from the iterable) and
            returns a version string or :class:`Version` instance to be used for
            filtering.

        >>> list(SpecifierSet(">=1.2.3").filter(["1.2", "1.3", "1.5a1"]))
        ['1.3']
        >>> list(SpecifierSet(">=1.2.3").filter(["1.2", "1.3", Version("1.4")]))
        ['1.3', <Version('1.4')>]
        >>> list(SpecifierSet(">=1.2.3").filter(["1.2", "1.5a1"]))
        ['1.5a1']
        >>> list(SpecifierSet(">=1.2.3").filter(["1.3", "1.5a1"], prereleases=True))
        ['1.3', '1.5a1']
        >>> list(SpecifierSet(">=1.2.3", prereleases=True).filter(["1.3", "1.5a1"]))
        ['1.3', '1.5a1']
        >>> list(SpecifierSet(">=1.2.3").filter(
        ... [{"ver": "1.2"}, {"ver": "1.3"}],
        ... key=lambda x: x["ver"]))
        [{'ver': '1.3'}]

        An "empty" SpecifierSet will filter items based on the presence of prerelease
        versions in the set.

        >>> list(SpecifierSet("").filter(["1.3", "1.5a1"]))
        ['1.3']
        >>> list(SpecifierSet("").filter(["1.5a1"]))
        ['1.5a1']
        >>> list(SpecifierSet("", prereleases=True).filter(["1.3", "1.5a1"]))
        ['1.3', '1.5a1']
        >>> list(SpecifierSet("").filter(["1.3", "1.5a1"], prereleases=True))
        ['1.3', '1.5a1']
        r
rT)r�r�rqFc3�j�K�|]*}t��|n�|��x�	��js|���,y�wr)r�r�)r�r�r�rAs  ��rr�z&SpecifierSet.filter.<locals>.<genexpr>^sA������� /�����T�� S�S�W���"�0�0���s�03)r�r�r#r��_filter_versionsr�r�)rCr�r�r��filteredrAs   ` @rr�zSpecifierSet.filters����d��4�#3�#3�#?��*�*�K��;�;��4�;�;��1�$��;�;�q�>�0�0��(3�(;����1��� �0�0���(3�(;���1����&���-�h��<�<��$����>�!��%���$��
�*�(�C�8�8rc#�\���K�|j�'td�|jD�t��|_|j}|du}|D]]�t	���n�������t�fd�|D��s�/����4|r
�jr�Ct���fd�|D��s�Z����_y�w)a?Filter versions against all specifiers in a single pass.

        Uses Cost Based Ordering: specifiers are sorted by _operator_cost so
        that cheap range operators reject versions early, avoiding expensive
        wildcard or compatible operators on versions that would have been
        rejected anyway.
        Nc3�K�|]6}|j|j�|j|jf���8y�wr)r@r�rA)r�r%s  rr�z0SpecifierSet._filter_versions.<locals>.<genexpr>{s6�������'�'��
�
�6����d�m�m�T��s�<>r�Fc3��K�|]9\}}}|dk(xr*t��j�|j�k(���;y�wr�ri)r�r&r�rr�s    �rr�z0SpecifierSet._filter_versions.<locals>.<genexpr>�sA������"��3���%�K�D�C��I�O�O�$5�����$D�D��s�?Ac3��K�|]J\}}}|dk(r4t���n����j�|j�k(n|�|����Ly�wr�ri)r��op_fnr�rr�r�r�s    ���rr�z0SpecifierSet._filter_versions.<locals>.<genexpr>�s\������#�E�3����;��C�K�D�S��Y�7�=�=�?�3�9�9�;�N��6�3�'�(��s�AA)r�r�r�r�r�r�r�)rCr�r�r��ops�exclude_prereleasesr�r�s  `   @@rr�zSpecifierSet._filter_versionsks���������%�!'�� $����#�"�D��� � ��)�U�2���	�D�$�S�[�T�c�$�i�H�F��~���&)����J�$��)=�)=����'*�	���
�'	�s�A4B,�:*B,�%B,rz)r�zstr | Iterable[Specifier]r�r�r^r_)r^ztuple[Specifier, ...]r�r)r^z)tuple[tuple[Specifier, ...], bool | None]r�rdrb)rJzSpecifierSet | strr^rr`)r^zIterator[Specifier]r|)r^r()r�r�r^r(r�)r�r�r�r�r�r�r^r(r�r�r�r�r)r�r�r�r�r�r�r^r�)r5r6r7r8rerEr�r�r�r�rr(r]r�rWr�rPr�r�r�r�r�r�rnr�r�r�r�r�rrrrr6s����$�I�13�#'�+3�-�+3�!�+3�
�	+3�Z�����&���&��&�0�7G�rB�*A�-��BC�4 �!��,�B�%@�N#�0$(�!%�	+N��+N�!�+N��	+N�

�+N�Z�_�_�$(��	+�.�+�!�+��	+�

&�+��+��_�_�$(�.1�	���!��,�	�

����$(�7;�	^9��^9�!�^9�5�	^9�

�^9�H$(�	,��,�5�,�!�	,�

�,rr)r^�	list[str])r%rar^zTypeGuard[tuple[str, str]])r)rar^zTypeGuard[bool | None])r0�tuple[int, ...]r^r)r�rgr�r�r^r()r�r}r�r}r^r~)rArr^r)rAr�r^r{)rKr~r^r{)r�r�r�r�r^r�)rAr$r^r)r�rr^r$)r�r$r^r()r�rr^rc)r�rr�rcr^r)r�z!tuple[CallableOperator, str, str]r^rc)Lr8�
__future__rr�r9�	functoolsrDr��sysr�rrrrrr	r
rr�utilsrrArr�version_infor�typing_extensionsrrr&r*r+r$r�r,r(r�r.r�r2�Enumr4�total_orderingr>rgr�r~r"�
_VersionRangerrr�r�r�r�r�r�r�r�r�r�rr�ABCMetarrr�r�r�rGrBrFrMrSr�rrrr�<module>rsr���#�
����	�
�
�
�
�
�(�,����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�P
����w�(8�$�>�?���+�{�2�3�M��t�U�#���t�U�#��&.��%9�$;��
!�;�)��
!��"����4K�S�
�+�@�2�9��9��9�*	�z�	�O�c�k�k�O�dr,�
�r,�j��
�
�:�;�
�' ��' �"I�' ��' �T�,'���O�2�6a	�=�a	r