+
    uG9j;                    @  a  0 t $ R t^ RIHt ^ RIt^ RIt^ RIHt ^ RIH	t	 ^ RI
Ht ^ RIHt ^ RIHt ]'       dB   ^ RIHtHt ^ R	IHtHtHt ^ R
IHtHt ^ RIHt ]! R4      t]! R4      t]! R]],          R7      t ! R R]4      t ! R R4      t ] ! ]4      t!R]"R&   R# )z
Reusable helpers for deprecating functionality.

Note: most of this file has been copied from conda's implementation. Usage
documentation can be found here: https://docs.conda.io/projects/conda/en/latest/dev-guide/deprecations.html

)annotationsN)Action)wraps)
ModuleType)TYPE_CHECKING)__version__)ArgumentParser	Namespace)AnyCallableTypeVar)	ParamSpecSelf)VersionTP
ActionType)boundc                      ] tR t^#tRtR# )DeprecatedError N)__name__
__module____qualname____firstlineno____static_attributes__r       >lib/python3.14/site-packages/anaconda_cli_base/deprecations.pyr   r   #   s    r   r   c                     ] tR t^)t$ R]R&   R]R&   R]R&   R R lt]R	 R
 l4       tR R ltRRR^ /R R llt	RRRRR^ /R R llt
RRR^ /R R lltRRR^ /R R lltRRR^ /R R lltRRR^ /R R lltR R ltR]/R  R! lltR"tR# )#DeprecationHandler
str | None_versiontuple[int, ...] | None_version_tuplezVersion | None_version_objectc               $    V ^8  d   QhRRRRRR/# )   selfr   versionstrreturnNoner   )formats   "r   __annotate__DeprecationHandler.__annotate__.   s!     $ $t $c $d $r   c                L    Wn         V P                  V4      V n        RV n        R# )zFactory to create a deprecation handle for the specified version.

Args:
    version: The version to compare against when checking deprecation statuses.

N)r!   _get_version_tupler#   r$   )r'   r(   s   &&r   __init__DeprecationHandler.__init__.   s&       #55g>#r   c                    V ^8  d   QhRRRR/# )r&   r(   r)   r*   r"   r   )r,   s   "r   r-   r.   <   s     
 
C 
,B 
r   c                    \         ;QJ d1    . R V P                  4       P                  R4       4       F  NK  	  5M*! R V P                  4       P                  R4       4       4      ;'       g    R#   \        \        3 d     R# i ; i)zpReturn version as non-empty tuple of ints if possible, else None.

Args:
    version: Version string to parse.

c              3  8   "   T F  p\        V4      x  K  	  R # 5iN)int).0parts   & r   	<genexpr>8DeprecationHandler._get_version_tuple.<locals>.<genexpr>D   s     J/ItT/Is   .N)tuplestripsplitAttributeError
ValueError)r(   s   &r   r0   %DeprecationHandler._get_version_tuple;   sg    	5Jw}}/D/DS/IJ55Jw}}/D/DS/IJJRRdR
+ 		s   
A2 A!A2 /A2 2BBc               $    V ^8  d   QhRRRRRR/# )r&   r'   r   r(   r)   r*   boolr   )r,   s   "r   r-   r.   H   s!     5 5 5 5 5r   c                4   V P                   '       d)   V P                  V4      ;p'       d   V P                   V8  # ^ RIHp V P                  f    V! V P
                  4      V n        V P                  V! V4      8  #   \         d    T! R4      T n         L/i ; i)zqTest whether own version is less than the given version.

Args:
    version: Version string to compare against.

)parsez0.0.0.dev0+placeholder)r#   r0   packaging.versionrF   r$   r!   	TypeError)r'   r(   version_tuplerF   s   &&  r   _version_less_than%DeprecationHandler._version_less_thanH   s     T5L5LW5U$UM$U&&66
 	,'G',T]]';$ ##eGn44  G',-E'F$Gs   A< <BBaddendumNstackc               0    V ^8  d   QhRRRRRRRRRR	R
