U ja @sUdZddlZddlZddlmZmZmZmZmZddl m Z ddl m Z dZGdddeZdaeed <deeefeeeeeeeedd d d Zdd ddZdeeeeeeeddddZdS)zN A module that implements tooling to enable easy warnings about deprecations. N)AnyOptionalTextIOTypeUnion)parse) __version__z DEPRECATION: c@s eZdZdS)PipDeprecationWarningN)__name__ __module__ __qualname__r r w/private/var/folders/k6/_7fsz4ts3b78x3b3xwrxjh_c8s8xv7/T/pip-unpacked-wheel-bug3gbve/pip/_internal/utils/deprecation.pyr sr _original_showwarning)messagecategoryfilenamelinenofilelinereturncCsZ|dk r$tdk rVt||||||n2t|trDtd}||nt||||||dS)Nzpip._internal.deprecations)r issubclassr logging getLoggerwarning)rrrrrrloggerr r r _showwarnings   r)rcCs(tjdtddtdkr$tjatt_dS)NdefaultT)append)warnings simplefilterr r showwarningrr r r rinstall_warning_logger,sr")reason replacementgone_inissuercCsh|tdf|df|df|dfg}ddd|D}|dk rTttt|krTt|tj|td d dS) 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. 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/{}. css$|]\}}|dk r||VqdS)N)format).0valtemplater r r `szdeprecated..N)r stacklevel)DEPRECATION_MSG_PREFIXjoinrcurrent_versionr rwarn)r#r$r%r& sentencesrr r r deprecated7s  r4)NN)N)__doc__rrtypingrrrrrpip._vendor.packaging.versionrpiprr1r/Warningr r__annotations__strintrr"r4r r r rs8