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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   i/var/www/html/Deteccion_Ine/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)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NotImplementedErrorr5   r   r   r   project_nameV      zRequirement.project_namer   c                 C  rX   )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.
        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   )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 subclassrZ   r5   r   r   r   r\   z   r]   zCandidate.project_namer   c                 C  rX   )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.
        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     	

N)r   r   r   r   r   r   )r1   r	   rA   r   r   r4   )
__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   tuplera   r   r   rW   rB   r   r   r   r   r   <module>   s"    
;
