HEX
Server: LiteSpeed
System: Linux br-asc-web1845.main-hosting.eu 5.14.0-611.42.1.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Tue Mar 24 05:30:20 EDT 2026 x86_64
User: u790421558 (790421558)
PHP: 8.2.30
Disabled: system, exec, shell_exec, passthru, mysql_list_dbs, ini_alter, dl, symlink, link, chgrp, leak, popen, apache_child_terminate, virtual, mb_send_mail
Upload Files
File: //opt/alt/python311/lib/python3.11/site-packages/packaging/__pycache__/specifiers.cpython-311.pyc
�

]�Zg����l�dZddlmZddlZddlZddlZddlmZmZm	Z	m
Z
mZddlm
Z
ddlmZeeefZe
de�	��ZeeegefZd%d�ZGd�de��ZGd�dej���ZGd�de��Zejd��Zd&d�Zd'd�Zd(d�Zd)d"�Z Gd#�d$e��Z!dS)*z�
.. testsetup::

    from packaging.specifiers import Specifier, SpecifierSet, InvalidSpecifier
    from packaging.version import Version
�)�annotationsN)�Callable�Iterable�Iterator�TypeVar�Union�)�canonicalize_version)�Version�UnparsedVersionVar)�bound�version�UnparsedVersion�returnrc�N�t|t��st|��}|S�N)�
isinstancer)rs �G/opt/alt/python311/lib/python3.11/site-packages/packaging/specifiers.py�_coerce_versionrs&���g�w�'�'�#��'�"�"���N�c��eZdZdZdS)�InvalidSpecifiera
    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)�__name__�
__module__�__qualname__�__doc__�rrrr s���������rrc��eZdZejdd���Zejdd���Zejdd	���Zeejdd�����Z	e	j
dd���Z	ejddd���Zej	ddd���ZdS)�
BaseSpecifierr�strc��dS)z�
        Returns the str representation of this Specifier-like object. This
        should be representative of the Specifier itself.
        Nr��selfs r�__str__zBaseSpecifier.__str__-����r�intc��dS)zF
        Returns a hash value for this Specifier-like object.
        Nrr"s r�__hash__zBaseSpecifier.__hash__4r%r�other�object�boolc��dS)z�
        Returns a boolean representing whether or not the two Specifier-like
        objects are equal.

        :param other: The other object to check against.
        Nr�r#r)s  r�__eq__zBaseSpecifier.__eq__:r%r�bool | Nonec��dS)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.
        Nrr"s r�prereleaseszBaseSpecifier.prereleasesCr%r�value�Nonec��dS)zQSetter for :attr:`prereleases`.

        :param value: The value to set.
        Nr�r#r2s  rr1zBaseSpecifier.prereleasesLr%rN�itemr1c��dS)zR
        Determines if the given item is contained within this specifier.
        Nr)r#r6r1s   r�containszBaseSpecifier.containsSr%r�iterable�Iterable[UnparsedVersionVar]�Iterator[UnparsedVersionVar]c��dS)z�
        Takes an iterable of items and filters them so that only items which
        are contained within this specifier are allowed in it.
        Nr)r#r9r1s   r�filterzBaseSpecifier.filterYr%r�rr �rr&�r)r*rr+�rr/�r2r+rr3r)r6r r1r/rr+�r9r:r1r/rr;)
rrr�abc�abstractmethodr$r(r.�propertyr1�setterr8r=rrrrr,s%��������������	��������
	�����������������X����������	���������
	��QU���������rr)�	metaclassc	��eZdZdZdZdZejdezezdzejej	z��Z
