3
ûâdeÞ	  ã               @   sp   d dl mZ d dlmZ d dlmZmZ d dlmZ ddl	m
Z
mZ eeƒZG dd„ deƒZG d	d
„ d
eƒZdS )é    )Údefaultdict)Ú	getLogger)ÚAnyÚDefaultDict)ÚBaseReporteré   )Ú	CandidateÚRequirementc               @   s*   e Zd Zddœdd„Zeddœdd„ZdS )ÚPipReporterN)Úreturnc             C   s   t tƒ| _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ë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Úbacktracks_by_packageÚ_messages_at_backtrack)Úself© r   úK/tmp/pip-build-red6nood/pip/pip/_internal/resolution/resolvelib/reporter.pyÚ__init__   s    
zPipReporter.__init__)Ú	candidater   c             C   sR   | j |j  d7  < | j |j }|| jkr.d S | j| }tjd|j|jd�ƒ d S )Nr   zINFO: %s)Úpackage_name)r   Únamer   ÚloggerÚinfoÚformat)r   r   ÚcountÚmessager   r   r   Úbacktracking#   s    

zPipReporter.backtracking)Ú__name__Ú
__module__Ú__qualname__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ddœdd„Z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.N)r   c             C   s   t jdƒ d S )NzReporter.starting())r   r   )r   r   r   r   Ústarting1   s    zPipDebuggingReporter.starting)Úindexr   c             C   s   t jd|ƒ d S )NzReporter.starting_round(%r))r   r   )r   r#   r   r   r   Ústarting_round4   s    z#PipDebuggingReporter.starting_round)r#   Ústater   c             C   s   t jd|ƒ d S )Nz Reporter.ending_round(%r, state))r   r   )r   r#   r%   r   r   r   Úending_round7   s    z!PipDebuggingReporter.ending_round)r%   r   c             C   s   t jd|ƒ d S )NzReporter.ending(%r))r   r   )r   r%   r   r   r   Úending:   s    zPipDebuggingReporter.ending)ÚrequirementÚparentr   c             C   s   t jd||ƒ d S )Nz#Reporter.adding_requirement(%r, %r))r   r   )r   r(   r)   r   r   r   Úadding_requirement=   s    z'PipDebuggingReporter.adding_requirement)r   r   c             C   s   t jd|ƒ d S )NzReporter.backtracking(%r))r   r   )r   r   r   r   r   r   @   s    z!PipDebuggingReporter.backtrackingc             C   s   t jd|ƒ d S )NzReporter.pinning(%r))r   r   )r   r   r   r   r   ÚpinningC   s    zPipDebuggingReporter.pinning)r   r   r    Ú__doc__r"   r   r$   r   r&   r'   r	   r   r*   r   r+   r   r   r   r   r!   .   s   r!   N)Úcollectionsr   Úloggingr   Útypingr   r   Z pip._vendor.resolvelib.reportersr   Úbaser   r	   r   r   r
   r!   r   r   r   r   Ú<module>   s   "