U
    ;»{jŸ  ã                   @   sä   d dl mZ d dlmZmZmZ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e
ee
 ed
œdd„Zedd�G dd„ dƒƒZG dd„ dƒZed	edœdd„ZG dd	„ d	ƒZdS )é    )Ú	dataclass)Ú	FrozenSetÚIterableÚOptionalÚTuple)ÚSpecifierSet)ÚNormalizedName)ÚVersion)ÚLinkÚlinks_equivalent)ÚInstallRequirement)ÚHashesÚ	Candidate)ÚprojectÚextrasÚreturnc                 C   s&   |s| S d  t|ƒ¡}| › d|› d�S )Nú,ú[ú])ÚjoinÚsorted)r   r   Zextras_expr© r   úI/tmp/pip-install-zsn1f9xv/pip/pip/_internal/resolution/resolvelib/base.pyÚformat_name   s    r   T)Úfrozenc                   @   s~   e Zd ZU eed< eed< ee ed< ed dœdd„ƒZ	ee
d dœdd	„ƒZedœd
d„Ze
d dœdd„Zdedœdd„ZdS )Ú
ConstraintÚ	specifierÚhashesÚlinks©r   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_ireqc                 C   s   t | jƒpt | jƒpt | jƒS r    )Úboolr   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>4   s     z-Constraint.is_satisfied_by.<locals>.<genexpr>FT)Úprereleases)r   Úallr   ÚcontainsÚversion©r+   r3   r   r6   r   Úis_satisfied_by2   s    zConstraint.is_satisfied_byN)Ú__name__Ú
__module__Ú__qualname__r   Ú__annotations__r   r   r
   Úclassmethodr#   r   r(   r)   r,   r1   r=   r   r   r   r   r      s   

r   c                   @   s\   e Zd Zeedœdd„ƒZeedœdd„ƒZdedœdd	„Z	e
dœd
d„Zedœdd„ZdS )ÚRequirementr   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_namec                 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.
        rD   NrE   r*   r   r   r   ÚnameG   s    zRequirement.namer   r2   c                 C   s   dS ©NFr   r<   r   r   r   r=   P   s    zRequirement.is_satisfied_byc                 C   s   t dƒ‚d S ©NrD   rE   r*   r   r   r   Úget_candidate_lookupS   s    z Requirement.get_candidate_lookupc                 C   s   t dƒ‚d S rJ   rE   r*   r   r   r   Úformat_for_errorV   s    zRequirement.format_for_errorN)r>   r?   r@   Úpropertyr   rG   ÚstrrH   r)   r=   ÚCandidateLookuprK   rL   r   r   r   r   rC   <   s   	rC   )r'   r3   r   c                 C   s   |j rt| |j ƒS dS rI   )Úsource_linkr   )r'   r3   r   r   r   r4   Z   s    r4   c                   @   s´   e Zd Zeedœdd„ƒZeedœdd„ƒZeedœdd„ƒZ	ee
dœdd	„ƒZee
dœd
d„ƒZeee dœdd„ƒZe
eee  dœdd„Zee dœdd„Zedœdd„ZdS )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 subclassNrE   r*   r   r   r   rG   a   s    zCandidate.project_namec                 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   NrE   r*   r   r   r   rH   k   s    zCandidate.namec                 C   s   t dƒ‚d S ©NrQ   rE   r*   r   r   r   r;   t   s    zCandidate.versionc                 C   s   t dƒ‚d S rR   rE   r*   r   r   r   Úis_installedx   s    zCandidate.is_installedc                 C   s   t dƒ‚d S rR   rE   r*   r   r   r   Úis_editable|   s    zCandidate.is_editablec                 C   s   t dƒ‚d S rR   rE   r*   r   r   r   rP   €   s    zCandidate.source_link)Úwith_requiresr   c                 C   s   t dƒ‚d S rR   rE   )r+   rU   r   r   r   Úiter_dependencies„   s    zCandidate.iter_dependenciesc                 C   s   t dƒ‚d S rR   rE   r*   r   r   r   Úget_install_requirement‡   s    z!Candidate.get_install_requirementc                 C   s   t dƒ‚d S rJ   rE   r*   r   r   r   rL   Š   s    zCandidate.format_for_errorN)r>   r?   r@   rM   r   rG   rN   rH   r	   r;   r)   rS   rT   r   r
   rP   r   rC   rV   r   rW   rL   r   r   r   r   r   `   s   	N)Zdataclassesr   Útypingr   r   r   r   Z pip._vendor.packaging.specifiersr   Úpip._vendor.packaging.utilsr   Zpip._vendor.packaging.versionr	   Úpip._internal.models.linkr
   r   Zpip._internal.req.req_installr   Úpip._internal.utils.hashesr   rO   rN   r   r   rC   r)   r4   r   r   r   r   r   Ú<module>   s   %