R/# )r&   r'   r   deprecate_inr)   	remove_inrL   r    rM   r7   r*   *Callable[[Callable[P, T]], Callable[P, T]]r   )r,   s   "r   r-   r.   _   sD     ($ ($($($ ($
 ($ ($ 
4($r   c               *   a aaaa R VVVV V3R llpV# )aE  Deprecation decorator for functions, methods, & classes.

Args:
    deprecate_in: Version in which code will be marked as deprecated.
    remove_in: Version in which code is expected to be removed.
    addendum: Optional additional messaging. Useful to indicate what to do instead.
    stack: Optional stacklevel increment.

c                    V ^8  d   QhRRRR/# r&   funczCallable[P, T]r*   r   )r,   s   "r   r-   1DeprecationHandler.__call__.<locals>.__annotate__q   s     	 	~ 	. 	r   c                   <a aa SP                  SSS P                   R S P                   2SR7      w  ooS'       g   \        S4      h\	        S 4      R VV VV3R ll4       pV# )r<   rO   rP   prefixrL   c               $    V ^8  d   QhRRRRRR/# r&   argszP.argskwargszP.kwargsr*   r   r   )r,   s   "r   r-   ODeprecationHandler.__call__.<locals>.deprecated_decorator.<locals>.__annotate__   s!     - -V -x -A -r   c                 T   < \         P                  ! SS^S,           R7       S! V / VB # )r&   
stacklevel)warningswarn)r\   r]   categoryrU   messagerM   s   *,r   innerHDeprecationHandler.__call__.<locals>.deprecated_decorator.<locals>.inner   s'    gxAIFT,V,,r   _generate_messager   r   r   r   )	rU   rf   rd   re   rL   rO   rP   r'   rM   s	   f @@r   deprecated_decorator9DeprecationHandler.__call__.<locals>.deprecated_decoratorq   st     $ 6 6)#//*!D,=,=+>?!	 !7 !Hg %g.. 4[- - -
 Lr   r   )r'   rO   rP   rL   rM   rj   s   fffdd r   __call__DeprecationHandler.__call___   s    $	 	, $#r   renamec               8    V ^8  d   QhRRRRRRRRRRR	RR
RRR/# )r&   r'   r   rO   r)   rP   argumentrn   r    rL   rM   r7   r*   rQ   r   )r,   s   "r   r-   r.      sX     6$ 6$6$6$ 6$ 	6$ 6$ 6$ 6$ 
46$r   c               2   a aaaaaa R VVVVVV V3R llpV# )a  Deprecation decorator for keyword arguments.

Args:
    deprecate_in: Version in which code will be marked as deprecated.
    remove_in: Version in which code is expected to be removed.
    argument: The argument to deprecate.
    rename: Optional new argument name.
    addendum: Optional additional messaging. Useful to indicate what to do instead.
    stack: Optional stacklevel increment.

c                    V ^8  d   QhRRRR/# rT   r   )r,   s   "r   r-   1DeprecationHandler.argument.<locals>.__annotate__   s     	 	~ 	. 	r   c           
       <a aa S	P                  SSS P                   R S P                   RS R2S'       d   S'       g   RS R2MSR7      w  ooS'       g   \        S4      h\	        S 4      R VVV VVV
3R ll4       pV# )r<   ()zUse 'z
' instead.rX   c               $    V ^8  d   QhRRRRRR/# r[   r   )r,   s   "r   r-   ODeprecationHandler.argument.<locals>.deprecated_decorator.<locals>.__annotate__   s!     
- 
-V 
-x 
-A 
-r   c                    < SV9   dM   \         P                  ! SS^S,           R7       VP                  SR4      pS'       d   VP                  SV4       S! V / VB # )r&   r`   N)rb   rc   pop
setdefault)	r\   r]   valuerp   rd   rU   re   rn   rM   s	   *, r   rf   HDeprecationHandler.argument.<locals>.deprecated_decorator.<locals>.inner   sV     v%MM'8E	J #JJx6E))&%8T,V,,r   rh   )rU   rf   rd   re   rL   rp   rO   rP   rn   r'   rM   s   f @@r   rj   9DeprecationHandler.argument.<locals>.deprecated_decorator   s     $ 6 6)#//*!D,=,=+>azK 39eF8:.x !7 !Hg %g.. 4[
- 
- 
- Lr   r   )r'   rO   rP   rp   rn   rL   rM   rj   s   ffffddd r   rp   DeprecationHandler.argument   s    ,	 	@ $#r   c               4    V ^8  d   QhRRRRRRRRRR	R
RRR/# )r&   r'   r   rO   r)   rP   actionr   rL   r    rM   r7   r*   r   )r,   s   "r   r-   r.      sW     8E 8E8E8E 8E 	8E 8E 8E 
8Er   c               h   a aaaa  ! VVVV V3R lR\         4      p\        VP                  Wc3/ 4      # )z9Wraps any argparse.Action to issue a deprecation warning.c                  f   <a  ] tR t^t$ R]R&   R]R&   R V VVVV3R lltR
R V V3R llltR	tV ;t# )3DeprecationHandler.action.<locals>.DeprecationMixintype[Warning]rd   r)   helpc               (    V ^8  d   QhRRRRRRRR/# )r&   
inner_selfr   r\   r
   r]   r*   r+   r   )r,   s   "r   r-   @DeprecationHandler.action.<locals>.DeprecationMixin.__annotate__   s(     * *T *# * * *r   c                	  < \         SV `  ! V/ VB  S	P                  SSV P                  '       d   R V P                  R,           R 2MR V P                   R 2S\
        R7      w  r4V'       g   \        V4      hW0n        W@n        R# )`)rO   rP   rY   rL   deprecation_typeN)	superr1   ri   option_stringsdestFutureWarningr   rd   r   )
