
    $TXg=                     z    d 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 update`.

Updates the conda environments with the specified packages.
    N)ArgumentParser	Namespace_StoreAction_SubParsersAction   )
CondaError)
deprecated)noticessub_parsersreturnc           
      x   ddl m} ddlm}m}m} d}|} |d      } | j                  	 d|||d|}	 ||	       |	j                  dd	d
dd       |	j                  dddd       |	j                  ddt        j                  ddt        d      d d        ||	        ||	       |	j                  d       |	S )Nr   dals   )add_parser_jsonadd_parser_prefixadd_parser_solverz9Update the current environment based on environment file.a  
        Examples::

            conda env update
            conda env update -n=foo
            conda env update -f=/path/to/environment.yml
            conda env update --name=foo --file=environment.yml
            conda env update vader/deathstar

        )helpdescriptionepilogz-fz--filestorez1environment definition (default: environment.yml)zenvironment.yml)actionr   defaultz--prune
store_trueFz8remove installed packages not defined in environment.yml)r   r   r   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_update.execute)func)update)
auxlib.ishr   helpersr   r   r   
add_parseradd_argumentr	   r   r   set_defaults)
r   kwargsr   r   r   r   summaryr   r   ps
             9lib/python3.12/site-packages/conda/cli/main_env_update.pyconfigure_parserr*      s   !  JGK		F 				
 	A aNN@!   NNG	   NN?  A	
    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
}m} ddlm}	 ddlm}
m} dd	lm} |j'                  | j(                   || j*                        t-        j.                         
      }|j0                  }| j(                  sb| j2                  sV|j(                  s9t,        j4                  j7                  dd      }|sd} |d      }||z  } |
|      |j(                  | _         |||       }i }|j8                  D ]  }	  |	|      ||<    d d d}|j8                  j=                         D ]!  \  }}||   }|j?                  ||| |      ||<   # |j@                  r# ||      }|jC                  |j@                          ||        || ||       y# |$ r t;         |dd dd d            w xY w)Nr   r   )contextdetermine_target_prefix)
PrefixData)specs)get_filenameprint_result)get_installer)CondaEnvExceptionInvalidInstaller)touch_nonadmin)namefilename	directoryCONDA_DEFAULT_ENVFz!Unable to determine environment

z
                    Please re-run this command with one of the following options:

                    * Provide an environment name via --name or -n
                    * Re-run this command inside an activated conda environment.
                    z3
                    Unable to install package for r   z.

                    Please double check and ensure you dependencies file has
                    the correct spelling.  You might also try installing the
                    conda-env-z\ package to see if provides the required
                    installer.
                    )condapip)"r!   r   base.contextr/   r0   core.prefix_datar1   envr2   env.envr3   r4   env.installers.baser5   
exceptionsr6   r7   miscr8   detectr9   fileosgetcwdenvironmentprefixenvirongetdependenciesr   itemsinstall	variablesset_environment_env_vars)r,   r-   r   r/   r0   r1   install_specsr3   r4   r5   r6   r7   r8   specrA   r9   msginstuctionsrK   
installersinstaller_typeresultr2   	installerpds                            r)   executer\   T   s   !?-,43@%YYdii())+   D
 

CIIxx ::>>"5u=D;" {"',,
 HH	$Wd3F J**	)6~)FJ~& +& D)F!$!1!1!7!7!9~.	!*!2!265$!L~ ": }}
##CMM26vv&9   	334# 6  !c "	 	s   FF<)__doc__rH   argparser   r   r   r    r   deprecationsr	   r
   r*   intr\    r+   r)   <module>rc      sg   
 
   % <"3 <. <~ 	U) U^ U U 	Ur+   