a
    baiE                     @  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 )Nzpip is looking at multiple versions of {package_name} to determine which version is compatible with other requirements. This could take a while.zpip is still looking at multiple versions of {package_name} to determine which version is compatible with other requirements. This could take a while.zThis 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   f/var/www/html/SiteWeb/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 )zReport 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msgZreq_inforeqr%   r   
constraintZconstraint_textr   r   r   rejecting_candidate'   s(    



zPipReporter.rejecting_candidate)N)__name__
__module____qualname__r   r0   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)r5   )r   r7   r   r   r   starting_roundO   s    z#PipDebuggingReporter.starting_roundr   )r7   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   r7   r9   r   r   r   ending_roundR   s    z!PipDebuggingReporter.ending_round)r9   r   c                 C  s   t d| d S )NzReporter.ending(%r)r5   )r   r9   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)r5   )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)r5   )r   r   r   r   r   r   r0   ^   s    z(PipDebuggingReporter.rejecting_candidate)r   r   c                 C  s   t d| d S )NzReporter.pinning(%r)r5   )r   r   r   r   r   pinninga   s    zPipDebuggingReporter.pinningN)r1   r2   r3   __doc__r6   r8   r:   r;   r<   r0   r=   r   r   r   r   r4   I   s   r4   N)
__future__r   collectionsr   collections.abcr   loggingr   typingr    pip._vendor.resolvelib.reportersr   baser	   r
   r   r1   r    strr   r4   r   r   r   r   <module>   s   :