dddd	d
ddd
d�Zd>d?d�Ze
d@d���ZejdAd���Ze
dBd���Ze
dBd���ZdBd�ZdBd�Ze
dCd!���ZdDd#�ZdEd&�ZdFd)�ZdGd,�ZdGd-�ZdGd.�ZdGd/�ZdGd0�ZdHd2�ZdHd3�ZdGd4�ZdId7�Z dJdKd9�Z!	dJdLd=�Z"dS)M�	Specifiera?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).
    z8
        (?P<operator>(~=|==|!=|<=|>=|<|>|===))
        a�
        (?P<version>
            (?:
                # 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 .*
                    |
                    (?:                                  # 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
                    (?:\+[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.
                (?<!==|!=|~=)         # We have special cases for these
                                      # operators so we want to make sure they
                                      # don't match here.

                \s*
                v?
                (?:[0-9]+!)?          # epoch
                [0-9]+(?:\.[0-9]+)*   # release
                (?:                   # 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
            )
        )
        z^\s*z\s*$�
compatible�equal�	not_equal�less_than_equal�greater_than_equal�	less_than�greater_than�	arbitrary)�~=�==z!=�<=�>=�<�>�===�N�specr r1r/rr3c��|j�|��}|std|�����|�d�����|�d�����f|_||_dS)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: �operatorrN)�_regex�searchr�group�strip�_spec�_prereleases)r#r[r1�matchs    r�__init__zSpecifier.__init__�s�����"�"�4�(�(���	C�"�#A��#A�#A�B�B�B�
�K�K�
�#�#�)�)�+�+��K�K�	�"�"�(�(�*�*�'
��
�(����rr+c��|j�|jS|j\}}|dvr;|dkr|�d��r
|dd�}t|��jrdSdS)N)rTrVrUrSrYrXrWrT�.*���TF)rcrb�endswithr�
is_prerelease)r#r]rs   rr1zSpecifier.prereleases�s|����(��$�$�
!�J���'��@�@�@��4���G�$4�$4�T�$:�$:��!�#�2�#�,���w���-�
��t��urr2c��||_dSr�rcr5s  rr1zSpecifier.prereleases���!����rc��|jdS)z`The operator of this specifier.

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

        >>> Specifier("==1.2.3").version
        '1.2.3'
        r	ror"s rrzSpecifier.versionrprc�l�|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)>
        N�, prereleases=rZrW�(�)>)rcr1�	__class__rr �r#�pres  r�__repr__zSpecifier.__repr__&sT��� �,�
2�T�-�1�1�1��	�B�4�>�*�A�A�S��Y�Y�A�#�A�A�A�Arc� �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{}{})�formatrbr"s rr$zSpecifier.__str__8s���v�}�d�j�)�)r�tuple[str, str]c�v�t|jd|jddk���}|jd|fS)Nr	rrS��strip_trailing_zero)r
rb)r#�canonical_versions  r�_canonical_speczSpecifier._canonical_specBsB��0��J�q�M�!%��A��$�!6�
�
�
���z�!�}�/�/�/rr&c�*�t|j��Sr)�hashr�r"s rr(zSpecifier.__hash__Js���D�(�)�)�)rr)r*c��t|t��r;	|�t|����}n3#t$r
tcYSwxYwt||j��stS|j|jkS)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
        )rr rvr�NotImplementedr�r-s  rr.zSpecifier.__eq__Ms���&�e�S�!�!�	"�
&����s�5�z�z�2�2����#�
&�
&�
&�%�%�%�%�
&�����E�4�>�2�2�	"�!�!��#�u�'<�<�<s�":�A�
A�op�CallableOperatorc�B�t|d|j|����}|S)N�	_compare_)�getattr�
_operators)r#r��operator_callables   r�
_get_operatorzSpecifier._get_operatorjs/��.5��3�d�o�b�1�3�3�/
�/
��!� r�prospectiverc
��tttjtt|������dd���}|dz
}|�d��||��o|�d��||��S)N���rgrVrT)�
_version_join�list�	itertools�	takewhile�_is_not_suffix�_version_splitr�)r#r�r[�prefixs    r�_compare_compatiblezSpecifier._compare_compatibleps������$�^�^�D�5I�5I�J�J�K�K�C�R�C�P�
�
��
	�$���'�t�!�!�$�'�'��T�:�:�
�?W�t�?Q�?Q�RV�?W�?W���@
�@
�	
rc��|�d��r}t|jd���}t|dd�d���}t|��}t|��}t	||��\}}|dt|���}	|	|kSt
|��}
|
jst
|j��}||
kS)NrgFr~rh)rir
�publicr��_pad_version�lenr�local)r#r�r[�normalized_prospective�normalized_spec�
split_spec�split_prospective�padded_prospective�_�shortened_prospective�spec_versions           r�_compare_equalzSpecifier._compare_equal�s����=�=����$	/�%9��"��&�&�&�"�3�4����9�RW�X�X�X�O�(��8�8�J�
!/�/E� F� F��%1�1B�J�$O�$O�!���
%7�7H��Z���7H�$I�!�(�J�6�6�#�4�=�=�L�
 �%�
:�%�k�&8�9�9���,�.�.rc�0�|�||��Sr)r��r#r�r[s   r�_compare_not_equalzSpecifier._compare_not_equal�s���&�&�{�D�9�9�9�9rc�L�t|j��t|��kSr�rr�r�s   r�_compare_less_than_equalz"Specifier._compare_less_than_equal�� ���{�)�*�*�g�d�m�m�;�;rc�L�t|j��t|��kSrr�r�s   r�_compare_greater_than_equalz%Specifier._compare_greater_than_equal�r�r�spec_strc��t|��}||ksdS|js3|jr,t|j��t|j��krdSdS�NFT)rrj�base_version�r#r�r�r[s    r�_compare_less_thanzSpecifier._compare_less_than�sg���x� � ��
�T�!�!��5��!�	�k�&?�	��{�/�0�0�G�D�<M�4N�4N�N�N��u�
�trc��t|��}||ksdS|js3|jr,t|j��t|j��krdS|j�,t|j��t|j��krdSdSr�)r�is_postreleaser�r�r�s    r�_compare_greater_thanzSpecifier._compare_greater_than�s����x� � ��
�T�!�!��5��"�	�{�'A�	��{�/�0�0�G�D�<M�4N�4N�N�N��u���(��{�/�0�0�G�D�<M�4N�4N�N�N��u�
�trc��t|�����t|�����kSr)r �lowerr�s   r�_compare_arbitraryzSpecifier._compare_arbitrary�s1���;���%�%�'�'�3�t�9�9�?�?�+<�+<�<�<rr6�
str | Versionc�,�|�|��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")
        False
        >>> "1.3.0a1" in Specifier(">=1.2.3", prereleases=True)
        True
        �r8�r#r6s  r�__contains__zSpecifier.__contains__����&�}�}�T�"�"�"rrc��|�|j}t|��}|jr|sdS|�|j��}|||j��S)alReturn 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 uses :attr:`prereleases` to determine
            whether or not prereleases are allowed.

        >>> 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")
        False
        >>> Specifier(">=1.2.3", prereleases=True).contains("1.3.0a1")
        True
        >>> Specifier(">=1.2.3").contains("1.3.0a1", prereleases=True)
        True
        NF)r1rrjr�r]r)r#r6r1�normalized_itemr�s     rr8zSpecifier.contains	sg��4���*�K�*�$�/�/��
�(�	��	��5�/3�.@�.@���.O�.O�� � ��$�,�?�?�?rr9r:r;c#��K�d}g}d|�|ndi}|D]K}t|��}|j|fi|��r,|jr|s|js|�|���Ed}|V��L|s|r|D]
}|V��dSdSdS)aOFilter 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 be intelligently decide whether to allow
            prereleases or not (based on the :attr:`prereleases` attribute, and
            whether the only versions matching are prereleases).

        This method is smarter than just ``filter(Specifier().contains, [...])``
        because it implements the rule from :pep:`440` that a prerelease item
        SHOULD be accepted if no other versions match the given specifier.

        >>> 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']
        Fr1NT)rr8rjr1�append)r#r9r1�yielded�found_prereleases�kwr�parsed_versions        rr=zSpecifier.filter5s�����<�����K�,C�[�[��
N�� �	"�	"�G�,�W�5�5�N��t�}�^�2�2�r�2�2�
"�"�/�"��"�#'�#3�"�&�,�,�W�5�5�5�5�#�G�!�M�M�M��
�	�,�	�,�
�
���
�
�
�
�	�	�	�	�
�
r�rZN)r[r r1r/rr3)rr+rBr>)rr|r?r@)r�r rr�)r�rr[r rr+)r�rr�r rr+)r6r�rr+r)r6rr1r/rr+rC)#rrrr�_operator_regex_str�_version_regex_str�re�compile�VERBOSE�
IGNORECASEr^r�rerFr1rGr]rryr$r�r(r.r�r�r�r�r�r�r�r�r�r�r8r=rrrrJrJcs�����������\��|�R�Z��%�%�(:�:�W�D�
�
�R�]�"���F�����"�
�
��	�	�J�(�(�(�(�(�4�����X��.��"�"�"���"������X�������X��B�B�B�B�$*�*�*�*��0�0�0��X�0�*�*�*�*�=�=�=�=�:!�!�!�!�
�
�
�
�(&/�&/�&/�&/�P:�:�:�:�<�<�<�<�<�<�<�<�����0����<=�=�=�=�#�#�#�#�**@�*@�*@�*@�*@�ZRV�;�;�;�;�;�;�;rrJz^([0-9]+)((?:a|b|c|rc)[0-9]+)$r �	list[str]c�L�g}|�d��\}}}|�|pd��|�d��D][}t�|��}|r(|�|������F|�|���\|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)r�result�epochr��restr6rds       rr�r�vs����F��'�'��,�,�N�E�1�d�
�M�M�%�,�3�����
�
�3��� � ���$�$�T�*�*���	 ��M�M�%�,�,�.�.�)�)�)�)��M�M�$������Mr�
componentsc�>�|^}}|�dd�|����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)r�r�r�s   rr�r��s+���L�E�D��&�&�c�h�h�t�n�n�&�&�&r�segmentr+c�<��t�fd�dD����S)Nc3�B�K�|]}��|��V��dSr)�
startswith)�.0r�r�s  �r�	<genexpr>z!_is_not_suffix.<locals>.<genexpr>�sB�������'-����6�"�"������r)�dev�a�b�rc�post)�any)r�s`rr�r��s@��������1P�������r�left�right�tuple[list[str], list[str]]c��gg}}|�ttjd�|������|�ttjd�|������|�|t	|d��d���|�|t	|d��d���|�ddgt
dt	|d��t	|d��z
��z��|�ddgt
dt	|d��t	|d��z
��z��ttj�|����ttj�|����fS)Nc�*�|���Sr��isdigit��xs r�<lambda>z_pad_version.<locals>.<lambda>�s�������rc�*�|���Srr�r�s rr�z_pad_version.<locals>.<lambda>�s��!�)�)�+�+�rrr	r�)	r�r�r�r�r��insert�max�chain�
from_iterable)r�r��
left_split�right_splits    rr�r��s��� �"��J����d�9�.�/D�/D�d�K�K�L�L�M�M�M����t�I�/�0E�0E�u�M�M�N�N�O�O�O����d�3�z�!�}�-�-�/�/�0�1�1�1����u�S��Q��0�0�2�2�3�4�4�4����a�#���Q��K��N�(;�(;�c�*�Q�-�>P�>P�(P�!Q�!Q�Q�R�R�R����q�3�%�#�a��Z��]�);�);�c�+�a�.�>Q�>Q�)Q�"R�"R�R�S�S�S�	
�Y�_�
*�
*�:�
6�
6�7�7��Y�_�
*�
*�;�
7�
7�8�8��rc��eZdZdZ		d%d&d
�Zed'd���Zejd(d���Zd)d�Zd)d�Z	d*d�Z
d+d�Zd,d�Zd*d�Z
d-d�Zd.d�Z		d/d0d �Z	d1d2d$�ZdS)3�SpecifierSetz�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.
    rZN�
