o
    6‘ðiN  ã                   @  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mZmZ eeƒZG d	d
„ d
eeeef ƒZG dd„ deeeef ƒZdS )é    )Úannotations)Údefaultdict)ÚMapping)Ú	getLogger)ÚAny)ÚBaseReporteré   )Ú	CandidateÚ
ConstraintÚRequirementc                   @  s"   e Zd Zdddd„Zddd„ZdS )ÚPipReporterNÚconstraintsúMapping[str, Constraint] | NoneÚreturnÚNonec                 C  s&   t tƒ| _|pi | _ddddœ| _d S )Nz�pip is looking at multiple versions of {package_name} to determine which version is compatible with other requirements. This could take a while.z–pip is still looking at multiple versions of {package_name} to determine which version is compatible with other requirements. This could take a while.zëThis is taking longer than usual. You might need to provide the dependency resolver with stricter constraints to reduce runtime. See https://pip.pypa.io/warnings/backtracking for guidance. If you want to abort this run, press Ctrl + C.)r   é   é   )r   ÚintÚreject_count_by_packageÚ_constraintsÚ_messages_at_reject_count)Úselfr   © r   úk/root/parts/websockify/install/lib/python3.10/site-packages/pip/_internal/resolution/resolvelib/reporter.pyÚ__init__   s   

ôzPipReporter.__init__Ú	criterionr   Ú	candidater	   c                 C  sð   | j |j  d7  < | j |j }|| jv r%| j| }t d|j|jd�¡ d}|jD ]&}|j|j}}|d7 }|rF||j› d|j	› d�7 }n|d7 }|| 
¡ 7 }q*| jrq|j}	| j |	¡}
|
rq|
jrq|	› |
 
¡ › �}|d	|› �7 }t |¡ d
S )zÀReport a candidate being rejected.

        Logs both the rejection count message (if applicable) and details about
        the requirements and constraints that caused the rejection.
        r   zINFO: %s)Úpackage_namez0Will try a different candidate, due to conflict:z
    ú z depends on zThe user requested z%
    The user requested (constraint) N)r   Únamer   ÚloggerÚinfoÚformatÚinformationÚrequirementÚparentÚversionÚformat_for_errorr   ÚgetÚ	specifierÚdebug)r   r   r   ÚcountÚmessageÚmsgÚreq_infoÚreqr%   r   Ú
constraintÚconstraint_textr   r   r   Úrejecting_candidate'   s(   



zPipReporter.rejecting_candidate)N)r   r   r   r   ©r   r   r   r	   r   r   )Ú__name__Ú
__module__Ú__qualname__r   r2   r   r   r   r   r      s    r   c                   @  sV   e Zd ZdZddd„Zddd	„Zd dd„Zd!dd„Zd"dd„Zd#dd„Z	d$dd„Z
dS )%ÚPipDebuggingReporterz9A reporter that does an info log for every event it sees.r   r   c                 C  s   t  d¡ d S )NzReporter.starting()©r    r!   )r   r   r   r   ÚstartingL   s   zPipDebuggingReporter.startingÚindexr   c                 C  ó   t  d|¡ d S )NzReporter.starting_round(%r)r8   )r   r:   r   r   r   Ústarting_roundO   ó   z#PipDebuggingReporter.starting_roundÚstater   c                 C  s   t  d|¡ t  d||¡ d S )Nz Reporter.ending_round(%r, state)zReporter.ending_round(%r, %r))r    r!   r*   )r   r:   r>   r   r   r   Úending_roundR   s   z!PipDebuggingReporter.ending_roundc                 C  r;   )NzReporter.ending(%r)r8   )r   r>   r   r   r   ÚendingV   r=   zPipDebuggingReporter.endingr$   r   r%   úCandidate | Nonec                 C  ó   t  d||¡ d S )Nz#Reporter.adding_requirement(%r, %r)r8   )r   r$   r%   r   r   r   Úadding_requirementY   s   z'PipDebuggingReporter.adding_requirementr   r   r	   c                 C  rB   )Nz$Reporter.rejecting_candidate(%r, %r)r8   )r   r   r   r   r   r   r2   ^   s   z(PipDebuggingReporter.rejecting_candidatec                 C  r;   )NzReporter.pinning(%r)r8   )r   r   r   r   r   Úpinninga   r=   zPipDebuggingReporter.pinningN)r   r   )r:   r   r   r   )r:   r   r>   r   r   r   )r>   r   r   r   )r$   r   r%   rA   r   r   r3   )r   r	   r   r   )r4   r5   r6   Ú__doc__r9   r<   r?   r@   rC   r2   rD   r   r   r   r   r7   I   s    





r7   N)Ú
__future__r   Úcollectionsr   Úcollections.abcr   Úloggingr   Útypingr   Ú pip._vendor.resolvelib.reportersr   Úbaser	   r
   r   r4   r    Ústrr   r7   r   r   r   r   Ú<module>   s    :