a
    e0h                     @   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	 e	rd dl
mZmZmZmZ d dlmZ d dlmZ eed	 ee f Zd
d ZG dd deZG dd deZG dd	 d	eZdS )    )SpecifierSetcanonicalize_name)InstallRequirement)Hashes)MYPY_CHECK_RUNNING)	FrozenSetIterableOptionalTuple)_BaseVersion)Link	Candidatec                 C   s,   |s| S t dd |D }d| d|S )Nc                 s   s   | ]}t |V  qd S Nr   ).0e r   V/var/www/auris/lib/python3.9/site-packages/pip/_internal/resolution/resolvelib/base.py	<genexpr>       zformat_name.<locals>.<genexpr>z{}[{}],)sortedformatjoin)projectextrascanonical_extrasr   r   r   format_name   s    r   c                   @   sL   e Zd Zdd Zedd Zedd Zdd Zd	d
 Zdd Z	dd Z
dS )
Constraintc                 C   s   || _ || _d S r   )	specifierhashes)selfr   r    r   r   r   __init__   s    zConstraint.__init__c                 C   s   t t t S r   )r   r   r   )clsr   r   r   empty#   s    zConstraint.emptyc                 C   s   t |j|jddS NF)trust_internet)r   r   r    )r#   ireqr   r   r   	from_ireq(   s    zConstraint.from_ireqc                 C   s   t | jpt | jS r   )boolr   r    r!   r   r   r   __nonzero__-   s    zConstraint.__nonzero__c                 C   s   |   S r   )r+   r*   r   r   r   __bool__1   s    zConstraint.__bool__c                 C   s6   t |tstS | j|j@ }| j|jdd@ }t||S r%   )
isinstancer   NotImplementedr   r    r   )r!   otherr   r    r   r   r   __and__5   s
    
zConstraint.__and__c                 C   s   | j j|jddS )NT)prereleases)r   containsversionr!   	candidater   r   r   is_satisfied_by=   s    zConstraint.is_satisfied_byN)__name__
__module____qualname__r"   classmethodr$   r(   r+   r,   r0   r6   r   r   r   r   r      s   

r   c                   @   s<   e Zd Zedd Zedd Zdd Zdd Zd	d
 ZdS )Requirementc                 C   s   t ddS )zThe "project name" of a requirement.

        This is different from ``name`` if this requirement contains extras,
        in which case ``name`` would contain the ``[...]`` part, while this
        refers to the name of the project.
        Subclass should overrideNNotImplementedErrorr*   r   r   r   project_nameF   s    	zRequirement.project_namec                 C   s   t ddS )zThe name identifying this requirement in the resolver.

        This is different from ``project_name`` if this requirement contains
        extras, where ``project_name`` would not contain the ``[...]`` part.
        r<   Nr=   r*   r   r   r   nameQ   s    zRequirement.namec                 C   s   dS )NFr   r4   r   r   r   r6   [   s    zRequirement.is_satisfied_byc                 C   s   t dd S Nr<   r=   r*   r   r   r   get_candidate_lookup_   s    z Requirement.get_candidate_lookupc                 C   s   t dd S rA   r=   r*   r   r   r   format_for_errorc   s    zRequirement.format_for_errorN)	r7   r8   r9   propertyr?   r@   r6   rB   rC   r   r   r   r   r;   E   s   


	r;   c                   @   sl   e Zd Zedd Zedd Zedd Zedd Zed	d
 Zedd Z	dd Z
dd Zdd ZdS )r   c                 C   s   t ddS )zThe "project name" of the candidate.

        This is different from ``name`` if this candidate contains extras,
        in which case ``name`` would contain the ``[...]`` part, while this
        refers to the name of the project.
        Override in subclassNr=   r*   r   r   r   r?   i   s    	zCandidate.project_namec                 C   s   t ddS )zThe name identifying this candidate in the resolver.

        This is different from ``project_name`` if this candidate contains
        extras, where ``project_name`` would not contain the ``[...]`` part.
        rE   Nr=   r*   r   r   r   r@   t   s    zCandidate.namec                 C   s   t dd S NrE   r=   r*   r   r   r   r3   ~   s    zCandidate.versionc                 C   s   t dd S rF   r=   r*   r   r   r   is_installed   s    zCandidate.is_installedc                 C   s   t dd S rF   r=   r*   r   r   r   is_editable   s    zCandidate.is_editablec                 C   s   t dd S rF   r=   r*   r   r   r   source_link   s    zCandidate.source_linkc                 C   s   t dd S rF   r=   )r!   with_requiresr   r   r   iter_dependencies   s    zCandidate.iter_dependenciesc                 C   s   t dd S rF   r=   r*   r   r   r   get_install_requirement   s    z!Candidate.get_install_requirementc                 C   s   t dd S rA   r=   r*   r   r   r   rC      s    zCandidate.format_for_errorN)r7   r8   r9   rD   r?   r@   r3   rG   rH   rI   rK   rL   rC   r   r   r   r   r   h   s   


	



N)Z pip._vendor.packaging.specifiersr   pip._vendor.packaging.utilsr   Zpip._internal.req.req_installr   pip._internal.utils.hashesr   pip._internal.utils.typingr   typingr   r	   r
   r   Zpip._vendor.packaging.versionr   pip._internal.models.linkr   ZCandidateLookupr   objectr   r;   r   r   r   r   r   <module>   s"   (#