
    xhe                        d dl mZ d dlZd dl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 dd
lmZ  ej        ej                   ddZdddZdS )    )annotationsN)ArgumentParser)Sequence   )api)on_win   )
validators)get_render_parser)levelreturnr   c                 (   t                      } d| _        d| _        |                     ddt          j                   |                     ddd	           |                     d
dd	           |                     dddd           |                     ddd | j        D             d         fg           |                     ddd | j        D             d         fg           |                     ddd | j        D             d         fg           | S )z(Returns a parser object for this commandzconda debugzQ

Set up environments and activation scripts to debug your build or test phase.

recipe_or_package_file_pathzPath to recipe directory or package file to use for dependency and source information. If you use a recipe, you get the build/host env and source work directory.  If you use a package file, you get the test environments and the test_tmp folder.)helptypez-pz--pathzroot path in which to place envs, source and activation script.  Defaults to a standard conda-build work folder (packagename_timestamp) in your conda-bld folder.)r   z-oz--output-idzfnmatch pattern that is associated with the output that you want to create an env for.  Must match only one file, as we don't support creating envs for more than one output at a time. The top-level recipe can be specified by passing 'TOPLEVEL' herez-az--activate-string-only
store_truezuOutput only the string to the used generated activation script.  Use this for creating envs in scripted environments.)actionr   N--outputc                *    g | ]}|j         d gk    |S )r   option_strings.0_s     :lib/python3.11/site-packages/conda_build/cli/main_debug.py
<listcomp>zget_parser.<locals>.<listcomp>B   s'    QQQQ0@ZL0P0Pq0P0P0P    r   --bootstrapc                *    g | ]}|j         d gk    |S )r   r   r   s     r   r   zget_parser.<locals>.<listcomp>I   s'    NNNq!*:}o*M*M*M*M*Mr   --old-build-stringc                *    g | ]}|j         d gk    |S )r    r   r   s     r   r   zget_parser.<locals>.<listcomp>R   s)    UUUq!*:?S>T*T*T*T*T*Tr   )r   progdescriptionadd_argumentvalid#validate_is_conda_pkg_or_recipe_dir_handle_conflict_resolve_actions)ps    r   
get_parserr*      s   AAFAM NN%U 6     NNa	     NNO	     NN 	     
QQ!*QQQRST	UV    NNAJNNNqQ	
    %UUAJUUU	

 
 
 Hr   argsSequence[str] | Noneintc                   t                      }|                    |           }	 t          j        |j        fd|j         i|j        }|j        st          d           t          d           t          |           |j        s-t          rdnd}t          d| d           t          d           nI# t          $ r<}t          d| t          j        	           t          j        d
           Y d }~nd }~ww xY wdS )NverbosezP################################################################################zKTest environment created for debugging.  To enter a debugging environment:
zconda_test_runner.batzconda_test_runner.shz<To run your tests, you might want to start with running the z file.z4Error: conda-debug encountered the following error:
)filer	   r   )r*   
parse_argsr   debugr   activate_string_only__dict__printr   
ValueErrorsysstderrexit)r+   parserparsedactivation_string	test_filees         r   executer?   [   sG   \\Ft$$FI.
 
44
 o
 
 * 	(OOO^   	   * 	39U//?UI`y```   (OOO   GAGGcj	
 	
 	
 	
 		 1s   BB2 2
C8<2C33C8)r   r   )N)r+   r,   r   r-   )
__future__r   loggingr7   argparser   typingr    r   utilsr   r
   r%   main_renderr   basicConfigINFOr*   r?    r   r   <module>rJ      s    # " " " " "  



 # # # # # #                   ! ! ! ! ! ! * * * * * *  ', ' ' ' 'F F F FR      r   