
    %dR                         d dl mZ d dlZd dlZd dlZd dlZd dlmZmZ d dl	m
Z d dlmZmZmZmZ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mZ ddlmZ ddlm Z m!Z! dZ"dZ#d Z$ed             Z%dS )    )RawDescriptionHelpFormatterN)contextdetermine_target_prefix)install)add_parser_default_packagesadd_parser_jsonadd_parser_prefixadd_parser_networkingadd_parser_solver)
PrefixData)rm_rf)notices)touch_nonadmin   )print_resultget_filename   )specs)InvalidInstallerget_installera  
Create an environment based on an environment definition file.

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
c                    |                      dt          t          t          t                    }|                    ddddd           t          |           t          |           |                    d	d
dd d           |                    dddd           |                    ddddd           t          |           t          |           t          |           |
                    d           d S )Ncreate)formatter_classdescriptionhelpepilogz-fz--filestorez6Environment definition file (default: environment.yml)zenvironment.yml)actionr   defaultremote_definitionz0Remote environment definition / IPython notebook?)r   r   r   nargsz--forcez\Force creation of environment (removing a previously-existing environment of the same name).
store_trueF)r   r   r   z-dz	--dry-runzOnly display what can be done with the current command, arguments, and other flags. Remove this flag to actually run the command.z.main_create.execute)func)
add_parserr   r   exampleadd_argumentr	   r
   r   r   r   set_defaults)sub_parsersps     9lib/python3.11/site-packages/conda_env/cli/main_create.pyconfigure_parserr,   /   s@   3 	 	 	A NNhE!	     a !NN?     NN/     NNkN      """AaNN.N/////    c                    t          j        | j        t          | j                  t          j                    | j                  }|j        }| j	        | j        |j        | _        t          t          |           }| j        r>|t          j        k    r.t
          j                            |          rt!          |           t#          j        || j                   d d d}| j        st          j        ng }| j        rd}t/          |          }|j                            |g           }	|	                    |           |                    |	| |          }
| j        r7t7          t'          j        |
                                d                     d S t7          |
                                d           d S |r,d}t/          |          }|                    ||| |          ||<   tA          |j        !                                          d	k    r/d}g }	t/          |          }|                    ||	| |          ||<   n|j        !                                D ]\  }}		 t/          |          }|                    ||	| |          ||<   1# tD          $ r[ tF          j$        %                    tM          j'        d
          (                                )                    |                     Y  dS w xY w|j*        r)tW          |          }|,                    |j*                   t[          |           t]          | ||           d S )N)namefilename	directoryr    )json)condapipr3   r   )indent )endr   ai  
                        Unable to install package for {0}.

                        Please double check and ensure your dependencies file has
                        the correct spelling.  You might also try installing the
                        conda-env-{0} package to see if provides the required
                        installer.
                        )/r   detectr/   r   fileosgetcwdr    environmentprefixr   r   forceroot_prefixpathexistsr   cli_installcheck_prefixr2   no_default_packagescreate_default_packagesdry_runr   dependenciesgetextendprintdumpsto_dictto_yamlr   lenitemsr   sysstderrwritetextwrapdedentlstripformat	variablesr   set_environment_env_varsr   r   )argsparserspecenvr>   resultargs_packagesinstaller_type	installer	pkg_specs
solved_envpds               r+   executere   _   sS   <Ydi(()++0	  D 
C { ty H	$Wd33Fz f 33 v8N8N fV$)4444 D))F;?;S[G33Y[M| .+ !.11	$((<<	'''&&y$<<
9 	0$*Z//11!<<<=====*$$&&B//////  	Y$N%n55I%.%6%6v}dTW%X%XF>"s%%''((A- 	$NI%n55I%.%6%6vy$PS%T%TF>""-0-=-C-C-E-E  )	 -n = =I-6->->vyRVX[-\-\F>**' 
 
 
J$$X_ 6 & & $VXXff^&<&<   222
 = 	7F##B''666vT66*****s   *J		A K.-K.)&argparser   r2   r;   rQ   rT   conda.base.contextr   r   	conda.clir   rC   conda.cli.conda_argparser   r   r	   r
   r   conda.core.prefix_datar   conda.gateways.disk.deleter   conda.noticesr   
conda.miscr   commonr   r   r6   r   installers.baser   r   r   r&   r,   re    r-   r+   <module>rq      s   1 0 0 0 0 0  				 



  ? ? ? ? ? ? ? ? , , , , , ,@ @ @ @ @ @ @ @ @ @ @ @ @ @ - - - - - - , , , , , , ! ! ! ! ! ! % % % % % % . . . . . . . .       = = = = = = = =-0 -0 -0` 	J+ J+ 	J+ J+ J+r-   