Current File : //usr/lib/python3/dist-packages/packaging/__pycache__/requirements.cpython-312.pyc
�

R"fu���ddlmZmZmZmZddlmZddlm	Z	ddl
mZmZddl
mZddlmZGd�d	e�ZGd
�d�Zy)
�)�Any�Iterator�Optional�Set�)�parse_requirement)�ParserSyntaxError)�Marker�_normalize_extra_values)�SpecifierSet)�canonicalize_namec��eZdZdZy)�InvalidRequirementzJ
    An invalid requirement was found, users should refer to PEP 508.
    N)�__name__�
__module__�__qualname__�__doc__���8/usr/lib/python3/dist-packages/packaging/requirements.pyrrs��rrc�j�eZdZdZdeddfd�Zdedeefd�Zdefd�Zdefd	�Z	de
fd
�Zdede
fd�Zy)
�Requirementz�Parse a requirement.

    Parse a given requirement string into its parts, such as name, specifier,
    URL, and extras. Raises InvalidRequirement on a badly-formed requirement
    string.
    �requirement_string�returnNc���	t|�}|j|_|j
xsd|_t
|jxsg�|_t|j�|_	d|_
|j�Ctjt�|_
t|j�|j_yy#t$r}tt|��|�d}~wwxYw�N)�_parse_requirementr	r�str�name�url�set�extrasr�	specifier�markerr
�__new__r�_markers)�selfr�parsed�es    r�__init__zRequirement.__init__!s���	4�'�(:�;�F� ����	�"(�*�*�"4���� #�F�M�M�$7�R� 8���'3�F�4D�4D�'E���(,����=�=�$� �.�.��0�D�K�#:�6�=�=�#I�D�K�K� �%��!�	4�$�S��V�,�!�3��	4�s�C�	C%�C � C%rc#�`K�|��|jr,djt|j��}d|�d���|jrt	|j���|j
r!d|j
����|jrd��|jrd|j����yy�w)N�,�[�]z@ � z; )r"�join�sortedr#rr r$)r'r�formatted_extrass   r�_iter_partszRequirement._iter_parts0s������
��;�;�"�x�x��t�{�{�(;�<���&�'�q�)�)��>�>��d�n�n�%�%��8�8��t�x�x�j�/�!��{�{��	��;�;��t�{�{�m�$�$��s�B,B.c�V�dj|j|j��S)N�)r0r3r�r's r�__str__zRequirement.__str__Bs ���w�w�t�'�'��	�	�2�3�3rc��d|�d�S)Nz<Requirement('z')>rr6s r�__repr__zRequirement.__repr__Es����v�S�)�)rc��t|jjg|jt	|j
�����Sr)�hash�	__class__rr3r
rr6s r�__hash__zRequirement.__hash__Hs>������'�'�
��!�!�"3�D�I�I�">�?�
�
�	
r�otherc�\�t|t�stSt|j�t|j�k(xrj|j
|j
k(xrO|j|jk(xr4|j|jk(xr|j|jk(Sr)	�
isinstancer�NotImplementedr
rr"r#r r$)r'r>s  r�__eq__zRequirement.__eq__Ps����%��-�!�!�
�d�i�i�(�,=�e�j�j�,I�I�
,����u�|�|�+�
,����%�/�/�1�
,����E�I�I�%�
,����u�|�|�+�	
r)rrrrrr*rr3r7r9�intr=r�boolrBrrrrrsk���
J�3�
J�4�
J�%��%���
�%�$4��4�*�#�*�
�#�
�

�C�

�D�

rrN)�typingrrrr�_parserrr�
_tokenizerr	�markersr
r�
specifiersr�utilsr
�
ValueErrorrrrrr�<module>rLs4��
0�/�<�)�4�$�$����F
�F
r