
    $TXg~                         d Z ddlZddlZddlmZmZmZmZ ddlm	Z	 ddl
mZ ddlmZ ded	efd
Zededed	efd       Zy)zhCLI implementation for `conda-env create`.

Creates new conda environments with the specified packages.
    N)ArgumentParser	Namespace_StoreAction_SubParsersAction   )
CondaError)
deprecated)noticessub_parsersreturnc           
         ddl m} ddlm}m}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      d d        ||        ||        ||        ||       |j                  d       |S )Nr   dals   )add_output_and_prompt_optionsadd_parser_default_packagesadd_parser_networkingadd_parser_platformadd_parser_prefixadd_parser_solverz>Create an environment based on an environment definition file.z	
        a!  

        If using an environment.yml file (the default), you can name the
        environment in the first line of the file with 'name: envname' or
        you can specify the environment name in the CLI command using the
        -n/--name argument. The name specified in the CLI will override
        the name specified in the environment.yml file.

        Unless you are in the directory containing the environment definition
        file, use -f to specify the file path of the environment definition
        file you want to use.

        a]  
        Examples::

            conda env create
            conda env create -n envname
            conda env create folder/envname
            conda env create -f /path/to/environment.yml
            conda env create -f /path/to/requirements.txt -n envname
            conda env create -f /path/to/requirements.txt -p /home/user/envname

        )helpdescriptionepilogz-fz--filestorez6Environment definition file (default: environment.yml)zenvironment.yml)actionr   defaultremote_definitionz0Remote environment definition / IPython notebookz24.7z25.9z*Use `conda env create --file=URL` instead.)addendum?)r   r   r   nargsz!conda.cli.main_env_create.execute)func)create)
auxlib.ishr   helpersr   r   r   r   r   r   
add_parseradd_argumentr	   r   r   set_defaults)r   kwargsr   r   r   r   r   r   r   summaryr   r   ps                9lib/python3.12/site-packages/conda/cli/main_env_create.pyconfigure_parserr,      s   !  OG			 		K  
	F 				
 	A NNE!   a !NN?  A	
     "!!$aNN;N<H    argsparserc                    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}	 ddlm}
 dd	lm} dd
lm} ddlm} ddlm} |j1                  | j2                   || j4                        t7        j8                               }|j:                  }| j<                  | j2                  |j2                  | _         |||       }| j>                  r6||j@                  k7  r't6        jB                  jE                  |      r ||       |jG                  || jH                          ||       d d d}| jJ                  s|jL                  ng }| jN                  rd} |
|      }|jP                  jS                  |g       }|jU                  |       |jO                  || |      }| jH                  r/tW        tI        jX                  |j[                         d             ytW        |j]                         d       y|r!d} |
|      }|j/                  ||| |      ||<   t_        |jP                  ja                               dk(  r$d}g } |
|      }|j/                  ||| |      ||<   nB|jP                  ja                         D ]%  \  }}	  |
|      }|j/                  ||| |      ||<   ' |jd                  r# ||      }|jg                  |jd                          ||        |	| ||       y# |$ r tc         |d| d| d            w xY w)Nr   r   )contextdetermine_target_prefix)check_protected_dirs)
PrefixData)specs)get_filenameprint_result)get_installer)InvalidInstaller)rm_rf)touch_nonadminr   )install)namefilename	directory)json)condapiprA   )indent )endr   z;
                            Unable to install package for z.

                            Please double check and ensure your dependencies file has
                            the correct spelling. You might also try installing the
                            conda-env-zl package to see if provides
                            the required installer.
                            )4r#   r   base.contextr1   r2   cli.main_renamer3   core.prefix_datar4   envr5   env.envr6   r7   env.installers.baser8   
exceptionsr9   gateways.disk.deleter:   miscr;   rD   r<   detectr=   fileosgetcwdenvironmentprefixyesroot_prefixpathexistscheck_prefixr@   no_default_packagescreate_default_packagesdry_rundependenciesgetextendprintdumpsto_dictto_yamllenitemsr   	variablesset_environment_env_vars)r.   r/   r   r1   r2   r3   r4   r5   r6   r7   r8   r9   r:   r;   cli_installspecrI   rT   resultargs_packagesinstaller_type	installer	pkg_specs
solved_envpds                            r+   executerq   k   s   !?6-43-,%(<<YYdii())+  D
 

C {{tyy0HH	$Wd3FxxFg111bggnnV6LfV$))4  D)F 04/G/G''R  || !.1	$$((<	'&&y$<
99$**Z//1!<=V S *$$&B/R M $N%n5I%.%6%6v}dTW%XF>"s%%'(A-$NI%n5I%.%6%6vy$PS%TF>"-0-=-=-C-C-E)	 -n =I-6->->	4.F>* .F( ==F#B''6vT66*+ ( $!;;I:J K' (6&6 7 	 s   K))L)__doc__r@   rQ   argparser   r   r   r   rD   r   deprecationsr	   r
   r,   intrq    r-   r+   <module>rw      sm   
  	   % R"3 R. Rj 	^) ^^ ^ ^ 	^r-   