a
    b3j                     @  s   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 d	d
gZdddd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_nameInvalidRequirementRequirementz	list[str]returnc                   C  s   t S N)__all__ r   r   s/www/wwwroot/dpstar/app/297b3aabda72fedb274352021c2dd8b5_venv/lib/python3.9/site-packages/packaging/requirements.py__dir__   s    r   c                   @  s   e Zd ZdZdS )r   zJ
    An invalid requirement was found, users should refer to PEP 508.
    N)__name__
__module____qualname____doc__r   r   r   r   r      s   c                   @  s   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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 )r   ao  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.

    Instances are safe to serialize with :mod:`pickle`. They use a stable
    format so the same pickle can be loaded in future packaging releases.

    .. versionchanged:: 26.2

        Added a stable pickle format. Pickles created with packaging 26.2+ can
        be unpickled with future releases.  Backward compatibility with pickles
        from packaging < 26.2 is supported but may be removed in a future
        release.
    strNone)requirement_stringr   c              
   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 r   )_parse_requirementr   r   r   nameurlsetextrasr	   	specifiermarkerr   __new__r   _markers)selfr   parseder   r   r   __init__5   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_partsD   s    zRequirement._iter_partsr   c                 C  s   t | S r   )r   r$   r   r   r   __getstate__V   s    zRequirement.__getstate__object)stater   c              
   C  s   t |trxzt|}W n4 tyJ } ztd||W Y d }~n
d }~0 0 |j| _|j| _|j| _|j| _|j	| _	d S t |t
r| j| d S td|d S )Nz Cannot restore Requirement from )
isinstancer   r   r   	TypeErrorr   r   r   r    r!   dict__dict__update)r$   r3   tmpexcr   r   r   __setstate__[   s    
&
zRequirement.__setstate__c                 C  s   d | | jS )N )r,   r/   r   r0   r   r   r   __str__n   s    zRequirement.__str__c                 C  s   d| j j dt| dS )N<(z)>)	__class__r   r   r0   r   r   r   __repr__q   s    zRequirement.__repr__intc                 C  s   t t| t| jS r   )hashtupler/   r
   r   r0   r   r   r   __hash__t   s    zRequirement.__hash__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   )	r4   r   NotImplementedr
   r   r   r    r   r!   )r$   rG   r   r   r   __eq__w   s    




zRequirement.__eq__N)r   r   r   r   r'   r/   r1   r;   r=   rA   rE   rI   r   r   r   r   r      s   N)
__future__r   typingr   _parserr   r   
_tokenizerr   markersr   r   
specifiersr	   utilsr
   r   r   
ValueErrorr   r   r   r   r   r   <module>   s   