o
    Zh                     @  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ZeddG dd dZG dd dZd#ddZG d d dZd!S )$    )annotations)Iterable)	dataclass)Optional)SpecifierSet)NormalizedName)Version)Linklinks_equivalent)InstallRequirement)Hashes	Candidateprojectr   extrasfrozenset[NormalizedName]returnstrc                 C  s&   |s| S d t|}|  d| dS )N,[])joinsorted)r   r   Zextras_expr r   W/var/www/auris/lib/python3.10/site-packages/pip/_internal/resolution/resolvelib/base.pyformat_name   s   r   T)frozenc                   @  s`   e Zd ZU ded< ded< ded< eddd	ZedddZdddZdddZdddZ	dS )
Constraintr   	specifierr   hasheszfrozenset[Link]linksr   c                 C  s   t t t t S N)r   r   r   	frozenset)clsr   r   r   empty   s   zConstraint.empty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__otherc                 C  sR   t |tstS | j|j@ }| j|jdd@ }| j}|jr#||jg}t|||S r%   )	
isinstancer   NotImplementedr   r   r   r'   unionr   )r+   r-   r   r   r   r   r   r   __and__+   s   
zConstraint.__and__	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'   r2   r   r   	<genexpr>7   s    z-Constraint.is_satisfied_by.<locals>.<genexpr>FT)prereleases)r   allr   containsversionr+   r2   r   r5   r   is_satisfied_by5   s   zConstraint.is_satisfied_byN)r   r   )r$   r   r   r   r   r)   )r-   r   r   r   r2   r   r   r)   )
__name__
__module____qualname____annotations__classmethodr#   r(   r,   r1   r<   r   r   r   r   r      s   
 


r   c                   @  sF   e Zd ZedddZedddZdddZdddZdddZdS )Requirementr   r   c                 C     t d)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 overrideNotImplementedErrorr*   r   r   r   project_name@      zRequirement.project_namer   c                 C  rE   )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.
        rF   rG   r*   r   r   r   nameJ      zRequirement.namer2   r   r)   c                 C  s   dS NFr   r;   r   r   r   r<   S   s   zRequirement.is_satisfied_byCandidateLookupc                 C  rE   NrF   rG   r*   r   r   r   get_candidate_lookupV      z Requirement.get_candidate_lookupc                 C  rE   rO   rG   r*   r   r   r   format_for_errorY   rQ   zRequirement.format_for_errorNr   r   r   r   r>   )r   rN   )	r?   r@   rA   propertyrI   rK   r<   rP   rR   r   r   r   r   rD   ?   s    	

rD   r'   r	   r2   r)   c                 C  s   |j r	t| |j S dS rM   )source_linkr
   )r'   r2   r   r   r   r3   ]   s   r3   c                   @  s~   e Zd ZedddZedddZedd	d
Zed ddZed ddZed!ddZ	d"ddZ
d#ddZdddZdS )$r   r   r   c                 C  rE   )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 subclassrG   r*   r   r   r   rI   d   rJ   zCandidate.project_namer   c                 C  rE   )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.
        rW   rG   r*   r   r   r   rK   n   rL   zCandidate.namer   c                 C  rE   NrW   rG   r*   r   r   r   r:   w      zCandidate.versionr)   c                 C  rE   rX   rG   r*   r   r   r   is_installed{   rY   zCandidate.is_installedc                 C  rE   rX   rG   r*   r   r   r   is_editable   rY   zCandidate.is_editableLink | Nonec                 C  rE   rX   rG   r*   r   r   r   rV      rY   zCandidate.source_linkwith_requiresIterable[Requirement | None]c                 C  rE   rX   rG   )r+   r]   r   r   r   iter_dependencies   rQ   zCandidate.iter_dependenciesInstallRequirement | Nonec                 C  rE   rX   rG   r*   r   r   r   get_install_requirement   rQ   z!Candidate.get_install_requirementc                 C  rE   rO   rG   r*   r   r   r   rR      rQ   zCandidate.format_for_errorNrS   rT   )r   r   r=   )r   r\   )r]   r)   r   r^   )r   r`   )r?   r@   rA   rU   rI   rK   r:   rZ   r[   rV   r_   ra   rR   r   r   r   r   r   c   s     	

N)r   r   r   r   r   r   )r'   r	   r2   r   r   r)   )
__future__r   collections.abcr   dataclassesr   typingr   Z pip._vendor.packaging.specifiersr   Zpip._vendor.packaging.utilsr   Zpip._vendor.packaging.versionr   pip._internal.models.linkr	   r
   Zpip._internal.req.req_installr   pip._internal.utils.hashesr   tuplerN   r   r   rD   r3   r   r   r   r   r   <module>   s"    
%
