o
    |ŸŽi:  ã                   @   sî   d dl mZmZmZmZmZ d dlmZ d dlm	Z	m
Z
 d dlmZ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f Zd	ed
ee defdd„ZG dd„ dƒZG dd„ dƒZdedddefdd„ZG dd„ dƒZdS )é    )Ú	FrozenSetÚIterableÚOptionalÚTupleÚUnion)ÚSpecifierSet)ÚNormalizedNameÚcanonicalize_name)ÚLegacyVersionÚVersion)ÚLinkÚlinks_equivalent)ÚInstallRequirement)ÚHashesÚ	CandidateÚprojectÚextrasÚreturnc                 C   s,   |s| S t dd„ |D ƒƒ}d | d |¡¡S )Nc                 s   s   � | ]}t |ƒV  qd S ©N)r	   )Ú.0Úe© r   úrC:\Users\psant\Downloads\Anu Raj Backend\school\venv\Lib\site-packages\pip/_internal/resolution/resolvelib/base.pyÚ	<genexpr>   s   € zformat_name.<locals>.<genexpr>z{}[{}]ú,)ÚsortedÚformatÚjoin)r   r   Úcanonical_extrasr   r   r   Úformat_name   s   r   c                   @   sŽ   e Zd Zdededee ddfdd„Zeddd	„ƒZ	ed
e
dd fdd„ƒZdefdd„Zdefdd„Zde
dd fdd„Zdddefdd„ZdS )Ú
ConstraintÚ	specifierÚhashesÚlinksr   Nc                 C   s   || _ || _|| _d S r   )r!   r"   r#   )Úselfr!   r"   r#   r   r   r   Ú__init__   s   
zConstraint.__init__c                 C   s   t tƒ tƒ tƒ ƒS r   )r    r   r   Ú	frozenset)Úclsr   r   r   Úempty   s   zConstraint.emptyÚireqc                 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#   ©r$   r   r   r   Ú__nonzero__'   s   zConstraint.__nonzero__c                 C   s   |   ¡ S r   )r0   r/   r   r   r   Ú__bool__*   ó   zConstraint.__bool__Úotherc                 C   sR   t |tƒstS | j|j@ }| j|jdd�@ }| j}|jr#| |jg¡}t|||ƒS r*   )	Ú
isinstancer   ÚNotImplementedr!   r"   r#   r,   Úunionr    )r$   r3   r!   r"   r#   r   r   r   Ú__and__-   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   r,   ©r8   r   r   r   9   s   € z-Constraint.is_satisfied_by.<locals>.<genexpr>FT)Úprereleases)r#   Úallr!   ÚcontainsÚversion©r$   r8   r   r:   r   Úis_satisfied_by7   s   zConstraint.is_satisfied_by)r   r    )Ú__name__Ú
__module__Ú__qualname__r   r   r   r   r%   Úclassmethodr(   r   r-   r.   r0   r1   r7   r@   r   r   r   r   r       s$    ÿÿÿ
þ
r    c                   @   s^   e Zd Zedefdd„ƒZedefdd„ƒZdddefdd	„Z	de
fd
d„Zdefdd„ZdS )ÚRequirementr   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 overrideN©ÚNotImplementedErrorr/   r   r   r   Úproject_nameB   ó   zRequirement.project_namec                 C   rF   )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.
        rG   NrH   r/   r   r   r   ÚnameL   ó   zRequirement.namer8   r   c                 C   s   dS ©NFr   r?   r   r   r   r@   U   s   zRequirement.is_satisfied_byc                 C   rF   ©NrG   rH   r/   r   r   r   Úget_candidate_lookupX   r2   z Requirement.get_candidate_lookupc                 C   rF   rO   rH   r/   r   r   r   Úformat_for_error[   r2   zRequirement.format_for_errorN)rA   rB   rC   Úpropertyr   rJ   ÚstrrL   r.   r@   ÚCandidateLookuprP   rQ   r   r   r   r   rE   A   s    	rE   r,   r8   c                 C   s   |j r	t| |j ƒS dS rN   )Úsource_linkr   )r,   r8   r   r   r   r9   _   s   r9   c                   @   s¶   e Zd Zedefdd„ƒZedefdd„ƒZedefdd„ƒZ	ede
fdd	„ƒZede
fd
d„ƒZedee fdd„ƒZde
deee  fdd„Zdee fdd„Zdefdd„ZdS )r   r   c                 C   rF   )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 subclassNrH   r/   r   r   r   rJ   f   rK   zCandidate.project_namec                 C   rF   )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.
        rV   NrH   r/   r   r   r   rL   p   rM   zCandidate.namec                 C   rF   ©NrV   rH   r/   r   r   r   r>   y   ó   zCandidate.versionc                 C   rF   rW   rH   r/   r   r   r   Úis_installed}   rX   zCandidate.is_installedc                 C   rF   rW   rH   r/   r   r   r   Úis_editable�   rX   zCandidate.is_editablec                 C   rF   rW   rH   r/   r   r   r   rU   …   rX   zCandidate.source_linkÚwith_requiresc                 C   rF   rW   rH   )r$   r[   r   r   r   Úiter_dependencies‰   r2   zCandidate.iter_dependenciesc                 C   rF   rW   rH   r/   r   r   r   Úget_install_requirementŒ   r2   z!Candidate.get_install_requirementc                 C   rF   rO   rH   r/   r   r   r   rQ   �   r2   zCandidate.format_for_errorN)rA   rB   rC   rR   r   rJ   rS   rL   ÚCandidateVersionr>   r.   rY   rZ   r   r   rU   r   rE   r\   r   r]   rQ   r   r   r   r   r   e   s     	N)Útypingr   r   r   r   r   Z pip._vendor.packaging.specifiersr   Úpip._vendor.packaging.utilsr   r	   Zpip._vendor.packaging.versionr
   r   Úpip._internal.models.linkr   r   Zpip._internal.req.req_installr   Úpip._internal.utils.hashesr   rT   r^   rS   r   r    rE   r.   r9   r   r   r   r   r   Ú<module>   s    +