
    $TXg                        d Z ddlmZ ddlmZ ddlmZ ddlmZ ddl	m
Z
 ddlmZ dd	lmZ e
r
dd
lmZmZmZ  ee      ZddZedd       Zy)zdCLI implementation for `conda create`.

Creates new conda environments with the specified packages.
    )annotations)_StoreTrueAction)	getLogger)isdir)TYPE_CHECKING   )
deprecated)notices)ArgumentParser	Namespace_SubParsersActionc           
        ddl m} ddlm} ddlm} ddlm}m}m	}m
} d}	 |d|	 d	      }
 |d
      } | j                  	 d|	|
|d|}|j                  dddd        ||      \  }}} ||        ||        ||       |j                  ddt        j                  ddt        d             |j                  d|dd|       |j!                  d       |S )Nr   )dals)NULL   )NullCountAction) add_parser_create_install_updateadd_parser_default_packagesadd_parser_platformadd_parser_solverzBCreate a new conda environment from a list of specified packages. z	
        z

        To use the newly-created environment, use 'conda activate envname'.
        This command requires either the -n NAME or -p PREFIX option.
        a  
        Examples:

        Create an environment containing the package 'sqlite'::

            conda create -n myenv sqlite

        Create an environment (env2) as a clone of an existing environment (env1)::

            conda create -n env2 --clone path/to/file/env1

        )helpdescriptionepilogz--clonestorezDCreate a new environment as a copy of an existing local environment.ENV)actionr   metavarz-mz--mkdirz24.9z25.3zRedundant argument.)addendum)r   z--devzUse `sys.executable -m conda` in wrapper scripts instead of CONDA_EXE. This is mainly for use during tests where we test new conda sources against old Python versions.dev)r   r   destdefaultzconda.cli.main_create.execute)func)create)
auxlib.ishr   common.constantsr   actionsr   helpersr   r   r   r   
add_parseradd_argumentr	   r   r   set_defaults)sub_parserskwargsr   r   r   r   r   r   r   summaryr   r   psolver_mode_options_channel_optionss                   5lib/python3.12/site-packages/conda/cli/main_create.pyconfigure_parserr3      s6   !'(  SG			 		K 	F 				
 	A NNS	   /Oq.Q+O 34()*NN  *	
  	 NN'    NN7N8H    c                :   dd l }ddlm} ddlm} ddlm} ddlm} ddl	m
} ddlm}m}	 dd	lm}
 dd
lm} ddlm} ddlm}m} | j,                  sY| j.                  sM|j0                  r9|j2                  j5                   |       |      | _        |j7                  |        n |d       ||j8                          ||j8                        r ||j8                  |j:                        r |	d      |j0                  r |	d       |d|j8                   ddd       t<        j?                  d|j8                          |
|j8                         n@tA        |j8                        r+ ||j8                          |d|j8                   ddd        || |d      S )Nr   )mktempr   )UNUSED_ENV_NAME)context)check_protected_dirs)paths_equal)ArgumentErrorCondaValueError)rm_rf)is_conda_environment)
confirm_ynr   )check_prefixinstall)argparse_argsz6one of the arguments -n/--name -p/--prefix is requiredz/The target prefix is the base prefix. Aborting.z<Cannot `create --dry-run` with an existing conda environmentz0WARNING: A conda environment already exists at 'z'

Remove existing environment?
This will remove ALL directories contained within this specified prefix directory, including any other conda environments.

noF)r!   dry_runz Removing existing environment %sz<WARNING: A directory already exists at the target location 'zB'
but it is not a conda environment.
Continue creating environmentr#   )!ostempfiler6   base.constantsr7   base.contextr8   cli.main_renamer9   common.pathr:   
exceptionsr;   r<   gateways.disk.deleter=   gateways.disk.testr>   	reportersr?   rA   r@   nameprefixrD   pathjoin__init__target_prefixroot_prefixloginfor   )argsparserrE   r6   r7   r8   r9   r:   r;   r<   r=   r>   r?   r@   rA   s                  r2   executerZ   c   sq   0&6);,9&.99T[[??'',,vxADK40H  ../G112w,,g.A.AB!"STT?? "N  	>w?T?T>U V[ [ 	
 	3W5J5JKg##$	w$$	%W**+J7K`K`Ja b, , 	
 4**r4   N)r+   r   returnr   )rX   r   rY   r   r[   int)__doc__
__future__r   argparser   loggingr   os.pathr   typingr   deprecationsr	   r
   r   r   r   __name__rV   r3   rZ    r4   r2   <module>rf      sO   
 # %     % EEHV 	6+ 	6+r4   