Your IP : 216.73.216.213


Current Path : /opt/alt/python311/lib/python3.11/site-packages/packaging/__pycache__/
Upload File :
Current File : //opt/alt/python311/lib/python3.11/site-packages/packaging/__pycache__/specifiers.cpython-311.pyc

�

N�Xym��V�ddlmZmZmZddlZddlZddlZddlZddlm	Z	m
Z
ddlmZm
Z
mZGd�de��ZGd�d	e
eje����ZGd
�de��ZGd�d
e��Zd�ZGd�de��Zejd��Zd�Zd�ZGd�de��ZdS)�)�absolute_import�division�print_functionN�)�string_types�with_metaclass)�Version�
LegacyVersion�parsec��eZdZdZdS)�InvalidSpecifierzH
    An invalid specifier was found, users should refer to PEP 440.
    N)�__name__�
__module__�__qualname__�__doc__���G/opt/alt/python311/lib/python3.11/site-packages/packaging/specifiers.pyr
r
s���������rr
c��eZdZejd���Zejd���Zejd���Zejd���Zej	d���Z
e
jd���Z
ejd
d���Zejd
d	���Z
dS)�
BaseSpecifierc��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__����rc��dS)zF
        Returns a hash value for this Specifier like object.
        Nrrs r�__hash__zBaseSpecifier.__hash__rrc��dS)zq
        Returns a boolean representing whether or not the two Specifier like
        objects are equal.
        Nr�r�others  r�__eq__zBaseSpecifier.__eq__$rrc��dS)zu
        Returns a boolean representing whether or not the two Specifier like
        objects are not equal.
        Nrrs  r�__ne__zBaseSpecifier.__ne__+rrc��dS)zg
        Returns whether or not pre-releases as a whole are allowed by this
        specifier.
        Nrrs r�prereleaseszBaseSpecifier.prereleases2rrc��dS)zd
        Sets whether or not pre-releases as a whole are allowed by this
        specifier.
        Nr�r�values  rr%zBaseSpecifier.prereleases9rrNc��dS)zR
        Determines if the given item is contained within this specifier.
        Nr�r�itemr%s   r�containszBaseSpecifier.contains@rrc��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�iterabler%s   r�filterzBaseSpecifier.filterFrr�N)rrr�abc�abstractmethodrrr!r#�abstractpropertyr%�setterr,r/rrrrrs�������������	�������
	�������	�������	��������������	��������
	���������rrc��eZdZiZdd�Zd�Zd�Zd�Zd�Zd�Z	d	�Z
