
    si                         S r SSKJrJrJr  SSKJr  SSKJr  SSK	J
r
  SSKJr  SSKJr  SS	KJrJr  S
\S\4S jrS\S\S\4S jrg)zjCLI implementation for `conda export`.

Dumps specified environment package specifications to the screen.
    )ArgumentParser	Namespace_SubParsersAction)KNOWN_SUBDIRS   )dals)context)NULL)Environment)ENVIRONMENT_JSON_FORMATENVIRONMENT_YAML_FORMATsub_parsersreturnc           	         SSK JnJnJn  SnUn[	        S5      nU R
                  "  S(UUUS.UD6nUR                  SSSS	S
9  UR                  SSSSS
9  UR                  SSSSSS9  UR                  SSSS
9  U" U5        UR                  SSS SSS9  UR                  S[        SUS SS9  UR                  SSSSS S!9  UR                  S"SSSS#S!9  U" U5        UR                  S$SSSS%S!9  UR                  S&S'9  U$ ))N   )LazyChoicesActionadd_parser_jsonadd_parser_prefixzExport a given environmentz
        Examples::

            conda export
            conda export --file FILE_NAME
            conda export --format yaml
            conda export --file environment.yaml
        )helpdescriptionepilogz-cz	--channelappendz+Additional channel to include in the export)actionr   z-Oz--override-channels
store_truez Do not include .condarc channelsz
--platformz--subdirexport_platformszHTarget platform(s)/subdir(s) for export (e.g., linux-64, osx-64, win-64))r   destr   z--override-platformsz/Override the platforms specified in the condarcz-fz--fileFzFile name or path for the exported environment. Note: This will silently overwrite any existing file of the same name in the current directory.)defaultrequiredr   z--formatc                  P    [        [        R                  R                  5       5      $ )N)sortedr	   plugin_managerget_exporter_format_mapping     5lib/python3.13/site-packages/conda/cli/main_export.py<lambda>"configure_parser.<locals>.<lambda>e   s    V"">>@
r$   zvFormat for the exported environment. If not specified, format will be determined by file extension or default to YAML.)r   r   r   choices_funcr   z--no-buildsz,Remove build specification from dependencies)r   r   r   r   z--ignore-channelsz0Do not include channel names with package names.z--from-historyz5Build environment spec from explicit specs in historyzconda.cli.main_export.execute)func)export)	helpersr   r   r   r   
add_parseradd_argumentr
   set_defaults)	r   kwargsr   r   r   summaryr   r   ps	            r%   configure_parserr2      s   NN*GK		F 				
 	A NN:	   NN/	   NNW   NN>  
 aNN9  
 NN 
`   NN;   NN?   ANND   NN7N8Hr$   argsparserc           
          SSK Jn  SSKJn  SSKJn  [        [        R                  5      [        [        5      -
  nU(       aB  U" SSR                  [        U5      5       SSR                  [        [        5      5       35      eU R                  nS nU[        La  OeU R                  (       a6  [        R                  R!                  U R                  5      nUR"                  nOU R$                  (       a  [&        nO[(        nU(       d  [        R                  R+                  U5      n[-        [        R                  5      S:  a'  UR.                  (       d  U" S	UR"                   S
35      e[        R0                  n[2        R4                  " UU" U5      [        R6                  U R8                  U R:                  U R<                  [        R>                  S9n	[        R                   V
s/ s H  oRA                  U
5      PM     nn
UR.                  (       a  UR/                  U5      nO<URB                  (       a  URC                  US   5      nOU" SUR"                   S35      eURE                  5       S-   nU R                  (       aX  [G        U R                  S5       nURI                  U5        S S S 5        U R$                  (       a  U" SU R                  US.5        g[K        USS9  gs  sn
f ! , (       d  f       NF= f)Nr   )env_name)CondaValueErrorr   )stdout_jsonzCould not find platform(s): z, z. Valid platforms include: z.Multiple platforms are not supported for the `z
` exporter)prefixnameplatformfrom_history	no_buildsignore_channelschannelsr   zNo export method found for z	 exporter
wT)successfileformat )end)&base.contextr6   
exceptionsr7   commonr8   setr	   r   r   joinr    rD   r
   rC   r!   detect_environment_exporterr:   jsonr   r   "get_environment_exporter_by_formatlenmultiplatform_exporttarget_prefixr   from_prefixsubdirr<   r=   r>   r?   extrapolater*   rstripopenwriteprint)r3   r4   r6   r7   r8   unknowntarget_formatenvironment_exporterr9   envr;   envsexported_contentfps                 r%   executer`      s{   ',#'**+c-.@@G*499VG_+E*F G((,		&2G(H'IK
 	
 KKM D 	&55QQII 
 -11	/ 0  ""EEmT 	 	G$$%)$99<=Q=V=V<WWab
 	
 ""F 
!
!f&&..,,!!C 7>6N6NO6N(OOH%6NDO00/DDTJ		$	$/66tAw?)*>*C*C)DIN
 	

 (..047 yy$))S!RHH%& "99D$))}UV  	B'- P "!s   (K*K//
K=N)__doc__argparser   r   r   conda.base.constantsr   
auxlib.ishr   rG   r	   common.constantsr
   models.environmentr   -plugins.environment_exporters.environment_ymlr   r   r2   intr`   r#   r$   r%   <module>ri      s`   
  /  " # ,n"3 n. ndW) W^ W Wr$   