o
    0g                     @   s   U d Z ddlZddlZddlmZmZmZmZmZ ddl	m
Z
 ddlmZ dZG dd deZdaeed	< 		dd
eeef dee dededee dee ddfddZdddZ	ddedee dee dee ddf
ddZdS )zN
A module that implements tooling to enable easy warnings about deprecations.
    N)AnyOptionalTextIOTypeUnion)parse)__version__zDEPRECATION: c                   @   s   e Zd ZdS )PipDeprecationWarningN)__name__
__module____qualname__ r   r   f/home/www/bk.finsightngr.online/venv20/lib/python3.10/site-packages/pip/_internal/utils/deprecation.pyr	      s    r	   _original_showwarningmessagecategoryfilenamelinenofilelinereturnc                 C   sb   |d urt d urt | ||||| d S d S t|tr&td}||  d S t | ||||| d S )Nzpip._internal.deprecations)r   
issubclassr	   logging	getLoggerwarning)r   r   r   r   r   r   loggerr   r   r   _showwarning   s   

r   c                   C   s,   t jdtdd td u rt jatt _d S d S )NdefaultT)append)warningssimplefilterr	   r   showwarningr   r   r   r   r   install_warning_logger,   s
   
r"   reasonreplacementgone_inissuec                 C   sh   | t d f|df|df|dfg}ddd |D }|dur*ttt|kr*t|tj|td	d
 dS )a  Helper to deprecate existing functionality.

    reason:
        Textual reason shown to the user about why this functionality has
        been deprecated.
    replacement:
        Textual suggestion shown to the user about what alternative
        functionality they can use.
    gone_in:
        The version of pip does this functionality should get removed in.
        Raises errors if pip's current version is greater than or equal to
        this.
    issue:
        Issue number on the tracker that would serve as a useful place for
        users to find related discussion and provide feedback.

    Always pass replacement, gone_in and issue as keyword arguments for clarity
    at the call site.
    z{}z2pip {} will remove support for this functionality.zA possible replacement is {}.zPYou can find discussion regarding this at https://github.com/pypa/pip/issues/{}. c                 s   s&    | ]\}}|d ur| |V  qd S N)format).0valtemplater   r   r   	<genexpr>`   s    
zdeprecated.<locals>.<genexpr>N   )r   
stacklevel)DEPRECATION_MSG_PREFIXjoinr   current_versionr	   r   warn)r#   r$   r%   r&   	sentencesr   r   r   r   
deprecated7   s   

r5   )NN)r   Nr(   )__doc__r   r   typingr   r   r   r   r   Zpip._vendor.packaging.versionr   pipr   r2   r0   Warningr	   r   __annotations__strintr   r"   r5   r   r   r   r   <module>   sN    	


