a
    sh                     @  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	 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 eed ee f ZddddddZeddG dd dZG dd dZddddddZG dd dZdS )    )annotations)Iterable)	dataclass)Optional)SpecifierSet)NormalizedName)Version)Linklinks_equivalent)InstallRequirement)Hashes	Candidater   zfrozenset[NormalizedName]str)projectextrasreturnc                 C  s&   |s| S d t|}|  d| dS )N,[])joinsorted)r   r   Zextras_expr r   d/var/www/html/assistant/venv/lib/python3.9/site-packages/pip/_internal/resolution/resolvelib/base.pyformat_name   s    r   T)frozenc                   @  sz   e Zd ZU ded< ded< ded< ed ddd	Zed
d dddZddddZd
d dddZdddddZ	dS )
Constraintr   	specifierr   hasheszfrozenset[Link]linksr   c                 C  s   t t t t S N)r   r   r   	frozenset)clsr   r   r   empty   s    zConstraint.emptyr   )ireqr   c                 C  s.   |j rt|j gnt }t|j|jdd|S NF)trust_internet)linkr!   r   r   r   )r"   r$   r   r   r   r   	from_ireq#   s    zConstraint.from_ireqboolc                 C  s   t | jpt | jpt | jS r    )r)   r   r   r   selfr   r   r   __bool__(   s    zConstraint.__bool__)otherr   c                 C  sR   t |tstS | j|j@ }| j|jdd@ }| j}|jrF||jg}t|||S r%   )	
isinstancer   NotImplementedr   r   r   r'   unionr   )r+   r-   r   r   r   r   r   r   __and__+   s    
zConstraint.__and__r   	candidater   c                   s4   | j r"t fdd| j D s"dS | jj jddS )Nc                 3  s   | ]}t | V  qd S r    )_match_link).0r'   r3   r   r   	<genexpr>7       z-Constraint.is_satisfied_by.<locals>.<genexpr>FT)prereleases)r   allr   containsversionr+   r3   r   r6   r   is_satisfied_by5   s    zConstraint.is_satisfied_byN)
__name__
__module____qualname____annotations__classmethodr#   r(   r,   r1   r>   r   r   r   r   r      s   

r   c                   @  s\   e Zd ZeddddZeddddZdd	d
ddZddddZddddZdS )Requirementr   r   c                 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_name@   s    zRequirement.project_namer   c                 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.
        rE   NrF   r*   r   r   r   nameJ   s    zRequirement.namer   r)   r2   c                 C  s   dS NFr   r=   r   r   r   r>   S   s    zRequirement.is_satisfied_byCandidateLookupc                 C  s   t dd S NrE   rF   r*   r   r   r   get_candidate_lookupV   s    z Requirement.get_candidate_lookupc                 C  s   t dd S rL   rF   r*   r   r   r   format_for_errorY   s    zRequirement.format_for_errorN)	r?   r@   rA   propertyrH   rI   r>   rM   rN   r   r   r   r   rD   ?   s   	rD   r	   r)   )r'   r3   r   c                 C  s   |j rt| |j S dS rJ   )source_linkr
   )r'   r3   r   r   r   r4   ]   s    r4   c                   @  s   e Zd ZeddddZeddddZeddd	d
ZeddddZeddddZeddddZ	dddddZ
ddddZddddZdS )r   r   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 subclassNrF   r*   r   r   r   rH   d   s    zCandidate.project_namer   c                 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.
        rQ   NrF   r*   r   r   r   rI   n   s    zCandidate.namer   c                 C  s   t dd S NrQ   rF   r*   r   r   r   r<   w   s    zCandidate.versionr)   c                 C  s   t dd S rR   rF   r*   r   r   r   is_installed{   s    zCandidate.is_installedc                 C  s   t dd S rR   rF   r*   r   r   r   is_editable   s    zCandidate.is_editablezLink | Nonec                 C  s   t dd S rR   rF   r*   r   r   r   rP      s    zCandidate.source_linkzIterable[Requirement | None])with_requiresr   c                 C  s   t dd S rR   rF   )r+   rU   r   r   r   iter_dependencies   s    zCandidate.iter_dependencieszInstallRequirement | Nonec                 C  s   t dd S rR   rF   r*   r   r   r   get_install_requirement   s    z!Candidate.get_install_requirementc                 C  s   t dd S rL   rF   r*   r   r   r   rN      s    zCandidate.format_for_errorN)r?   r@   rA   rO   rH   rI   r<   rS   rT   rP   rV   rW   rN   r   r   r   r   r   c   s   	N)
__future__r   collections.abcr   Zdataclassesr   typingr   Z pip._vendor.packaging.specifiersr   pip._vendor.packaging.utilsr   Zpip._vendor.packaging.versionr   pip._internal.models.linkr	   r
   Zpip._internal.req.req_installr   pip._internal.utils.hashesr   tuplerK   r   r   rD   r4   r   r   r   r   r   <module>   s    %