r   r\   r]   rd   re   	__class__rL   rO   rP   r'   s
   &*,  r   r1   <DeprecationHandler.action.<locals>.DeprecationMixin.__init__   s     $1&1$($:$:!-'
 &444 J55b9:!<  ! 13%%2 %; %!   )'22&.#")r   c               0    V ^8  d   QhRRRRRRRRR	R
RR/# )r&   r   r   parserr   	namespacer	   valuesr
   option_stringr    r*   r+   r   )r,   s   "r   r-   r      sL     K K K&K %K 	K
  *K Kr   c                	   < \         P                  ! V P                  V P                  ^S,           R7       \        SV `  WW44       R# )   r`   N)rb   rc   r   rd   r   rl   )r   r   r   r   r   r   rM   s   &&&&&r   rl   <DeprecationHandler.action.<locals>.DeprecationMixin.__call__   s9     OO'' 5y  FJr   r   r6   )	r   r   r   r   __annotations__r1   rl   r   __classcell__)r   rL   rO   rP   r'   rM   s   @r   DeprecationMixinr      s*    ##I* *2K K Kr   r   )r   typer   )r'   rO   rP   r   rL   rM   r   s   fff&dd r   r   DeprecationHandler.action   s1    +	K +	Kv +	KZ FOO&6%?DDr   c               0    V ^8  d   QhRRRRRRRRRR	R
R/# )r&   r'   r   rO   r)   rP   rL   r    rM   r7   r*   r+   r   )r,   s   "r   r-   r.      sD     
 


 

 
 
 

r   c               l    V P                  VVV P                  V4      ^,          V^V,           R7       R# )a.  Deprecation function for modules.

Args:
    deprecate_in: Version in which code will be marked as deprecated.
    remove_in: Version in which code is expected to be removed.
    addendum: Optional additional messaging. Useful to indicate what to do instead.
    stack: Optional stacklevel increment.

)rO   rP   topicrL   rM   N)r   _get_module)r'   rO   rP   rL   rM   s   &&&$$r   moduleDeprecationHandler.module   s8    " 	

%""5)!,e) 	 	
r   c               8    V ^8  d   QhRRRRRRRRRRR	R
RRRR/# )r&   r'   r   rO   r)   rP   constantr|   r
   rL   r    rM   r7   r*   r+   r   )r,   s   "r   r-   r.     sX     0) 0)0)0) 0) 	0)
 0) 0) 0) 
0)r   c                  aaaa	a
aa V P                  S4      w  po
V P                  VVS
 RS 2VR7      w  o	oS	'       g   \        S4      h\        VRR4      oR V	VV
VVVV3R llpWn        R# )aV  Deprecation function for module constant/global.

Args:
    deprecate_in: Version in which code will be marked as deprecated.
    remove_in: Version in which code is expected to be removed.
    constant:
    value:
    addendum: Optional additional messaging. Useful to indicate what to do instead.
    stack: Optional stacklevel increment.

r<   rX   __getattr__Nc                    V ^8  d   QhRRRR/# )r&   namer)   r*   r
   r   )r,   s   "r   r-   1DeprecationHandler.constant.<locals>.__annotate__:  s     	S 	Sc 	Sc 	Sr   c                   < V S8X  d#   \         P                  ! SS^S,           R7       S# S'       d	   S! V 4      # \        RS RV  R24      h)r&   r`   zmodule 'z' has no attribute '')rb   rc   r@   )r   rd   r   fullnamere   rM   super_getattrr|   s   &r   r   0DeprecationHandler.constant.<locals>.__getattr__:  sM    xgxAIF$T** 8H:5I$q!QRRr   )r   ri   r   getattrr   )r'   rO   rP   r   r|   rL   rM   r   r   rd   r   re   r   s   &&&ff$d  @@@@r   r   DeprecationHandler.constant  s    ,  ++E2 22%Zq
