+
    ,j                        ^ RI Ht ^ RIHt ^ RIHtHt ^ RIHt ^ RI	t	^ RI
HtHt ^ RIHtHtHtHt  ! R R	]4      t ! R
 R4      t ! R R4      t ! R R4      tRR R lltR# )    )annotations)Enum)IterableOptional)PathN)PlatformPlatformLiteral)PyActivationVariablesPyActivatorPyShellEnumPyActivationResultc                  &    ] tR t^tRtRtRtRtRtR# )PathModificationBehaviora  
The behavior to use when modifying the PATH environment variable.
Prepend will add the new path to the beginning of the PATH variable.
Append will add the new path to the end of the PATH variable.
Replace will replace the entire PATH variable with the new path.
prependappendreplace N)	__name__
__module____qualname____firstlineno____doc__PrependAppendReplace__static_attributes__r       3lib/python3.14/site-packages/rattler/shell/shell.pyr   r      s     GFGr   r   c                  P    ] tR t^tRtRR]P                  3R R lltR R ltRt	R# )ActivationVariablesz:An object that holds the state of the current environment.Nc               (    V ^8  d   QhRRRRRRRR/# )	   current_prefixzOptional[os.PathLike[str]]current_pathz;Optional[Iterable[str] | Iterable[os.PathLike[str]]] | Nonepath_modification_behaviorr   returnNoner   )formats   "r   __annotate__ ActivationVariables.__annotate__!   s3     
 
2
 R
 %=	

 

r   c                    \        TT;'       g>    \        P                  P                  RR4      P	                  \        P
                  4      VP                  4      V n        R# )a  
Construct a new ActivationVariables object.

current_prefix: The current activated conda prefix (usually
    `os.environ["CONDA_PREFIX"]`). This prefix is going to be deactivated.
current_path: The current PATH environment variable (usually
    `os.environ["PATH"].split(os.pathsep)`).
path_modification_behavior: The behavior to use when modifying the PATH
    environment variable. One of "Prepend", "Append", or "Replace".
    Defaults to "Prepend".
PATH N)r
   osenvirongetsplitpathsepvalue_activation_variables)selfr#   r$   r%   s   &&&&r   __init__ActivationVariables.__init__!   sF    " &;HHBJJNN626<<RZZH&,,&
"r   c                   V ^8  d   QhRR/# r"   r&   strr   )r(   s   "r   r)   r*   8   s     3 3 3r   c                	6    V P                   P                  4       # )N)r4   as_strr5   s   &r   __str__ActivationVariables.__str__8   s    ))0022r   )r4   )
r   r   r   r   r   r   r   r6   r>   r   r   r   r   r    r       s%    D 6:TX?W?_?_	
.3 3r   r    c                  h    ] tR t^<t$ RtR]R&   ]R R l4       t]R R l4       t	]R R	 l4       t
R
tR# )ActivationResultzBAn object that holds the result of activating a conda environment.r   _py_activation_resultc                    V ^8  d   QhRRRR/# )r"   py_activation_resultr   r&   rA   r   )r(   s   "r   r)   ActivationResult.__annotate__B   s     ! !>P !Ue !r   c                4    V P                  V 4      pWn        V# )z=Construct Rattler version from FFI PyActivationResult object.)__new__rB   )clsrD   activation_results   && r   _from_py_activation_result+ActivationResult._from_py_activation_resultA   s      KK,2F/  r   c                   V ^8  d   QhRR/# )r"   r&   r   r   )r(   s   "r   r)   rE   I   s     / /d /r   c                .    V P                   P                  # )z"The new PATH environment variable.)rB   pathr=   s   &r   rN   ActivationResult.pathH   s     ))...r   c                   V ^8  d   QhRR/# r9   r   )r(   s   "r   r)   rE   N   s     1 1 1r   c                .    V P                   P                  # )z.The script to run to activate the environment.)rB   scriptr=   s   &r   rR   ActivationResult.scriptM   s     ))000r   r   N)r   r   r   r   r   __annotations__classmethodrJ   propertyrN   rR   r   r   r   r   rA   rA   <   sE    L--! ! / / 1 1r   rA   c                      ] tR t^StRt]P                  t]P                  t	]P                  t]P                  t]P                  t]P                   tRtR# )ShellzAn enum of supported shells.r   N)r   r   r   r   r   r   BashbashZshzshFishfishXonshxonsh
PowerShell
powershellCmdExecmd_exer   r   r   r   rX   rX   S   sE    &D
//CDE''J  Gr   rX   c          
     ,    V ^8  d   QhRRRRRRRRR	R
/# )r"   prefixr   activation_variablesr    shellzOptional[Shell]platformz$Optional[Platform | PlatformLiteral]r&   rA   r   )r(   s   "r   r)   r)   ^   s:     ( ((-( ( 3	(
 (r   c                4   \        V\        4      '       d   \        V4      MT;'       g    \        P                  ! 4       pT;'       g    \        P
                  p\        P                  \        P                  ! WP                  VP                  V4      4      # )a  
Return an ActivationResult object that contains the new PATH environment variable
and the script to run to activate the environment.

Arguments:
    prefix: The path to the conda prefix to activate.
    activation_variables: The current activation variables.
    shell: The shell to generate the activation script for.
    platform: The platform to generate the activation script for.
              If None, the current platform is used.

Returns:
    An ActivationResult object containing the new PATH environment variable
    and the script to run to activate the environment.

Examples
--------
```python
>>> from rattler.shell import Shell, activate, ActivationVariables
>>> from rattler.platform import Platform
>>> from pathlib import Path
>>> import sys
>>> p = Path("/path/to/conda/prefix")
>>> actvars = ActivationVariables()
>>> a = activate(p, actvars, Shell.xonsh)
>>> print(a)
<rattler.shell.shell.ActivationResult object at ...>
>>>
```
)
isinstancer:   r   currentrX   rZ   rA   rJ   r   activater4   _inner)rf   rg   rh   ri   s   &&&&r   rm   rm   ^   ss    H &0#%>%>x!HDbDbPXP`P`PbHUZZE66V%O%OQYQ`Q`bgh r   )NN)
__future__r   enumr   typingr   r   pathlibr   r.   rattler.platform.platformr   r	   rattler.rattlerr
   r   r   r   r   r    rA   rX   rm   r   r   r   <module>ru      sU    "  %  	 ? 
t 
3 3<1 1.! !( (r   