3
”Reö ã @ s� d Z ddlmZ ddlZddlZddlmZ ddlmZ ddl
mZ erXddlm
Z
mZ dZG d d
„ d
eƒZdaddd„Zd
d„ Zddd„ZdS )zN
A module that implements tooling to enable easy warnings about deprecations.
é )Úabsolute_importN)Úparse)Ú__version__)ÚMYPY_CHECK_RUNNING)ÚAnyÚOptionalz
DEPRECATION: c @ s e Zd ZdS )ÚPipDeprecationWarningN)Ú__name__Ú
__module__Ú__qualname__© r r úŽ/builddir/build/BUILDROOT/alt-python36-pip-20.2.4-5.el8.x86_64/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/utils/deprecation.pyr s r c C sZ |d k r$t d k rVt | |||||ƒ n2t|tƒrDtjdƒ}|j| ƒ nt | |||||ƒ d S )Nzpip._internal.deprecations)Ú_original_showwarningÚ
issubclassr ÚloggingÚ getLoggerÚwarning)ÚmessageÚcategoryÚfilenameÚlinenoÚfileÚlineÚloggerr r r
Ú_showwarning! s
r c C s( t jdtdd� td kr$t jatt _d S )NÚdefaultT)Úappend)ÚwarningsÚsimplefilterr r Úshowwarningr r r r r
Úinstall_warning_logger2 s r c C sh | t d f|df|df|dfg}djdd„ |D ƒƒ}|dk rTttƒt|ƒkrTt|ƒ‚tj|td d
� dS )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.zA possible replacement is {}.zPYou can find discussion regarding this at https://github.com/pypa/pip/issues/{}.ú c s s$ | ]\}}|d k r|j |ƒV qd S )N)Úformat)Ú.0ÚvalÚtemplater r r
ú