
    5>qj                        U d Z ddlmZ ddlZddlZddlZddlmZmZ ddl	m
Z
 ddlmZ dZ G d d	e      Zdad
ed<   	 	 d	 	 	 	 	 	 	 	 	 	 	 	 	 ddZddZddddd	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 ddZy)zN
A module that implements tooling to enable easy warnings about deprecations.
    )annotationsN)AnyTextIO)parse)__version__zDEPRECATION: c                      e Zd ZU dZded<   y)PipDeprecationWarningFboolinclude_sourceN)__name__
__module____qualname__r   __annotations__     ^/opt/rentech/trading_bot/.venv/lib/python3.12/site-packages/pip/_internal/utils/deprecation.pyr	   r	      s     ND r   r	   r   _original_showwarningc                (   |t         t        | |||||       y y t        |t              rXt        j                  d      }t        | t              r!| j                  r|j                  d| ||       y |j                  |        y t        | |||||       y )Nzpip._internal.deprecationsz
%s (%s:%s))r   
issubclassr	   logging	getLogger
isinstancer   warning)messagecategoryfilenamelinenofilelineloggers          r   _showwarningr!      s      ,!'8XvtTR -	H3	4 ""#?@g45':P:PNN<(FCNN7#gx64Nr   c                     t         j                  j                  dd       rt        j                  dt
               nt        j                  dt
        d       t         t        j                  at        t        _        y y )N_PIP_TEST_ENVerrordefaultT)append)	osenvirongetwarningssimplefilterr	   r   showwarningr!   r   r   r   install_warning_loggerr-   2   s[     
zz~~ot,g'<=i)>tL $ ( 4 4+ %r      F)feature_flagissue
stacklevelr   c                "   |duxr t        t              t        |      k\  }| t         df||sdndf|df||sdndf|dfg}dj                  d	 |D              }	|rt	        |	      t	        |	      }
||
_        t        j                  |
|
       y)a2  Helper 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.
    stacklevel:
        How many frames up the call stack to attribute the warning to.
        Defaults to 2 (the caller of deprecated()).
    include_source:
        If True, include the source filename and line number in the warning
        output. Useful when the warning originates from external code.
    Nz{}z*pip {} will enforce this behaviour change.z*Since pip {}, this is no longer supported.zA 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/{} c              3  L   K   | ]  \  }}|||j                  |        y w)N)format).0value
format_strs      r   	<genexpr>zdeprecated.<locals>.<genexpr>   s2      E:!e&7 	% s   "$)r1   )r   current_versionDEPRECATION_MSG_PREFIXjoinr	   r   r*   warn)reasonreplacementgone_inr/   r0   r1   r   is_gonemessage_partsr   r   s              r   
deprecatedrC   A   s    J T!NeO&<g&NG 
*+401  =A	
 +	

   X	
 N	
-M8 hh !. G #G,,#G,G+GMM'j1r   )NN)r   zWarning | strr   ztype[Warning]r   strr   intr   zTextIO | Noner   
str | NonereturnNone)rG   rH   )r>   rD   r?   rF   r@   rF   r/   rF   r0   z
int | Noner1   rE   r   r
   rG   rH   )__doc__
__future__r   r   r'   r*   typingr   r   pip._vendor.packaging.versionr   pipr   r:   r;   Warningr	   r   r   r!   r-   rC   r   r   r   <module>rO      s   #  	   / .( !G ! " s ! OOO O 	O
 O O 
O.,(  $ O2O2 O2 	O2
 O2 O2 O2 O2 
O2r   