o
    üÞhƒ  ã                   @  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   úV/var/www/html/premium_crap/venv/lib/python3.10/site-packages/packaging/requirements.pyr      s    r   c                   @  sL   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S )ÚRequirementzÁ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.
    Úrequirement_stringÚstrÚreturnÚ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 ©N)Ú_parse_requirementr   r   r   ÚnameÚurlÚsetÚextrasr
   Ú	specifierÚmarkerr   Ú__new__r	   Ú_markers)Úselfr   ÚparsedÚer   r   r   Ú__init__"   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_parts1   s   €ÿzRequirement._iter_partsc                 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   r0   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   r0   r   r   r   Ú__hash__I   s   ÿþÿzRequirement.__hash__Úotherr   Ú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   )	Ú
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   r   r&   )r   r   )r   r3   )r7   r   r   r8   )
r   r   r   r   r%   r.   r1   r2   r6   r;   r   r   r   r   r      s    




r   N)Ú
__future__r   Útypingr   r   Ú_parserr   r   Ú
_tokenizerr   Úmarkersr   r	   Ú
specifiersr
   Úutilsr   Ú
ValueErrorr   r   r   r   r   r   Ú<module>   s   