3 (\ @sdZddlmZddlZddlZddlmZddlmZ ddl m Z e rXddl m Z mZdZGd d d eZdadd d Zd dZdddZdS)zN A module that implements tooling to enable easy warnings about deprecations. )absolute_importN)parse) __version__)MYPY_CHECK_RUNNING)AnyOptionalz DEPRECATION: c@s eZdZdS)PipDeprecationWarningN)__name__ __module__ __qualname__r r r/private/var/folders/pf/wv4htv3x0qs2c2mp0dnn0kchsvlck3/T/pip-build-k1a8l1r5/pip/pip/_internal/utils/deprecation.pyrsrcCsZ|dk r$tdk rVt||||||n2t|trDtjd}|j|nt||||||dS)Nzpip._internal.deprecations)_original_showwarning issubclassrlogging getLoggerwarning)messagecategoryfilenamelinenofilelineloggerr r r _showwarnings   rcCs(tjdtddtdkr$tjatt_dS)NdefaultT)append)warnings simplefilterrr showwarningrr r r r install_warning_logger.sr cCstt|}|dk r|dj|7}|dk r@dt|}|dj|7}|dk r`ttt|kr`t|tj|tdddS)aHelper 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. Nz A possible replacement is {}.z#https://github.com/pypa/pip/issues/z. You can find discussion regarding this at {}.)r stacklevel)DEPRECATION_MSG_PREFIXformatstrrcurrent_versionrrwarn)reason replacementZgone_inZissuerurlr r r deprecated:s r+)NN)N)__doc__ __future__rrrZpip._vendor.packaging.versionrpiprr&Zpip._internal.utils.typingrZtypingrrr#Warningrrrr r+r r r r s