specifiers�str | Iterable[Specifier]r1r/rr3c���t|t��rGd�|�d��D��}tt	t
|����|_nt|��|_||_dS)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.
        c�^�g|]*}|����|�����+Sr)ra�r��ss  r�
<listcomp>z)SpecifierSet.__init__.<locals>.<listcomp>�s-��V�V�V�a�A�G�G�I�I�V����	�	�V�V�Vr�,N)rr r��	frozenset�maprJ�_specsrc)r#rr1�split_specifierss    rrezSpecifierSet.__init__�sz��,�j�#�&�&�
	0� W�V�:�3C�3C�C�3H�3H�V�V�V��$�C�	�3C�$D�$D�E�E�D�K�K�$�J�/�/�D�K�(����rc�l�|j�|jS|jsdStd�|jD����S)Nc3�$K�|]}|jV��dSr�r1rs  rr�z+SpecifierSet.prereleases.<locals>.<genexpr>�s$����6�6�Q�1�=�6�6�6�6�6�6r)rcr
r�r"s rr1zSpecifierSet.prereleases�sH����(��$�$�
�{�	��4��6�6�$�+�6�6�6�6�6�6rr2r+c��||_dSrrlr5s  rr1zSpecifierSet.prereleases�rmrr c�R�|j�
d|j��nd}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)>
        NrsrZz<SpecifierSet(ru)rcr1r rws  rryzSpecifierSet.__repr__�sF��� �,�
