U
    ZÊ¹ju  ã                   @   sz   d dl mZmZ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 )é    )ÚAnyÚIteratorÚOptionalÚSeté   )Ú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/bwave/python/venv/lib/python3.8/site-packages/wheel/vendored/packaging/requirements.pyr      s   r   c                   @   sn   e Zd ZdZeddœdd„Zeee dœdd„Zed	œd
d„Zed	œdd„Z	e
d	œdd„Zee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.
    N)Úrequirement_stringÚreturnc              
   C   sœ   zt |ƒ}W n0 tk
r< } ztt|ƒƒ|‚W 5 d }~X Y nX |j| _|jpNd | _t|jp\g ƒ| _t|j	ƒ| _	d | _
|j
d k	r˜t t¡| _
t|j
ƒ| j
_d S ©N)Ú_parse_requirementr   r   ÚstrÚnameÚurlÚsetÚextrasr   Ú	specifierÚmarkerr	   Ú__new__r
   Ú_markers)Úselfr   ÚparsedÚer   r   r   Ú__init__!   s     
zRequirement.__init__)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_parts0   s    zRequirement._iter_parts)r   c                 C   s   d  |  | j¡¡S )NÚ )r*   r-   r   ©r"   r   r   r   Ú__str__B   s    zRequirement.__str__c                 C   s   d| › d�S )Nz<Requirement('z')>r   r/   r   r   r   Ú__repr__E   s    zRequirement.__repr__c                 C   s   t | jjf|  t| jƒ¡˜ƒS r   )ÚhashÚ	__class__r   r-   r   r   r/   r   r   r   Ú__hash__H   s    ÿþÿzRequirement.__hash__)Ú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"   r5   r   r   r   Ú__eq__P   s    

ÿ
þ
ý
ûzRequirement.__eq__)r   r   r   r   r   r%   r   r-   r0   r1   Úintr4   r   Úboolr8   r   r   r   r   r      s   r   N)Útypingr   r   r   r   Ú_parserr   r   Ú
_tokenizerr   Úmarkersr	   r
   Ú
specifiersr   Úutilsr   Ú
ValueErrorr   r   r   r   r   r   Ú<module>   s   