o
    j                     @  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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Requirementreturn	list[str]c                   C  s   t S N)__all__ r   r   W/var/www/html/Deteccion_Ine/venv/lib/python3.10/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Zdd
dZd ddZd!ddZd ddZd ddZ	d"ddZ
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.
    requirement_stringstrr   Nonec              
   C  s   zt |}W n ty } ztt||d }~ww |j| _|jp"d | _t|jp)g | _t|j	| _	d | _
|j
d urItt| _
t|j
| j
_d S 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__r   Iterator[str]c                 c  sz    |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_extrasr   r   r   _iter_partsD   s   zRequirement._iter_partsc                 C  s   t | S r   )r   r$   r   r   r   __getstate__V   s   zRequirement.__getstate__stateobjectc              
   C  s   t |tr6zt|}W n ty } ztd||d }~ww |j| _|j| _|j| _|j| _|j	| _	d S t |t
rC| j| d S td|)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-   r0   r   r1   r   r   r   __str__n   s   zRequirement.__str__c                 C  s   d| j j dt| dS )N<(z)>)	__class__r   r   r1   r   r   r   __repr__q   s   zRequirement.__repr__intc                 C  s   t t| t| jS r   )hashtupler0   r
   r   r1   r   r   r   __hash__t   s   zRequirement.__hash__otherboolc                 C  sR   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   )	r5   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   r   r(   )r   r   )r3   r4   r   r   )r   rC   )rG   r4   r   rH   )r   r   r   r   r'   r0   r2   r<   r>   rB   rF   rJ   r   r   r   r   r      s    






N)r   r   )
__future__r   typingr   _parserr   r   Z
_tokenizerr   markersr   r   
specifiersr	   utilsr
   r   r   
ValueErrorr   r   r   r   r   r   <module>   s   