2�T�-�1�1�1��	�5��D�	�	�4�S�4�4�4�4rc�d�d�td�|jD������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'
        rc3�4K�|]}t|��V��dSr)r rs  rr�z'SpecifierSet.__str__.<locals>.<genexpr>s(����;�;�!�s�1�v�v�;�;�;�;�;�;r)r��sortedr
r"s rr$zSpecifierSet.__str__	s/���x�x��;�;�t�{�;�;�;�;�;�<�<�<rr&c�*�t|j��Sr)r�r
r"s rr(zSpecifierSet.__hash__s���D�K� � � rr)�SpecifierSet | strc��t|t��rt|��}nt|t��stSt��}t	|j|jz��|_|j�|j�
|j|_nG|j�|j�
|j|_n,|j|jkr
|j|_ntd���|S)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')>
        NzFCannot combine SpecifierSets with True and False prerelease overrides.)rr r�r�rr
rc�
ValueError)r#r)�	specifiers   r�__and__zSpecifierSet.__and__s����e�S�!�!�	"� ��'�'�E�E��E�<�0�0�	"�!�!� �N�N�	�$�T�[�5�<�%?�@�@�	����$��);�)G�%*�%7�I�"�"�
�
�
*�u�/A�/I�%)�%6�I�"�"�
�
�%�"4�
4�
4�%)�%6�I�"�"�����
�
�rr*c���t|ttf��rtt|����}nt|t��stS|j|jkS)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
        )rr rJr�r�r
