a [f+ @sUdZddlZddlZddlmZmZmZmZmZddl m Z ddl m Z dZGdddeZdaeed <deeefeeeeeeeedd d d Zdd ddZdddeeeeeeeeeddddZdS)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 C/usr/lib/python3.9/site-packages/pip/_internal/utils/deprecation.pyr sr _original_showwarning)messagecategoryfilenamelinenofilelinereturncCsZ|dur$tdurVt||||||n2t|trDtd}||nt||||||dS)Nzpip._internal.deprecations)r issubclassr loggingZ getLoggerZwarning)rrrrrrloggerr r r _showwarnings   r)rcCs(tjdtddtdur$tjatt_dS)NdefaultT)append)warnings simplefilterr r showwarningrr r r rinstall_warning_logger,sr ) feature_flagissue)reason replacementgone_inr!r"rcCs|duottt|k}|tdf||s.dndf|df||sBdndf|dfg}dd d |D}|rpt|tj|td d 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).0valueZ format_strr r r nszdeprecated..)r stacklevel)rcurrent_versionDEPRECATION_MSG_PREFIXjoinr rwarn)r#r$r%r!r"Zis_goneZ message_partsrr r r deprecated7s2  r1)NN)__doc__rrtypingrrrrrZpip._vendor.packaging.versionrZpiprr-r.Warningr r__annotations__strintrr r1r r r rs<