a
    Xg                     @  s~   d dl mZ d dl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
 d
eZG dd dZdS )    )annotations)AnyIterator   )parse_requirement)ParserSyntaxError)Marker_normalize_extra_values)SpecifierSet)canonicalize_namec                   @  s   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__ r   r   d/var/www/html/cobodadashboardai.evdpl.com/venv/lib/python3.9/site-packages/packaging/requirements.pyr      s   r   c                   @  sj   e Zd ZdZdddddZdddd	d
ZddddZddddZddddZdddd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.
    strNone)requirement_stringreturnc              
   C  s   zt |}W n2 ty> } ztt||W Y d }~n
d }~0 0 |j| _|jpPd | _t|jp^g | _t|j	| _	d | _
|j
d urtt| _
t|j
| j
_d S N)_parse_requirementr   r   r   nameurlsetextrasr
   	specifiermarkerr   __new__r	   _markers)selfr   parseder   r   r   __init__"   s    $
zRequirement.__init__zIterator[str])r   r   c                 c  st   |V  | j r*dt| j }d| dV  | jr<t| jV  | jr\d| j V  | jr\dV  | jrpd| j V  d S )N,[]z@  z; )r   joinsortedr   r   r   r   )r"   r   formatted_extrasr   r   r   _iter_parts1   s    zRequirement._iter_parts)r   c                 C  s   d | | jS )N )r*   r-   r   r"   r   r   r   __str__C   s    zRequirement.__str__c                 C  s   d|  dS )Nz<Requirement('z')>r   r/   r   r   r   __repr__F   s    zRequirement.__repr__intc                 C  s    t | jjg| t| jR S r   )hash	__class__r   r-   r   r   r/   r   r   r   __hash__I   s    zRequirement.__hash__r   bool)otherr   c                 C  sR   t |tstS t| jt|jkoP| j|jkoP| j|jkoP| j|jkoP| j|jkS r   )	
isinstancer   NotImplementedr   r   r   r   r   r   )r"   r7   r   r   r   __eq__Q   s    




zRequirement.__eq__N)
r   r   r   r   r%   r-   r0   r1   r5   r:   r   r   r   r   r      s   r   N)
__future__r   typingr   r   _parserr   r   Z
_tokenizerr   markersr   r	   
specifiersr
   utilsr   
ValueErrorr   r   r   r   r   r   <module>   s   