d
�Zed���Z
ed���Zed
���Zejd���Zd�Zdd�Zdd�ZdS)�_IndividualSpecifier�Nc�6�|j�|��}|s"td�|�����|�d�����|�d�����f|_||_dS)NzInvalid specifier: '{0}'�operator�version)�_regex�searchr
�format�group�strip�_spec�_prereleases)r�specr%�matchs    r�__init__z_IndividualSpecifier.__init__Rs�����"�"�4�(�(���	L�"�#=�#D�#D�T�#J�#J�K�K�K�
�K�K�
�#�#�)�)�+�+��K�K�	�"�"�(�(�*�*�
��
�(����rc��|j�d�|j��nd}d�|jjt|��|��S)N�, prereleases={0!r}r7z<{0}({1!r}{2})>)rAr=r%�	__class__r�str�r�pres  r�__repr__z_IndividualSpecifier.__repr___s\��� �,�
"�(�(��)9�:�:�:��	�!�'�'��N�#���I�I��
�
�	
rc� �dj|j�S)Nz{0}{1})r=r@rs rrz_IndividualSpecifier.__str__ls���x���
�+�+rc�*�t|j��Sr0)�hashr@rs rrz_IndividualSpecifier.__hash__os���D�J���rc���t|t��r.	|�|��}n3#t$r
tcYSwxYwt||j��stS|j|jkSr0��
isinstancerrGr
�NotImplementedr@rs  rr!z_IndividualSpecifier.__eq__r�|���e�\�*�*�	"�
&����u�-�-����#�
&�
&�
&�%�%�%�%�
&�����E�4�>�2�2�	"�!�!��z�U�[�(�(��-�A�Ac���t|t��r.	|�|��}n3#t$r
tcYSwxYwt||j��stS|j|jkSr0rPrs  rr#z_IndividualSpecifier.__ne__}rSrTc�^�t|d�|j|����S)Nz_compare_{0})�getattrr=�
_operators)r�ops  r�
_get_operatorz"_IndividualSpecifier._get_operator�s'���t�^�2�2�4�?�2�3F�G�G�H�H�Hrc�\�t|ttf��st|��}|Sr0)rQr
r	r�rr:s  r�_coerce_versionz$_IndividualSpecifier._coerce_version�s)���'�M�7�#;�<�<�	%��G�n�n�G��rc��|jdS)Nr�r@rs rr9z_IndividualSpecifier.operator�����z�!�}�rc��|jdS)Nrr_rs rr:z_IndividualSpecifier.version�r`rc��|jSr0�rArs rr%z _IndividualSpecifier.prereleases�s��� � rc��||_dSr0rcr's  rr%z _IndividualSpecifier.prereleases����!����rc�,�|�|��Sr0�r,�rr+s  r�__contains__z!_IndividualSpecifier.__contains__�����}�}�T�"�"�"rc��|�|j}|�|��}|jr|sdS|�|j��||j��S�NF)r%r]�
is_prereleaserZr9r:r*s   rr,z_IndividualSpecifier.contains�sd�����*�K��#�#�D�)�)��
��	�k�	��5�1�t�!�!�$�-�0�0��t�|�D�D�Drc#��K�d}g}d|�|ndi}|D]Q}|�|��}|j|fi|��r,|jr|s|js|�|���Kd}|V��R|s|r|D]
}|V��dSdSdS)NFr%T)r]r,rmr%�append)rr.r%�yielded�found_prereleases�kwr:�parsed_versions        rr/z_IndividualSpecifier.filter�s����������K�,C�[�[��
N�� �	"�	"�G�!�1�1�'�:�:�N��t�}�^�2�2�r�2�2�
"�#�0�"�$�"�(,�(8�"�%�,�,�W�5�5�5�5�#�G�!�M�M�M��
�	�,�	�,�
�
���
�
�
�
�	�	�	�	�
�
r�r7Nr0)rrrrXrDrKrrr!r#rZr]�propertyr9r:r%r4rir,r/rrrr6r6NsD�������J�(�(�(�(�
�
�
�,�,�,� � � �	)�	)�	)�	)�	)�	)�I�I�I����
����X������X���!�!��X�!���"�"���"�#�#�#�E�E�E�E�&�����rr6c��eZdZdZejdezdzejejz��Zdddddd	d
�Z	d�Z
d�Zd
�Zd�Z
d�Zd�Zd�ZdS)�LegacySpecifiera�
        (?P<operator>(==|!=|<=|>=|<|>))
        \s*
        (?P<version>
            [^,;\s)]* # Since this is a "legacy" specifier, and the version
                      # string can be just about anything, we match everything
                      # except for whitespace, a semi-colon for marker support,
                      # a closing paren since versions can be enclosed in
                      # them, and a comma since it's a version separator.
        )
        �^\s*�\s*$�equal�	not_equal�less_than_equal�greater_than_equal�	less_than�greater_than)�==�!=�<=�>=�<�>c�h�t|t��stt|����}|Sr0)rQr
rHr\s  rr]zLegacySpecifier._coerce_version�s,���'�=�1�1�	2�#�C��L�L�1�1�G��rc�4�||�|��kSr0�r]�r�prospectiverBs   r�_compare_equalzLegacySpecifier._compare_equal�����d�2�2�4�8�8�8�8rc�4�||�|��kSr0r�r�s   r�_compare_not_equalz"LegacySpecifier._compare_not_equal�r�rc�4�||�|��kSr0r�r�s   r�_compare_less_than_equalz(LegacySpecifier._compare_less_than_equal�r�rc�4�||�|��kSr0r�r�s   r�_compare_greater_than_equalz+LegacySpecifier._compare_greater_than_equalr�rc�4�||�|��kSr0r�r�s   r�_compare_less_thanz"LegacySpecifier._compare_less_than����T�1�1�$�7�7�7�7rc�4�||�|��kSr0r�r�s   r�_compare_greater_thanz%LegacySpecifier._compare_greater_thanr�rN)rrr�
_regex_str�re�compile�VERBOSE�
IGNORECASEr;rXr]r�r�r�r�r�r�rrrrwrw�s�������
	���R�Z��*��w�&��
