a
    <Bì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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   úg/mnt/bigstor/www/usecases/.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 )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 overrideN©ÚNotImplementedErrorr*   r   r   r   Úproject_name@   s    zRequirement.project_namer   c                 C  s   t dƒ‚dS )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.
        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 )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 subclassNrF   r*   r   r   r   rH   d   s    zCandidate.project_namer   c                 C  s   t dƒ‚dS )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.
        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   Zpip._vendor.packaging.utilsr   Ú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    %