a
    <BìjE  ã                   @  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                   @  s0   e Zd Zddddœdd„Zdddd	œd
d„ZdS )ÚPipReporterNzMapping[str, Constraint] | NoneÚNone)ÚconstraintsÚreturnc                 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/mnt/bigstor/www/usecases/.venv/lib/python3.9/site-packages/pip/_internal/resolution/resolvelib/reporter.pyÚ__init__   s    

ôzPipReporter.__init__r   r	   ©Ú	criterionÚ	candidater   c                 C  sî   | j |j  d7  < | j |j }|| jv rJ| j| }t d|j|jd�¡ d}|jD ]L}|j|j }}|d7 }|rŒ||j› d|j	› d�7 }n|d7 }|| 
¡ 7 }qT| jrà|j}	| j |	¡}
|
rà|
jrà|	› |
j› �}|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ÚformatZinformationÚrequirementÚparentÚversionZformat_for_errorr   ÚgetÚ	specifierÚdebug)r   r   r   ÚcountÚmessageÚmsgZreq_infoÚreqr$   r   Ú
constraintZconstraint_textr   r   r   Úrejecting_candidate'   s(    



zPipReporter.rejecting_candidate)N)Ú__name__Ú
__module__Ú__qualname__r   r.   r   r   r   r   r      s   r   c                   @  s„   e Zd ZdZddœdd„Zdddœdd	„Zdd
ddœdd„Zd
ddœdd„Zddddœdd„Zd
dddœdd„Z	dd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.startingr   )Úindexr   c                 C  s   t  d|¡ d S )NzReporter.starting_round(%r)r3   )r   r5   r   r   r   Ústarting_roundO   s    z#PipDebuggingReporter.starting_roundr   )r5   Ú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   r5   r7   r   r   r   Úending_roundR   s    z!PipDebuggingReporter.ending_round)r7   r   c                 C  s   t  d|¡ d S )NzReporter.ending(%r)r3   )r   r7   r   r   r   ÚendingV   s    zPipDebuggingReporter.endingr   zCandidate | None)r#   r$   r   c                 C  s   t  d||¡ d S )Nz#Reporter.adding_requirement(%r, %r)r3   )r   r#   r$   r   r   r   Úadding_requirementY   s    z'PipDebuggingReporter.adding_requirementr	   r   c                 C  s   t  d||¡ d S )Nz$Reporter.rejecting_candidate(%r, %r)r3   )r   r   r   r   r   r   r.   ^   s    z(PipDebuggingReporter.rejecting_candidate)r   r   c                 C  s   t  d|¡ d S )NzReporter.pinning(%r)r3   )r   r   r   r   r   Úpinninga   s    zPipDebuggingReporter.pinningN)r/   r0   r1   Ú__doc__r4   r6   r8   r9   r:   r.   r;   r   r   r   r   r2   I   s   r2   N)Ú
__future__r   Úcollectionsr   Úcollections.abcr   Úloggingr   Útypingr   Z pip._vendor.resolvelib.reportersr   Úbaser	   r
   r   r/   r    Ústrr   r2   r   r   r   r   Ú<module>   s   :