
    wBf                     r    d Z ddlZddlZddlmZmZ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_SubParsersAction   )
CondaError)noticessub_parsersreturnc                 h   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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 notebook?)r   r   r   nargsz!conda.cli.main_env_create.execute)func)create)
auxlib.ishr   helpersr   r   r   r   r   r   
add_parseradd_argument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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
}m} ddlm}	 ddlm}
 dd	lm} dd
lm} ddlm} |j-                  | j.                   || j0                        t3        j4                         | j6                        }|j8                  }| j:                  | j.                  |j.                  | _         |||       }| j<                  r6||j>                  k7  r't2        j@                  jC                  |      r ||       |jE                  || jF                         d d d}| jH                  s|jJ                  ng }| jL                  rd} |	|      }|jN                  jQ                  |g       }|jS                  |       |jM                  || |      }| jF                  r/tU        tG        jV                  |jY                         d             ytU        |j[                         d       y|r!d} |	|      }|j+                  ||| |      ||<   t]        |jN                  j_                               dk(  r$d}g } |	|      }|j+                  ||| |      ||<   nB|jN                  j_                         D ]%  \  }}	  |	|      }|j+                  ||| |      ||<   ' |jb                  r# ||      }|je                  |jb                          ||        || ||       y# |
$ r ta         |d| d| d            w xY w)Nr   r   )contextdetermine_target_prefix)
PrefixData)specs)get_filenameprint_result)get_installer)InvalidInstaller)rm_rf)touch_nonadminr   )install)namefilename	directoryr   )json)condapipr=   )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.
                            )3r    r   base.contextr.   r/   core.prefix_datar0   envr1   env.envr2   r3   env.installers.baser4   
exceptionsr5   gateways.disk.deleter6   miscr7   r@   r8   detectr9   fileosgetcwdr   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   r.   r/   r0   r1   r2   r3   r4   r5   r6   r7   cli_installspecrD   rO   resultargs_packagesinstaller_type	installer	pkg_specs
solved_envpds                           r(   executerl   d   s   !?-43-,%(<<YYdii())+00	  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#B''6vT66*+ ( $!;;I:J K' (6&6 7 	 s   K&&L)__doc__r<   rL   argparser   r   r   r@   r   r   r)   intrl    r*   r(   <module>rq      sj   
  	   M"3 M. M` 	]) ]^ ] ] 	]r*   