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   Zextras_expr© r   úc/var/www/html/chatgpt/venv/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!   )r4   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 )NFr/   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+   r6   r   r   Ú
<listcomp>=   s    z1Constraint.__and__.<locals>.<dictcomp>.<listcomp>r9   )r*   ©r8   r6   )r+   r   r-   <   s    ÿÿ)Ú
isinstancer   ÚNotImplementedr   r   r   r2   Úkeysr    r1   Úunionr   )r6   r8   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*   r1   ©rA   r   r   Ú	<genexpr>G   s   € z-Constraint.is_satisfied_by.<locals>.<genexpr>FT)Úprereleases)r    Úallr   ÚcontainsÚversion©r6   rA   r   rD   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   rC   r   r   r   rE   Q   s   € z.Constraint.format_for_error.<locals>.<genexpr>ú))r   r   r    r   )r6   Úsr   r   r   Úformat_for_errorN   s   
"zConstraint.format_for_errorN)r   r   )r%   r   r   r   ©r   r4   )r8   r   r   r   ©rA   r   r   r4   ©r   r   )Ú__name__Ú
__module__Ú__qualname__Ú__annotations__Úclassmethodr$   r3   r7   r@   rK   rN   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©ÚNotImplementedErrorr5   r   r   r   Úproject_nameV   ó   zRequirement.project_namer   c                 C  rX   )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.
        rY   rZ   r5   r   r   r   Úname`   ó   zRequirement.namerA   r   r4   c                 C  s   dS ©NFr   rJ   r   r   r   rK   i   s   zRequirement.is_satisfied_byÚCandidateLookupc                 C  rX   ©NrY   rZ   r5   r   r   r   Úget_candidate_lookupl   ó   z Requirement.get_candidate_lookupc                 C  rX   rb   rZ   r5   r   r   r   rN   o   rd   zRequirement.format_for_errorN©r   r   rQ   rP   )r   ra   )	rR   rS   rT   Úpropertyr\   r^   rK   rc   rN   r   r   r   r   rW   U   s    	

rW   r1   r	   rA   r4   c                 C  s   |j r	t| |j ƒS dS r`   )Úsource_linkr
   )r1   rA   r   r   r   rB   s   s   rB   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  rX   )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 subclassrZ   r5   r   r   r   r\   z   r]   zCandidate.project_namer   c                 C  rX   )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.
        rh   rZ   r5   r   r   r   r^   „   r_   zCandidate.namer   c                 C  rX   ©Nrh   rZ   r5   r   r   r   rI   �   ó   zCandidate.versionr4   c                 C  rX   ri   rZ   r5   r   r   r   Úis_installed‘   rj   zCandidate.is_installedc                 C  rX   ri   rZ   r5   r   r   r   Úis_editable•   rj   zCandidate.is_editableúLink | Nonec                 C  rX   ri   rZ   r5   r   r   r   rg   ™   rj   zCandidate.source_linkÚwith_requiresúIterable[Requirement | None]c                 C  rX   ri   rZ   )r6   rn   r   r   r   Úiter_dependencies�   rd   zCandidate.iter_dependenciesúInstallRequirement | Nonec                 C  rX   ri   rZ   r5   r   r   r   Úget_install_requirement    rd   z!Candidate.get_install_requirementc                 C  rX   rb   rZ   r5   r   r   r   rN   £   rd   zCandidate.format_for_errorNre   rQ   )r   r   rO   )r   rm   )rn   r4   r   ro   )r   rq   )rR   rS   rT   rf   r\   r^   rI   rk   rl   rg   rp   rr   rN   r   r   r   r   r   y   s     	

)r   r   r   r   r   r   )r1   r	   rA   r   r   r4   )Ú
__future__r   Úcollections.abcr   Údataclassesr   Útypingr   Z pip._vendor.packaging.specifiersr   Úpip._vendor.packaging.utilsr   Zpip._vendor.packaging.versionr   Úpip._internal.models.linkr	   r
   Úpip._internal.req.req_installr   Úpip._internal.utils.hashesr   Útuplera   r   r   rW   rB   r   r   r   r   r   Ú<module>   s"    
;