+	 3 
' !'**  t<	S 	S )r   c               4    V ^8  d   QhRRRRRRRRRRR	R
RR/# )r&   r'   r   rO   r)   rP   r   rL   r    rM   r7   r*   r+   r   )r,   s   "r   r-   r.   F  sN      ?  ? ? ?  ?
  ?  ?  ? 
 ?r   c                   V P                  VVVVR7      w  rgV'       g   \        V4      h\        P                  ! Wv^V,           R7       R# )aU  Deprecation function for a topic.

Args:
    deprecate_in: Version in which code will be marked as deprecated.
    remove_in: Version in which code is expected to be removed.
    topic: The topic being deprecated.
    addendum: Optional additional messaging. Useful to indicate what to do instead.
    stack: Optional stacklevel increment.

rX   r`   N)ri   r   rb   rc   )r'   rO   rP   r   rL   rM   rd   re   s   &&&$$$  r   r   DeprecationHandler.topicF  sL    ( !22%	 3 
 !'** 	gAI>r   c               $    V ^8  d   QhRRRRRR/# )r&   r'   r   rM   r7   r*   ztuple[ModuleType, str]r   )r,   s   "r   r-   r.   h  s'     'H 'H$ 'Hs 'H/E 'Hr   c                    \         P                  ! ^V,           4      p VP                  P                  p\         P                  P                  4        FO  p\        V\        4      '       g   K  \        VR4      '       g   K/  VP                  V8X  g   KB  WDP                  3u # 	  ^ RIpVP                  V4      pVe   WfP                  3#  \        R4      h  \         d     L?i ; i  \         d     L)i ; i)zDetect the module from which we are being called.

Args:
    stack: The stacklevel increment.

Returns:
    The module and module name.

__file__Nz&unable to determine the calling module)sys	_getframef_codeco_filenamemodulesr   
isinstancer   hasattrr   r   r@   inspect	getmodule
IndexErrorr   )r'   rM   framefilenameloadedr   r   s   &&     r   r   DeprecationHandler._get_moduleh  s    	1MM!e),E9 <<33
 "kk002F%fj99 "6:66 (2 &88 3 &&u-F!00 " FGG) "   		s"   C* C C'&C'*C87C8r   c               4    V ^8  d   QhRRRRRRRRRRR	R
RR/# )r&   r'   r   rO   r)   rP   rY   rL   r    r   r   r*   z tuple[type[Warning] | None, str]r   )r,   s   "r   r-   r.     sN     %
 %
%
%
 %
 	%

 %
 (%
 
*%
r   c          	         V P                  V4      '       d   \        pRV R2pM(V P                  V4      '       d
   TpRV R2pMRpRV R2pVRP                  \        RW7V.4      4      3# )a  Generate the standardized deprecation message and determine whether the
deprecation is pending, active, or past.

Args:
    deprecate_in: Version in which code will be marked as deprecated.
    remove_in: Version in which code is expected to be removed.
    prefix: The message prefix, usually the function name.
    addendum: Additional messaging. Useful to indicate what to do instead.
    deprecation_type: The warning type to use for active deprecations.

Returns:
    The warning category (if applicable) and the message.

z.is pending deprecation and will be removed in r<   z%is deprecated and will be removed in Nzwas slated for removal in  )rJ   PendingDeprecationWarningjoinfilter)r'   rO   rP   rY   rL   r   rd   warnings   &&&&&$  r   ri   $DeprecationHandler._generate_message  s    0 ""<000HFykQRSG$$Y//'H=i[JGH29+Q?G HHVD6H"=>?
 	
r   )r!   r$   r#   )r   r   r   r   r   r1   staticmethodr0   rJ   rl   rp   r   r   r   r   r   DeprecationWarningri   r   r   r   r   r   r   )   s    **##$ 
 
5.($
  $($ ($T6$ "6$  $6$ 6$p8E  $8E 8Et

  $
 
20)  $0) 0)d ?  $ ?  ?D'HR%
 +=%
 %
r   r   
deprecated)#__conditional_annotations____doc__
__future__r   r   rb   argparser   	functoolsr   typesr   typingr   anaconda_cli_baser   r   r	   r
   r   r   typing_extensionsr   r   rG   r   r   r   r   r   RuntimeErrorr   r   r   r   )r   s   @r   <module>r      s    # 
       )2--1)A#AT&\:J	l 	M
 M
` "4K!@
 @r   