
    Dgu                         d dl mZmZmZmZ ddlmZ ddlm	Z	 ddl
mZmZ ddlmZ ddlmZ  G d d	e          Z G d
 d          ZdS )    )AnyIteratorOptionalSet   )parse_requirement)ParserSyntaxError)Marker_normalize_extra_values)SpecifierSet)canonicalize_namec                       e Zd ZdZdS )InvalidRequirementzJ
    An invalid requirement was found, users should refer to PEP 508.
    N)__name__
__module____qualname____doc__     K/var/www/sysmax/venv/lib/python3.11/site-packages/packaging/requirements.pyr   r      s           r   r   c                   r    e Zd ZdZdeddfdZdedee         fdZdefdZdefd	Z	de
fd
ZdedefdZdS )RequirementzParse 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          |          }n/# t          $ r"}t          t          |                    |d }~ww xY w|j        | _        |j        pd | _        t          |j        pg           | _        t          |j	                  | _	        d | _
        |j
        >t          j        t                    | _
        t          |j
                  | j
        _        d S d S N)_parse_requirementr	   r   strnameurlsetextrasr   	specifiermarkerr
   __new__r   _markers)selfr   parsedes       r   __init__zRequirement.__init__!   s    	4'(:;;FF  	4 	4 	4$SVV,,!3	4  	"(*"4 #FM$7R 8 8'3F4D'E'E(,=$ .00DK#:6=#I#IDK    %$s    
>9>r   c              #     K   |V  | j         r/d                    t          | j                             }d| dV  | j        rt	          | j                  V  | j        rd| j         V  | j        rdV  | j        rd| j         V  d S d S )N,[]z@  z; )r"   joinsortedr#   r   r    r$   )r'   r   formatted_extrass      r   _iter_partszRequirement._iter_parts0   s      


; 	*"xxt{(;(;<<)&))))))> 	&dn%%%%%8 	!tx//!!!{ 			; 	%$t{$$$$$$$	% 	%r   c                 \    d                     |                     | j                            S )N )r0   r3   r   r'   s    r   __str__zRequirement.__str__B   s$    wwt''	22333r   c                     d|  dS )Nz<Requirement('z')>r   r6   s    r   __repr__zRequirement.__repr__E   s    )))))r   c                     t          | j        j        g|                     t	          | j                            R           S r   )hash	__class__r   r3   r   r   r6   s    r   __hash__zRequirement.__hash__H   sG    '!!"3DI">">?? 
 
 	
r   otherc                    t          |t                    st          S t          | j                  t          |j                  k    o?| j        |j        k    o/| j        |j        k    o| j        |j        k    o| j        |j        k    S r   )	
isinstancer   NotImplementedr   r   r"   r#   r    r$   )r'   r>   s     r   __eq__zRequirement.__eq__P   s    %-- 	"!! di((,=ej,I,II ,u|+,%/1, EI%, u|+	
r   )r   r   r   r   r   r*   r   r3   r7   r9   intr=   r   boolrB   r   r   r   r   r      s         J3 J4 J J J J% % % % % %$4 4 4 4 4*# * * * *
# 
 
 
 


C 

D 

 

 

 

 

 

r   r   N)typingr   r   r   r   _parserr   r   
_tokenizerr	   markersr
   r   
specifiersr   utilsr   
ValueErrorr   r   r   r   r   <module>rL      s   
 0 / / / / / / / / / / / < < < < < < ) ) ) ) ) ) 4 4 4 4 4 4 4 4 $ $ $ $ $ $ $ $ $ $ $ $       F
 F
 F
 F
 F
 F
 F
 F
 F
 F
r   