
    wBf                        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        ||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   metavarT)prefix_requiredz-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_parserr4      s=   !'(  SG			 		K 	F 				
 	A NNS	   /O	4/+O   34()*NN  *	
  	 NN'    NN7N8H    c                   ddl m} ddlm} ddlm} ddlm} ddlm	} ddl
m} dd	lm}  ||j                        r ||j                  |j                        r |d
      |j                  r |d       |d|j                  z  dd       t         j#                  d|j                          ||j                         n-t%        |j                        r |d|j                  z  dd        || |d      S )Nr   )context)paths_equal)CondaValueError)rm_rf)is_conda_environmentr   )
confirm_yn)installz/The target prefix is the base prefix. Aborting.z<Cannot `create --dry-run` with an existing conda environmentzOWARNING: A conda environment already exists at '%s'
Remove existing environmentnoF)r"   dry_runz Removing existing environment %szWARNING: A directory already exists at the target location '%s'
but it is not a conda environment.
Continue creating environmentr$   )base.contextr7   common.pathr8   
exceptionsr9   gateways.disk.deleter:   gateways.disk.testr;   commonr<   r=   target_prefixroot_prefixr?   loginfor   )	argsparserr7   r8   r9   r:   r;   r<   r=   s	            r3   executerL   e   s    &),,9" G112w,,g.A.AB!"STT?? "N  	*,3,A,AB		
 	3W5J5JKg##$	w$$	%,.5.C.CD 	
 4**r5   N)r,   r   returnr   )rJ   r   rK   r   rM   int)__doc__
__future__r   argparser   loggingr   os.pathr   typingr   deprecationsr	   r
   r   r   r   __name__rH   r4   rL    r5   r3   <module>rX      sO   
 # %     % EEJZ 	#+ 	#+r5   