a
    b3j6                     @  sz   d dl mZ d dl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)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   /www/wwwroot/dpstar/app/297b3aabda72fedb274352021c2dd8b5_venv/lib/python3.9/site-packages/pip/_vendor/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| j j d|  dS )N<z('z')>)	__class__r   r.   r   r   r   __repr__F   s    zRequirement.__repr__intc                 C  s   t t| t| jS r   )hashtupler,   r
   r   r.   r   r   r   __hash__I   s    zRequirement.__hash__object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!   r9   r   r   r   __eq__L   s    




zRequirement.__eq__N)
r   r   r   r   r$   r,   r/   r2   r6   r<   r   r   r   r   r      s   r   N)
__future__r   typingr   _parserr   r   
_tokenizerr   markersr   r   
specifiersr	   utilsr
   
ValueErrorr   r   r   r   r   r   <module>   s   