o
    Ee                     @   sv   d dl Z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 G dd	 d	eZG d
d dZdS )    N)AnyListOptionalSet   )parse_requirement)ParserSyntaxError)Marker_normalize_extra_values)SpecifierSetc                   @   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   j/var/www/bmteknikk.ddns.net/venv/lib/python3.10/site-packages/setuptools/_vendor/packaging/requirements.pyr      s    r   c                   @   s^   e Zd ZdZdeddfddZdefddZdefd	d
ZdefddZ	de
def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.
    requirement_stringreturnNc              
   C   s  zt |}W n ty } ztt||d }~ww |j| _|jrTtj|j}|j	dkr;tj
||jkr:tdn|j	rG|jrG|j	sO|jsOtd|j |j| _nd | _t|jr^|jng | _t|j| _d | _|jd urtt| _t|j| j_d S d S )NfilezInvalid URL givenzInvalid URL: )_parse_requirementr   r   strnameurlurllibparseurlparsescheme
urlunparsenetlocsetextrasr   	specifiermarkerr	   __new__r
   _markers)selfr   parsede
parsed_urlr   r   r   __init__!   s8   


zRequirement.__init__c                 C   s   | j g}| jrdt| j}|d| d | jr#|t| j | jr7|d| j  | jr7|d | jrC|d| j  d|S )N,[]z@  z;  )	r   r"   joinsortedappendr#   r   r   r$   )r'   partsformatted_extrasr   r   r   __str__;   s   

zRequirement.__str__c                 C   s   d|  dS )Nz<Requirement('z')>r   r'   r   r   r   __repr__O   s   zRequirement.__repr__c                 C   s   t | jjt| fS N)hash	__class__r   r   r7   r   r   r   __hash__R   s   zRequirement.__hash__otherc                 C   sJ   t |tstS | j|jko$| j|jko$| j|jko$| j|jko$| j|jkS r9   )
isinstancer   NotImplementedr   r"   r#   r   r$   )r'   r=   r   r   r   __eq__U   s   




zRequirement.__eq__)r   r   r   r   r   r+   r6   r8   intr<   r   boolr@   r   r   r   r   r      s    r   )urllib.parser   typingr   r   r   r   _parserr   r   
_tokenizerr   markersr	   r
   
specifiersr   
ValueErrorr   r   r   r   r   r   <module>   s   