o
    ­—Žj  ã                   @  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dB 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Ú	CandidateNÚprojectr   Úextrasúfrozenset[NormalizedName]ÚreturnÚstrc                 C  s&   |s| S d  t|ƒ¡}| › d|› d�S )Nú,ú[ú])ÚjoinÚsorted)r   r   Úextras_expr© r   úe/var/www/kodo/Anonymous/send/lib/python3.10/site-packages/pip/_internal/resolution/resolvelib/base.pyÚformat_name   s   r   T)Úfrozenc                   @  sr   e Zd ZU ded< 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#dd„Z
dS )$Ú
Constraintr   Ú	specifierr   Úhasheszdict[str, list[str]]Úhash_optionszfrozenset[Link]Úlinksr   c                 C  s   t tƒ tƒ i tƒ ƒS ©N)r   r   r   Ú	frozenset)Úclsr   r   r   Úempty    s   zConstraint.emptyÚireqr   c                 C  sD   |j r	t|j gƒntƒ }dd„ |j ¡ D ƒ}t|j|jdd�||ƒS )Nc                 S  ó   i | ]	\}}|t |ƒ“qS r   ©Úlist©Ú.0ÚalgÚvr   r   r   Ú
<dictcomp>'   ó    z(Constraint.from_ireq.<locals>.<dictcomp>F©Útrust_internet)Úlinkr#   r    Úitemsr   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"   )r5   r   r   r!   ©Úselfr   r   r   Ú__bool__/   s   zConstraint.__bool__Úotherc                   s°   t ˆ tƒstS ˆjˆ j@ }ˆjˆ jdd�@ }ˆjs$dd„ ˆ j ¡ D ƒ}n ˆ js2dd„ ˆj ¡ D ƒ}n‡ ‡fdd„ˆj ¡ ˆ j ¡ @ D ƒ}ˆj}ˆ j	rQ| 
ˆ j	g¡}t||||ƒS )NFr0   c                 S  r'   r   r(   r*   r   r   r   r.   8   r/   z&Constraint.__and__.<locals>.<dictcomp>c                 S  r'   r   r(   r*   r   r   r   r.   :   r/   c                   s(   i | ]‰ ˆ ‡ ‡fd d„ˆj ˆ  D ƒ“qS )c                   s   g | ]}|ˆj ˆ  v r|‘qS r   ©r    )r+   r-   )r,   r7   r   r   Ú
<listcomp>=   s    z1Constraint.__and__.<locals>.<dictcomp>.<listcomp>r:   )r+   ©r9   r7   )r,   r   r.   <   s    ÿÿ)Ú
isinstancer   ÚNotImplementedr   r   r    r3   Úkeysr!   r2   Úunionr   )r7   r9   r   r   r    r!   r   r<   r   Ú__and__2   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©r+   r2   ©rB   r   r   Ú	<genexpr>G   s   € z-Constraint.is_satisfied_by.<locals>.<genexpr>FT)Úprereleases)r!   Úallr   ÚcontainsÚversion©r7   rB   r   rE   r   Úis_satisfied_byE   s   zConstraint.is_satisfied_byr   c                 C  s6   t | jƒ}| jr|dd dd„ | jD ƒ¡› d�7 }|S )Nz (from z, c                 s  s   � | ]}t |ƒV  qd S r"   )r   rD   r   r   r   rF   Q   s   € z.Constraint.format_for_error.<locals>.<genexpr>ú))r   r   r!   r   )r7   Úsr   r   r   Úformat_for_errorN   s   
"zConstraint.format_for_errorN)r   r   )r&   r   r   r   ©r   r5   )r9   r   r   r   ©rB   r   r   r5   ©r   r   )Ú__name__Ú
__module__Ú__qualname__Ú__annotations__Úclassmethodr%   r4   r8   rA   rL   rO   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ƒ‚)zòThe "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©ÚNotImplementedErrorr6   r   r   r   Úproject_nameV   ó   zRequirement.project_namer   c                 C  rY   )zÚThe 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.
        rZ   r[   r6   r   r   r   Úname`   ó   zRequirement.namerB   r   r5   c                 C  s   dS ©NFr   rK   r   r   r   rL   i   s   zRequirement.is_satisfied_byÚCandidateLookupc                 C  rY   ©NrZ   r[   r6   r   r   r   Úget_candidate_lookupl   ó   z Requirement.get_candidate_lookupc                 C  rY   rc   r[   r6   r   r   r   rO   o   re   zRequirement.format_for_errorN©r   r   rR   rQ   )r   rb   )	rS   rT   rU   Úpropertyr]   r_   rL   rd   rO   r   r   r   r   rX   U   s    	

rX   r2   r	   rB   r5   c                 C  s   |j r	t| |j ƒS dS ra   )Úsource_linkr
   )r2   rB   r   r   r   rC   s   s   rC   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  rY   )zðThe "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 subclassr[   r6   r   r   r   r]   z   r^   zCandidate.project_namer   c                 C  rY   )zÖThe 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.
        ri   r[   r6   r   r   r   r_   „   r`   zCandidate.namer   c                 C  rY   ©Nri   r[   r6   r   r   r   rJ   �   ó   zCandidate.versionr5   c                 C  rY   rj   r[   r6   r   r   r   Úis_installed‘   rk   zCandidate.is_installedc                 C  rY   rj   r[   r6   r   r   r   Úis_editable•   rk   zCandidate.is_editableúLink | Nonec                 C  rY   rj   r[   r6   r   r   r   rh   ™   rk   zCandidate.source_linkÚwith_requiresúIterable[Requirement | None]c                 C  rY   rj   r[   )r7   ro   r   r   r   Úiter_dependencies�   re   zCandidate.iter_dependenciesúInstallRequirement | Nonec                 C  rY   rj   r[   r6   r   r   r   Úget_install_requirement    re   z!Candidate.get_install_requirementc                 C  rY   rc   r[   r6   r   r   r   rO   £   re   zCandidate.format_for_errorNrf   rR   )r   r   rP   )r   rn   )ro   r5   r   rp   )r   rr   )rS   rT   rU   rg   r]   r_   rJ   rl   rm   rh   rq   rs   rO   r   r   r   r   r   y   s     	

)r   r   r   r   r   r   )r2   r	   rB   r   r   r5   )Ú
__future__r   Úcollections.abcr   Údataclassesr   Útypingr   Ú pip._vendor.packaging.specifiersr   Úpip._vendor.packaging.utilsr   Úpip._vendor.packaging.versionr   Úpip._internal.models.linkr	   r
   Úpip._internal.req.req_installr   Úpip._internal.utils.hashesr   Útuplerb   r   r   rX   rC   r   r   r   r   r   Ú<module>   s"    
;
