o
    ©„j¹  ã                   @  s¦   U d Z ddlmZ ddl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/django_cbt/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  sH   t j dd ¡rt dt¡ ntjdtdd� td u r"tjatt_d S d S )NÚ_PIP_TEST_ENVÚerrorÚdefaultT)Úappend)	ÚosÚenvironÚgetÚwarningsÚsimplefilterr   r   Úshowwarningr%   r   r   r   r   Úinstall_warning_logger2   s   
þr0   é   F)Úfeature_flagÚissueÚ
stacklevelr	   ÚreasonÚreplacementÚgone_inr2   r3   ú
int | Noner4   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>)r4   )r   Úcurrent_versionÚDEPRECATION_MSG_PREFIXÚjoinr   r	   r-   Úwarn)r5   r6   r7   r2   r3   r4   r	   Úis_goneÚmessage_partsr   r#   r   r   r   Ú
deprecatedA   s6   %ÿû	þÿû	þê
þrE   )NN)r   r   r   r   r   r   r   r   r   r   r   r   r   r   )r   r   )r5   r   r6   r   r7   r   r2   r   r3   r8   r4   r   r	   r   r   r   )Ú__doc__Ú
__future__r   r    r*   r-   Útypingr   r   Úpip._vendor.packaging.versionr   Úpipr   r?   r@   ÚWarningr   r   r   r%   r0   rE   r   r   r   r   Ú<module>   s(    	ú
ø