o
    j                     @  s   U d Z ddlmZ ddlZddlZddlmZmZ ddlm	Z	 ddl
mZ dZG dd	 d	eZdad
ed< 		d,d-ddZd.ddZddddd d/d*d+ZdS )0zN
A module that implements tooling to enable easy warnings about deprecations.
    )annotationsN)AnyTextIO)parse)__version__zDEPRECATION: c                   @  s   e Zd ZU dZded< dS )PipDeprecationWarningFboolinclude_sourceN)__name__
__module____qualname__r	   __annotations__ r   r   `/var/www/html/Deteccion_Ine/venv/lib/python3.10/site-packages/pip/_internal/utils/deprecation.pyr      s   
 r   r   _original_showwarningmessageWarning | strcategorytype[Warning]filenamestrlinenointfileTextIO | Noneline
str | NonereturnNonec                 C  s   |d urt d urt | ||||| d S d S t|tr8td}t| tr1| jr1|d| || d S ||  d S t | ||||| d S )Nzpip._internal.deprecationsz
%s (%s:%s))r   
issubclassr   logging	getLogger
isinstancer	   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_logger1   s
   
r+      F)feature_flagissue
stacklevelr	   reasonreplacementgone_inr-   r.   
int | Noner/   r	   r   c                 C  s   |duot tt |k}| t df||sdndf|df||s!dndf|dfg}dd	d
 |D }	|r8t|	t|	}
||
_tj|
|d dS )a2  Helper to deprecate existing functionality.

    reason:
        Textual reason shown to the user about why this functionality has
        been deprecated. Should be a complete sentence.
    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 an error if pip's current version is greater than or equal to
        this.
    feature_flag:
        Command-line flag of the form --use-feature={feature_flag} for testing
        upcoming functionality.
    issue:
        Issue number on the tracker that would serve as a useful place for
        users to find related discussion and provide feedback.
    stacklevel:
        How many frames up the call stack to attribute the warning to.
        Defaults to 2 (the caller of deprecated()).
    include_source:
        If True, include the source filename and line number in the warning
        output. Useful when the warning originates from external code.
    Nz{}z*pip {} will enforce this behaviour change.z*Since pip {}, this is no longer supported.zA possible replacement is {}.zEYou can use the flag --use-feature={} to test the upcoming behaviour.z@Discussion can be found at https://github.com/pypa/pip/issues/{} c                 s  s.    | ]\}}|d ur|d ur| |V  qd S )N)format).0value
format_strr   r   r   	<genexpr>   s    zdeprecated.<locals>.<genexpr>)r/   )r   current_versionDEPRECATION_MSG_PREFIXjoinr   r	   r(   warn)r0   r1   r2   r-   r.   r/   r	   is_gonemessage_partsr   r#   r   r   r   
deprecated<   s6   %		
r@   )NN)r   r   r   r   r   r   r   r   r   r   r   r   r   r   )r   r   )r0   r   r1   r   r2   r   r-   r   r.   r3   r/   r   r	   r   r   r   )__doc__
__future__r   r    r(   typingr   r   Zpip._vendor.packaging.versionr   pipr   r:   r;   Warningr   r   r   r%   r+   r@   r   r   r   r   <module>   s&    	
