
    wBf                     X    d 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	d	ed
ede
fdZy)zjCLI implementation for `conda export`.

Dumps specified environment package specifications to the screen.
    )ArgumentParser	Namespace_SubParsersAction   )YAML_EXTENSIONS)CondaValueErrorsub_parsersreturnc                    ddl m} ddlm}m} d}|} |d      } | j
                  	 d|||d|}|j                  dd	d
d       |j                  ddd        ||       |j                  ddd dd       |j                  ddddd       |j                  ddddd        ||       |j                  ddddd       |j                  d       |S )Nr   )dals   )add_parser_jsonadd_parser_prefixzExport a given environmentza
        Examples::

            conda export
            conda export --file FILE_NAME

        )helpdescriptionepilogz-cz	--channelappendz+Additional channel to include in the export)actionr   z--override-channels
store_truez Do not include .condarc channelsz-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--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)
auxlib.ishr   helpersr   r   
add_parseradd_argumentset_defaults)	r	   kwargsr   r   r   summaryr   r   ps	            5lib/python3.12/site-packages/conda/cli/main_export.pyconfigure_parserr#      s;   !;*GK	F 				
 	A NN:	   NN/  
 aNN9  
 NN;   NN?   ANND   NN7N8H    argsparserc                    ddl m}m}m} ddlm} ddlm}  |||       } | ||      || j                  | j                  | j                        }| j                  r|j                          | j                  |j                  | j                         | j                  ?| j                   r ||j#                                yt%        |j'                         d       y| j                  }	|	j)                  t*              st-        d	t*         d
|	       t/        | j                  d      }
| j                   r|j#                  |
      n|j'                  |
       |
j1                          y)Nr   )contextdetermine_target_prefixenv_name)from_environmentr   )stdout_json)	no_buildsignore_channelsfrom_history )endz)Export files must have a valid extension z: wb)streamr   )base.contextr(   r)   r*   env.envr+   commonr,   r-   r.   r/   override_channelsremove_channelschanneladd_channelsfilejsonto_dictprintto_yamlendswithr   r   openclose)r%   r&   r(   r)   r*   r+   r,   prefixenvfilenamefps              r"   executerG   b   s.   II*#$Wd3F
..,,&&C ||&yy&*iiCKKM"  6;3;;=b5Q  99   1!;O;LBxjY  $))T""&))2B1G

r$   N)__doc__argparser   r   r   common.configurationr   
exceptionsr   r#   intrG    r$   r"   <module>rN      sN   
  3 (L"3 L. L`") "^ " "r$   