Current File : //lib/python3.9/site-packages/pip/_internal/utils/__pycache__/deprecation.cpython-39.pyc
a

[��f+�	@s�UdZddlZddlZddlmZmZmZmZmZddl	m
Z
ddlmZ
dZGdd�de�Zdaeed	<deeefeeeeeeeedd
�dd�Zdd
�dd�Zddd�eeeeeeeeedd�dd�ZdS)zN
A module that implements tooling to enable easy warnings about deprecations.
�N)�Any�Optional�TextIO�Type�Union)�parse)�__version__z
DEPRECATION: c@seZdZdS)�PipDeprecationWarningN)�__name__�
__module__�__qualname__�r
r
�C/usr/lib/python3.9/site-packages/pip/_internal/utils/deprecation.pyr	sr	�_original_showwarning)�message�category�filename�lineno�file�line�returncCsZ|dur$tdurVt||||||�n2t|t�rDt�d�}|�|�nt||||||�dS)Nzpip._internal.deprecations)r�
issubclassr	�loggingZ	getLoggerZwarning)rrrrrr�loggerr
r
r�_showwarnings

r)rcCs(tjdtdd�tdur$tjatt_dS)N�defaultT)�append)�warnings�simplefilterr	r�showwarningrr
r
r
r�install_warning_logger,sr )�feature_flag�issue)�reason�replacement�gone_inr!r"rcCs�|duott�t|�k}|t�d�f||s.dndf|df||sBdndf|dfg}d�d	d
�|D��}|rpt|��tj|tdd�dS)
aHelper 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.
    Nz{}z*pip {} will enforce this behaviour change.z*Since pip {}, this is no longer supported.zA 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/{}� css,|]$\}}|dur|dur|�|�VqdS)N)�format)�.0�valueZ
format_strr
r
r�	<genexpr>ns�zdeprecated.<locals>.<genexpr>�)r�
stacklevel)r�current_version�DEPRECATION_MSG_PREFIX�joinr	r�warn)r#r$r%r!r"Zis_goneZ
message_partsrr
r
r�
deprecated7s2�������
�r1)NN)�__doc__rr�typingrrrrrZpip._vendor.packaging.versionrZpiprr-r.�Warningr	r�__annotations__�str�intrr r1r
r
r
r�<module>s<	�
���