r-s  rr.zSpecifierSet.__eq__9sW��&�e�c�9�-�.�.�	"� ��U���,�,�E�E��E�<�0�0�	"�!�!��{�e�l�*�*rc�*�t|j��S)z7Returns the number of specifiers in this specifier set.)r�r
r"s r�__len__zSpecifierSet.__len__Ss���4�;���r�Iterator[Specifier]c�*�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
r"s r�__iter__zSpecifierSet.__iter__Ws���D�K� � � rr6rc�,�|�|��S)arReturn 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")
        False
        >>> "1.3.0a1" in SpecifierSet(">=1.0.0,!=1.0.1", prereleases=True)
        True
        r�r�s  rr�zSpecifierSet.__contains__ar�r�	installedc�����t�t��st������|j��s	�jrdS|r�jrt�j���t��fd�|jD����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 uses :attr:`prereleases` to determine
            whether or not prereleases are allowed.

        >>> 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")
        False
        >>> SpecifierSet(">=1.0.0,!=1.0.1", prereleases=True).contains("1.3.0a1")
        True
        >>> SpecifierSet(">=1.0.0,!=1.0.1").contains("1.3.0a1", prereleases=True)
        True
        NFc3�F�K�|]}|������V��dS)rNr�)r�rr6r1s  ��rr�z(SpecifierSet.contains.<locals>.<genexpr>�s3�����R�R��1�:�:�d��:�<�<�R�R�R�R�R�Rr)rrr1rjr��allr
)r#r6r1r"s `` rr8zSpecifierSet.containsvs�����<�$��(�(�	!��4�=�=�D�
���*�K��	�t�1�	��5��	.��+�	.��4�,�-�-�D��R�R�R�R�R�d�k�R�R�R�R�R�Rrr9r:r;c��|�|j}|jr=|jD]&}|�|t|�����}�'t	|��Sg}g}|D]G}t|��}|jr|s|s|�|���2|�|���H|s|r|�t	|��St	|��S)a.Filter items in the given iterable, that match the specifiers in this set.

        :param iterable:
            An iterable that can contain version strings and :class:`Version` instances.
            The items in the iterable will be filtered according to the specifier.
        :param prereleases:
            Whether or not to allow prereleases in the returned iterator. If set to
            ``None`` (the default), it will be intelligently decide whether to allow
            prereleases or not (based on the :attr:`prereleases` attribute, and
            whether the only versions matching are prereleases).

        This method is smarter than just ``filter(SpecifierSet(...).contains, [...])``
        because it implements the rule from :pep:`440` that a prerelease item
        SHOULD be accepted if no other versions match the given specifier.

        >>> 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"]))
        []
        >>> 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']

        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']
        Nr)r1r
