a
    $lJh                     @   s   d dl mZ d dlmZ d dlmZmZmZ d dlm	Z	 ddl
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 )    )defaultdict)	getLogger)AnyDefaultDictOptional)BaseReporter   )	CandidateRequirementc                   @   s,   e Zd ZddddZeeddddZdS )PipReporterNreturnc                 C   s   t t| _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_messages_at_reject_countself r   ^/var/www/shaz/venv/lib/python3.9/site-packages/pip/_internal/resolution/resolvelib/reporter.py__init__   s
    
zPipReporter.__init__	criterion	candidater   c           	      C   s   | j |j  d7  < | j |j }|| jvr.d S | j| }td|j|jd d}|jD ]L}|j|j }}|d7 }|r||j d|j	 d7 }n|d7 }||
 7 }qXt| d S )	Nr   zINFO: %s)package_namez0Will try a different candidate, due to conflict:z
     z depends on zThe user requested )r   namer   loggerinfoformatinformationrequirementparentversionformat_for_errordebug)	r   r   r   countmessagemsgZreq_inforeqr#   r   r   r   rejecting_candidate#   s    


zPipReporter.rejecting_candidate)__name__
__module____qualname__r   r   r	   r+   r   r   r   r   r      s   r   c                   @   s   e Zd ZdZddddZeddddZeedd	d
dZeddddZ	e
ee ddddZeeddddZeddddZdS )PipDebuggingReporterz9A reporter that does an info log for every event it sees.Nr   c                 C   s   t d d S )NzReporter.starting()r   r   r   r   r   r   starting=   s    zPipDebuggingReporter.starting)indexr   c                 C   s   t d| d S )NzReporter.starting_round(%r)r0   )r   r2   r   r   r   starting_round@   s    z#PipDebuggingReporter.starting_round)r2   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   r2   r4   r   r   r   ending_roundC   s    z!PipDebuggingReporter.ending_round)r4   r   c                 C   s   t d| d S )NzReporter.ending(%r)r0   )r   r4   r   r   r   endingG   s    zPipDebuggingReporter.ending)r"   r#   r   c                 C   s   t d|| d S )Nz#Reporter.adding_requirement(%r, %r)r0   )r   r"   r#   r   r   r   adding_requirementJ   s    z'PipDebuggingReporter.adding_requirementr   c                 C   s   t d|| d S )Nz$Reporter.rejecting_candidate(%r, %r)r0   )r   r   r   r   r   r   r+   O   s    z(PipDebuggingReporter.rejecting_candidate)r   r   c                 C   s   t d| d S )NzReporter.pinning(%r)r0   )r   r   r   r   r   pinningR   s    zPipDebuggingReporter.pinning)r,   r-   r.   __doc__r1   r   r3   r   r5   r6   r
   r   r	   r7   r+   r8   r   r   r   r   r/   :   s   r/   N)collectionsr   loggingr   typingr   r   r    pip._vendor.resolvelib.reportersr   baser	   r
   r,   r   strr   r/   r   r   r   r   <module>   s   .