�R�]�(B�D�D�F����"�
�
�
��J����
9�9�9�9�9�9�9�9�9�9�9�9�8�8�8�8�8�8�8�8rrwc�F��tj����fd���}|S)Nc�L��t|t��sdS�|||��Srl)rQr	)rr�rB�fns   �r�wrappedz)_require_version_compare.<locals>.wrappeds.����+�w�/�/�	��5��r�$��T�*�*�*r)�	functools�wraps)r�r�s` r�_require_version_comparer�
s8����_�R���+�+�+�+���+��Nrc	�F�eZdZdZejdezdzejejz��Zdddddd	d
dd�Z	e
d
���Ze
d���Ze
d���Z
e
d���Ze
d���Ze
d���Ze
d���Zd�Zed���Zejd���ZdS)�	Specifiera
        (?P<operator>(~=|==|!=|<=|>=|<|>|===))
        (?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]*    # We just match everything, except for whitespace
                          # since we are only testing for strict identity.
            )
            |
            (?:
                # 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
                (?:                   # pre release
                    [-_\.]?
                    (a|b|c|rc|alpha|beta|pre|preview)
                    [-_\.]?
                    [0-9]*
                )?
                (?:                   # post release
                    (?:-[0-9]+)|(?:[-_\.]?(post|rev|r)[-_\.]?[0-9]*)
                )?

                # You cannot use a wild card and a dev or local version
                # together so group them with a | and make them optional.
                (?:
                    (?:[-_\.]?dev[-_\.]?[0-9]*)?         # dev release
                    (?:\+[a-z0-9]+(?:[-_\.][a-z0-9]+)*)? # local
                    |
                    \.\*  # Wild card syntax of .*
                )?
            )
            |
            (?:
                # 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
                    [-_\.]?
                    (a|b|c|rc|alpha|beta|pre|preview)
                    [-_\.]?
                    [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
                    [-_\.]?
                    (a|b|c|rc|alpha|beta|pre|preview)
                    [-_\.]?
                    [0-9]*
                )?
                (?:                                   # post release
                    (?:-[0-9]+)|(?:[-_\.]?(post|rev|r)[-_\.]?[0-9]*)
                )?
                (?:[-_\.]?dev[-_\.]?[0-9]*)?          # dev release
            )
        )
        rxry�
compatiblerzr{r|r}r~r�	arbitrary)�~=r�r�r�r�r�r��===c
��d�ttjd�t	|������dd���}|dz
}|�d��||��o|�d��||��S)N�.c�Z�|�d��o|�d��S)N�post�dev)�
startswith��xs r�<lambda>z/Specifier._compare_compatible.<locals>.<lambda>�s.��1�<�<��#7�#7�7� 3� �|�|�E�2�2�=3�r����.*r�r�)�join�list�	itertools�	takewhile�_version_splitrZ)rr�rB�prefixs    r�_compare_compatiblezSpecifier._compare_compatible�s��������#�4�4�"�4�(�(���
�
��r�c�

�
�
��	�$���(��"�"�4�(�(��d�;�;�>�(��"�"�4�(�(��f�=�=�	?rc�p�|�d��rrt|j��}t|dd���}tt	|����}|dt|���}t
||��\}}n*t|��}|jst|j��}||kS)Nr����)�endswithr	�publicr�rH�len�_pad_version�localr�s   rr�zSpecifier._compare_equal�s����=�=����	:�!�+�"4�5�5�K�"�$�s��s�)�,�,�D�
)��[�)9�)9�:�:�K�
&�j�s�4�y�y�j�1�K�!-�T�;� ?� ?��D�+�+��4�=�=�D�
�:�
:�%�k�&8�9�9���d�"�"rc�0�|�||��Sr0)r�r�s   rr�zSpecifier._compare_not_equal�s���&�&�{�D�9�9�9�9rc�(�|t|��kSr0�r	r�s   rr�z"Specifier._compare_less_than_equal�����g�d�m�m�+�+rc�(�|t|��kSr0r�r�s   rr�z%Specifier._compare_greater_than_equal�r�rc��t|��}||ksdS|js3|jr,t|j��t|j��krdSdS�NFT)r	rm�base_versionr�s   rr�zSpecifier._compare_less_than�se���t�}�}��
�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   rr�zSpecifier._compare_greater_than�s����t�}�}��
�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|�����kSr0)rH�lowerr�s   r�_compare_arbitraryzSpecifier._compare_arbitrarys1���;���%�%�'�'�3�t�9�9�?�?�+<�+<�<�<rc��|j�|jS|j\}}|dvr;|dkr|�d��r
|dd�}t|��jrdSdS)N)r�r�r�r�r�r�r�r�TF)rAr@r�rrm)rr9r:s   rr%zSpecifier.prereleasessz����(��$�$�
!�J���'��6�6�6��4���G�$4�$4�T�$:�$:��!�#�2�#�,���W�~�~�+�
��t��urc��||_dSr0rcr's  rr%zSpecifier.prereleasesrerN)rrrr�r�r�r�r�r;rXr�r�r�r�r�r�r�r�r�rur%r4rrrr�r�s�������[	��~�R�Z��*��w�&��
�R�]�(B�D�D�F�����"�
�
��	�	�J��?�?���?�4� #� #��� #�D�:�:���:��,�,���,��,�,���,�������0������<=�=�=�����X��.��"�"���"�"�"rr�z^([0-9]+)((?:a|b|c|rc)[0-9]+)$c���g}|�d��D][}t�|��}|r(|�|������F|�|���\|S)Nr�)�split�
_prefix_regexr<�extend�groupsro)r:�resultr+rCs    rr�r�'st��
�F��
�
�c�"�"� � ���$�$�T�*�*���	 ��M�M�%�,�,�.�.�)�)�)�)��M�M�$������Mrc�R�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�*�|���Sr0��isdigitr�s rr�z_pad_version.<locals>.<lambda>6s�������rc�*�|���Sr0r�r�s rr�z_pad_version.<locals>.<lambda>7s��!�)�)�+�+�rrr�0)ror�r�r�r��insert�max�chain)�left�right�
left_split�right_splits    rr�r�2s��� �"��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�0�0����u�S��Q��0�0�1�1�2�3�3�3����	�	���A�s�;�q�>�*�*�S��A��-?�-?�?�@�@�@�������	�	���A�s�:�a�=�)�)�C��A��,?�,?�?�@�@�@����	
�Y�_�j�
)�*�*��Y�_�k�
*�+�+��rc��eZdZdd�Zd�Zd�Zd�Zd�Zd�Zd	�Z	d
�Z
d�Zed���Z
e
jd
���Z
d�Zdd�Zdd�ZdS)�SpecifierSetr7Nc�J�d�|�d��D��}t��}|D]W}	|�t|�����&#t$r%|�t|����Y�TwxYwt
|��|_||_dS)Nc�^�g|]*}|����|�����+Sr)r?��.0�ss  r�
<listcomp>z)SpecifierSet.__init__.<locals>.<listcomp>Rs-��L�L�L�A�!�'�'�)�)�L�a�g�g�i�i�L�L�Lr�,)	r��set�addr�r
rw�	frozenset�_specsrA)r�
specifiersr%�parsed�	specifiers     rrDzSpecifierSet.__init__Os���M�L��)9�)9�#�)>�)>�L�L�L�
�����#�	7�	7�I�
7��
�
�9�Y�/�/�0�0�0�0��#�
7�
7�
7��
�
�?�9�5�5�6�6�6�6�6�
7���� ��'�'���(����s�"A�,B�Bc��|j�d�|j��nd}d�t|��|��S)NrFr7z<SpecifierSet({0!r}{1})>)rAr=r%rHrIs  rrKzSpecifierSet.__repr__dsL��� �,�
"�(�(��)9�:�:�:��	�*�0�0��T���C�@�@�@rc�d�d�td�|jD������S)Nr�c3�4K�|]}t|��V��dSr0)rHr�s  r�	<genexpr>z'SpecifierSet.__str__.<locals>.<genexpr>ns(����;�;�!�s�1�v�v�;�;�;�;�;�;r)r��sortedr�rs rrzSpecifierSet.__str__ms-���x�x��;�;�t�{�;�;�;�;�;�<�<�<rc�*�t|j��Sr0)rNr�rs rrzSpecifierSet.__hash__p����D�K� � � rc��t|t��rt|��}nt|t��stSt��}t	|j|jz��|_|j�|j�
|j|_nG|j�|j�
|j|_n,|j|jkr
|j|_ntd���|S)NzFCannot combine SpecifierSets with True and False prerelease overrides.)rQrr�rRr�r�rA�
ValueError)rr r�s   r�__and__zSpecifierSet.__and__ss����e�\�*�*�	"� ��'�'�E�E��E�<�0�0�	"�!�!� �N�N�	�$�T�[�5�<�%?�@�@�	����$��);�)G�%*�%7�I�"�"�
�
�
*�u�/A�/I�%)�%6�I�"�"�
�
�%�"4�
4�
4�%)�%6�I�"�"�����
�
�rc��t|t��rt|��}nNt|t��rtt	|����}nt|t��st
S|j|jkSr0�rQrr�r6rHrRr�rs  rr!zSpecifierSet.__eq__��r���e�\�*�*�	"� ��'�'�E�E�
��3�
4�
4�	"� ��U���,�,�E�E��E�<�0�0�	"�!�!��{�e�l�*�*rc��t|t��rt|��}nNt|t��rtt	|����}nt|t��st
S|j|jkSr0rrs  rr#zSpecifierSet.__ne__�rrc�*�t|j��Sr0)r�r�rs r�__len__zSpecifierSet.__len__�s���4�;���rc�*�t|j��Sr0)�iterr�rs r�__iter__zSpecifierSet.__iter__�r�rc�l�|j�|jS|jsdStd�|jD����S)Nc3�$K�|]}|jV��dSr0�r%r�s  rr�z+SpecifierSet.prereleases.<locals>.<genexpr>�s$����6�6�Q�1�=�6�6�6�6�6�6r)rAr��anyrs rr%zSpecifierSet.prereleases�sH����(��$�$�
�{�	��4��6�6�$�+�6�6�6�6�6�6rc��||_dSr0rcr's  rr%zSpecifierSet.prereleases�rerc�,�|�|��Sr0rgrhs  rrizSpecifierSet.__contains__�rjrc�����t�ttf��st������|j��s	�jrdSt
��fd�|jD����S)NFc3�F�K�|]}|������V��dS)r
Nrg)r�r�r+r%s  ��rr�z(SpecifierSet.contains.<locals>.<genexpr>�sG�����
�
��
�J�J�t��J�5�5�
�
�
�
�
�
r)rQr
r	rr%rm�allr�r*s ``rr,zSpecifierSet.contains�s������$��� 8�9�9�	���;�;�D�
���*�K��	�t�1�	��5��
�
�
�
�
��[�
�
�
�
�
�	
rc��|�|j}|jr0|jD]&}|�|t|�����}�'|Sg}g}|D]|}t	|t
tf��st|��}n|}t	|t
��r�F|jr|s|s|�	|���g|�	|���}|s|r|�|S|S)Nr
)
r%r�r/�boolrQr
r	rrmro)rr.r%rB�filteredrqr+rss        rr/zSpecifierSet.filter�s�����*�K�
�;�#	���
P�
P���;�;�x�T�+�=N�=N�;�O�O����O�
�H� "�� �
*�
*��!�$���(@�A�A�*�%*�4�[�[�N�N�%)�N��n�m�<�<���"�/�*��*�#�7�)�0�0��6�6�6���O�O�D�)�)�)�)��
)� 1�
)�k�6I�(�(��Orrtr0)rrrrDrKrrr�r!r#rrrur%r4rir,r/rrrr�r�Ms������(�(�(�(�*A�A�A�=�=�=�!�!�!����.+�+�+�+�+�+� � � �!�!�!��7�7��X�7� ��"�"���"�#�#�#�
�
�
�
�:-�-�-�-�-�-rr�)�
__future__rrrr1r�r�r��_compatrrr:r	r
rr�r
�ABCMeta�objectrr6rwr�r�r�r�r�r�r�rrr�<module>rs���A�@�@�@�@�@�@�@�@�@�
�
�
�
���������	�	�	�	�1�1�1�1�1�1�1�1�2�2�2�2�2�2�2�2�2�2������z����6�6�6�6�6�N�N�3�;��7�7�6�6�6�rE�E�E�E�E�=�E�E�E�P18�18�18�18�18�*�18�18�18�h���N"�N"�N"�N"�N"�$�N"�N"�N"�b��
�<�=�=�
�������6y�y�y�y�y�=�y�y�y�y�yr