a
    ˆÀàgÅ  ã                   @   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	 e	r„d dl
mZmZmZmZ d dlmZ d dlmZ eed	 ee f Zd
d„ ZG dd„ deƒZG dd„ deƒZG dd	„ d	eƒZdS )é    )ÚSpecifierSet©Úcanonicalize_name)ÚInstallRequirement)ÚHashes)ÚMYPY_CHECK_RUNNING)Ú	FrozenSetÚIterableÚOptionalÚTuple)Ú_BaseVersion)ÚLinkÚ	Candidatec                 C   s,   |s| S t dd„ |D ƒƒ}d | d |¡¡S )Nc                 s   s   | ]}t |ƒV  qd S ©Nr   )Ú.0Úe© r   úa/var/www/sistema_ama/venv/lib/python3.9/site-packages/pip/_internal/resolution/resolvelib/base.pyÚ	<genexpr>   ó    zformat_name.<locals>.<genexpr>z{}[{}]ú,)ÚsortedÚformatÚjoin)ÚprojectÚextrasZcanonical_extrasr   r   r   Úformat_name   s    r   c                   @   sL   e Zd Zdd„ Zedd„ ƒZedd„ ƒZdd„ Zd	d
„ Zdd„ Z	dd„ Z
dS )Ú
Constraintc                 C   s   || _ || _d S r   )Ú	specifierÚhashes)Úselfr   r   r   r   r   Ú__init__   s    zConstraint.__init__c                 C   s   t tƒ tƒ ƒS r   )r   r   r   )Úclsr   r   r   Úempty#   s    zConstraint.emptyc                 C   s   t |j|jdd�ƒS ©NF)Útrust_internet)r   r   r   )r"   Úireqr   r   r   Ú	from_ireq(   s    zConstraint.from_ireqc                 C   s   t | jƒpt | jƒS r   )Úboolr   r   ©r    r   r   r   Ú__nonzero__-   s    zConstraint.__nonzero__c                 C   s   |   ¡ S r   )r*   r)   r   r   r   Ú__bool__1   s    zConstraint.__bool__c                 C   s6   t |tƒstS | j|j@ }| j|jdd�@ }t||ƒS r$   )Ú
isinstancer   ÚNotImplementedr   r   r   )r    Úotherr   r   r   r   r   Ú__and__5   s
    
zConstraint.__and__c                 C   s   | j j|jdd�S )NT)Úprereleases)r   ÚcontainsÚversion©r    Ú	candidater   r   r   Úis_satisfied_by=   s    zConstraint.is_satisfied_byN)Ú__name__Ú
__module__Ú__qualname__r!   Úclassmethodr#   r'   r*   r+   r/   r5   r   r   r   r   r      s   

r   c                   @   s<   e Zd Zedd„ ƒZedd„ ƒZdd„ Zdd„ Zd	d
„ ZdS )ÚRequirementc                 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_nameF   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.
        r;   Nr<   r)   r   r   r   ÚnameQ   s    zRequirement.namec                 C   s   dS )NFr   r3   r   r   r   r5   [   s    zRequirement.is_satisfied_byc                 C   s   t dƒ‚d S ©Nr;   r<   r)   r   r   r   Úget_candidate_lookup_   s    z Requirement.get_candidate_lookupc                 C   s   t dƒ‚d S r@   r<   r)   r   r   r   Úformat_for_errorc   s    zRequirement.format_for_errorN)	r6   r7   r8   Úpropertyr>   r?   r5   rA   rB   r   r   r   r   r:   E   s   


	r:   c                   @   sl   e Zd Zedd„ ƒZedd„ ƒZedd„ ƒZedd„ ƒZed	d
„ ƒZedd„ ƒZ	dd„ Z
dd„ Zdd„ ZdS )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 subclassNr<   r)   r   r   r   r>   i   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.
        rD   Nr<   r)   r   r   r   r?   t   s    zCandidate.namec                 C   s   t dƒ‚d S ©NrD   r<   r)   r   r   r   r2   ~   s    zCandidate.versionc                 C   s   t dƒ‚d S rE   r<   r)   r   r   r   Úis_installedƒ   s    zCandidate.is_installedc                 C   s   t dƒ‚d S rE   r<   r)   r   r   r   Úis_editableˆ   s    zCandidate.is_editablec                 C   s   t dƒ‚d S rE   r<   r)   r   r   r   Úsource_link�   s    zCandidate.source_linkc                 C   s   t dƒ‚d S rE   r<   )r    Úwith_requiresr   r   r   Úiter_dependencies’   s    zCandidate.iter_dependenciesc                 C   s   t dƒ‚d S rE   r<   r)   r   r   r   Úget_install_requirement–   s    z!Candidate.get_install_requirementc                 C   s   t dƒ‚d S r@   r<   r)   r   r   r   rB   š   s    zCandidate.format_for_errorN)r6   r7   r8   rC   r>   r?   r2   rF   rG   rH   rJ   rK   rB   r   r   r   r   r   h   s   


	



N)Z pip._vendor.packaging.specifiersr   Úpip._vendor.packaging.utilsr   Úpip._internal.req.req_installr   Úpip._internal.utils.hashesr   Úpip._internal.utils.typingr   Útypingr   r	   r
   r   Úpip._vendor.packaging.versionr   Úpip._internal.models.linkr   ZCandidateLookupr   Úobjectr   r:   r   r   r   r   r   Ú<module>   s"   ÿÿ(#