‹“Reö ã@sÍdZddlmZddlZddlZddlmZddlmZ ddl m Z e rzddl m Z mZdZGd d „d eƒZdaddd d „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@seZdZdS)ÚPipDeprecationWarningN)Ú__name__Ú __module__Ú __qualname__©r r úŽ/builddir/build/BUILDROOT/alt-python35-pip-20.2.4-5.el8.x86_64/opt/alt/python35/lib/python3.5/site-packages/pip/_internal/utils/deprecation.pyrs rcCs|dk r4tdk r{t||||||ƒnGt|tƒrbtjdƒ}|j|ƒnt||||||ƒdS)Nzpip._internal.deprecations)Ú_original_showwarningÚ issubclassrÚloggingÚ getLoggerÚwarning)ÚmessageÚcategoryÚfilenameÚlinenoÚfileÚlineÚloggerr r r Ú _showwarning!s  rcCs8tjdtddƒtdkr4tjatt_dS)NÚdefaultÚappendT)ÚwarningsÚ simplefilterrrÚ showwarningrr r r r Úinstall_warning_logger2s  r cCs—|tdf|df|df|dfg}djdd„|Dƒƒ}|dk rzttƒt|ƒkrzt|ƒ‚tj|d 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/{}.ú css0|]&\}}|dk r|j|ƒVqdS)N)Úformat)Ú.0ÚvalÚtemplater r r ú aszdeprecated..NrÚ stacklevelé)ÚDEPRECATION_MSG_PREFIXÚjoinrÚcurrent_versionrrÚwarn)ÚreasonÚ replacementÚgone_inÚissueÚ sentencesrr r r Ú deprecated>s    $ r2)Ú__doc__Ú __future__rrrÚpip._vendor.packaging.versionrÚpiprr+Úpip._internal.utils.typingrÚtypingrrr)ÚWarningrrrr r2r r r r Ús