
    ,iE                        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
eeeef         Z G d deeeef         Zy)    )annotations)defaultdict)Mapping)	getLogger)Any)BaseReporter   )	Candidate
ConstraintRequirementc                      e Zd ZdddZddZy)PipReporterNc                X    t        t              | _        |xs i | _        dddd| _        y )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)selfconstraintss     `/var/www/mymood/env/lib/python3.12/site-packages/pip/_internal/resolution/resolvelib/reporter.py__init__zPipReporter.__init__   s6    >I#>N$'-29
9
K*
&    c                   | j                   |j                  xx   dz  cc<   | j                   |j                     }|| j                  v r?| j                  |   }t        j	                  d|j                  |j                               d}|j                  D ]Y  }|j                  |j                  }}|dz  }|r ||j                   d|j                   dz  }n|dz  }||j                         z  }[ | j                  rM|j                  }	| j                  j                  |	      }
|
r$|
j                  r|	 |
j                   }|d	| z  }t        j                  |       y
)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   	criterion	candidatecountmessagemsgreq_inforeqr$   r   
constraintconstraint_texts               r   rejecting_candidatezPipReporter.rejecting_candidate'   sH    	$$Y^^494,,Y^^<D22244U;GKK
GNN	N$OP@!--H"..C8OC&++a'7|DD,,3''))C . >>D**..t4Jj22%)F:+?+?*@"A??PQQSr   )N)r   zMapping[str, Constraint] | NonereturnNoner*   r   r+   r
   r4   r5   )__name__
__module____qualname__r   r3    r   r   r   r      s    
.r   r   c                  T    e Zd ZdZd
dZddZddZddZ	 	 	 	 	 	 ddZddZ	ddZ
y	)PipDebuggingReporterz9A reporter that does an info log for every event it sees.c                .    t         j                  d       y )NzReporter.starting()r   r    )r   s    r   startingzPipDebuggingReporter.startingL   s    )*r   c                0    t         j                  d|       y )NzReporter.starting_round(%r)r>   )r   indexs     r   starting_roundz#PipDebuggingReporter.starting_roundO   s    159r   c                ^    t         j                  d|       t         j                  d||       y )Nz Reporter.ending_round(%r, state)zReporter.ending_round(%r, %r))r   r    r)   )r   rA   states      r   ending_roundz!PipDebuggingReporter.ending_roundR   s"    6>4eUCr   c                0    t         j                  d|       y )NzReporter.ending(%r)r>   )r   rD   s     r   endingzPipDebuggingReporter.endingV   s    )51r   c                2    t         j                  d||       y )Nz#Reporter.adding_requirement(%r, %r)r>   )r   r#   r$   s      r   adding_requirementz'PipDebuggingReporter.adding_requirementY   s     	9;Or   c                2    t         j                  d||       y )Nz$Reporter.rejecting_candidate(%r, %r)r>   )r   r*   r+   s      r   r3   z(PipDebuggingReporter.rejecting_candidate^   s    :IyQr   c                0    t         j                  d|       y )NzReporter.pinning(%r)r>   )r   r+   s     r   pinningzPipDebuggingReporter.pinninga   s    *I6r   N)r4   r5   )rA   r   r4   r5   )rA   r   rD   r   r4   r5   )rD   r   r4   r5   )r#   r   r$   zCandidate | Noner4   r5   r6   )r+   r
   r4   r5   )r7   r8   r9   __doc__r?   rB   rE   rG   rI   r3   rL   r:   r   r   r<   r<   I   sF    C+:D2P&P0@P	P
R7r   r<   N)
__future__r   collectionsr   collections.abcr   loggingr   typingr    pip._vendor.resolvelib.reportersr   baser
   r   r   r7   r   strr   r<   r:   r   r   <module>rV      sX    " # #   9 4 4	8	7,{Is:; 7t7<Y(CD 7r   