r=r+rrrjr�)r#r9r1r[�filteredr�r6r�s        rr=zSpecifierSet.filter�s���X���*�K�
�;�	"���
P�
P���;�;�x�T�+�=N�=N�;�O�O�����>�>�!�
24�H�:<�� �	
*�	
*��!0��!6�!6��"�/�*��*�#�7�)�0�0��6�6�6���O�O�D�)�)�)�)��
/� 1�
/�k�6I��-�.�.�.���>�>�!rr�)rrr1r/rr3rArBr>r?)r)rrr�r@)rr)r6rrr+)NN)r6rr1r/r"r/rr+rrC)rrrrrerFr1rGryr$r(rr.rr r�r8r=rrrr�r��ss��������13�#'�$(�$(�$(�$(�$(�L�7�7�7��X�7� ��"�"�"���"�5�5�5�5�*=�=�=�=�!�!�!�!�����@+�+�+�+�4 � � � �!�!�!�!�#�#�#�#�0$(�!%�	7S�7S�7S�7S�7S�tRV�M"�M"�M"�M"�M"�M"�M"rr�)rrrr)rr rr�)r�r�rr )r�r rr+)r�r�r�r�rr�)"r�
__future__rrDr�r��typingrrrrr�utilsr
rrr rrr+r�rrr�ABCMetarrJr�r�r�r�r�r�r�rrr�<module>r,s����#�"�"�"�"�"�
�
�
�
�����	�	�	�	�?�?�?�?�?�?�?�?�?�?�?�?�?�?�'�'�'�'�'�'�����������%���W�1��I�I�I���W�c�N�D�0�1������	�	�	�	�	�z�	�	�	�4�4�4�4�4�c�k�4�4�4�4�nM�M�M�M�M�
�M�M�M�`��
�<�=�=�
�����,'�'�'�'���������*J"�J"�J"�J"�J"�=�J"�J"�J"�J"�J"r