
    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mZ dd	lmZ dd
lmZmZ  ej        ej                   ddZdddZdS )    )annotationsN)	Namespace)
expanduser)pprint)Sequence)contextdetermine_target_prefix   )api)ArgumentParseradd_parser_prefix)levelargsSequence[str] | Nonereturn tuple[ArgumentParser, Namespace]c                   t          ddd          }|                    d          }d}|                    d||	          }|                    d
ddd           |                    ddd           |                    ddd           |                    ddddd           |                    dddd           |                    ddd           t	          |           d }|                    d!||	          }|                    d
ddd           |                    ddd"           |                    ddd#d$d%           |                    ddd           t	          |           d&}|                    d'||	          }|                    d(dd)           |                    d*d+dd,           |                    d-d.d/d01           |                    d2d3|	          }	|	                    d
dd4d           |	                    d5d6d7t          j                    j        t          8           |                    d9d:d:	          }
|
                    d
ddd           ||	                    |           fS );Nzconda inspectz$Tools for inspecting conda packages.zj
Run --help on the subcommands like 'conda inspect linkages --help' to see the
options available.
        )progdescriptionepilog
subcommand)destal  
Investigates linkages of binary libraries in a package (works in Linux and
OS X). This is an advanced command to aid building packages that link against
C libraries. Aggregates the output of ldd (on Linux) and otool -L (on OS X) by
dependent packages. Useful for finding broken links, or links against system
libraries that ought to be dependent conda packages.  linkages)helpr   packagesstore*zConda packages to inspect.)actionnargsr   z--untracked
store_truez~Inspect the untracked files in the environment. This is useful when used in
        conjunction with conda build --build-only.)r   r   z--show-filesz7Show the files in the package that link to each libraryz	--groupbypackage)r!   
dependencyzaAttribute to group by (default: %(default)s). Useful when used
        in conjunction with --all.)r   defaultchoicesr   z	--sysrootz2System root in which to look for system libraries. )r   r   r#   z--allz6Generate a report for all packages in the environment.z
Investigate binary object files in a package (only works on OS X). This is an
advanced command to aid building packages that have compiled
libraries. Aggregates the output of otool on all the binary object files in a
package.
objectsz~Inspect the untracked files in the environment. This is useful when used
        in conjunction with conda build --build-only.filename)r'   filetyperpathz-Attribute to group by (default: %(default)s).z)
Tools for investigating conda channels.
channelsz	--verbosezlShow verbose output. Note that error output to stderr will
        always be shown regardless of this flag. z--test-installablez-tz|DEPRECATED. This is the default (and only) behavior. Test every package in the channel to see if it is installable by conda.channel?defaultsz0The channel to test. The default is %(default)s.)r   r#   r   prefix-lengthszeInspect packages in given path, finding those with binary
            prefixes shorter than specified+z--min-prefix-lengthz-mzBMinimum length.  Only packages with prefixes below this are shown.)r   r#   typehash-inputsz5Show data used to compute hash identifier for package)
r   add_subparsers
add_parseradd_argumentr   r   Configprefix_lengthint
parse_args)r   parserr   linkages_helpr   objects_helpr&   channels_helpr*   prefix_lengthshash_inputss              <lib/python3.11/site-packages/conda_build/cli/main_inspect.pyr8   r8      s   :  F && '  J:M $$ ! %  H )	     6     F    
 )&     A	     E    
 hL ##  $  G
 )	     9     1<     E    
 gM $$! %  H
 5     V     ?	      **/!	 +  N )	      Q
*      ''DK (  K
 )	     6$$T****    r7   c                   t          |           \  }}|j        s*|                                 t          j        d           n|j        dk    r(t          t          j        |j                             nO|j        dk    rgt          t          j	        |j
        t          t          |          |j        |j        |j        |j        t#          |j                                       n|j        dk    rBt          t          j        |j
        t          t          |          |j                             n|j        dk    r5t          j        |j
        |j                  st          j        d	           nP|j        d
k    r't-          t          j        |j
                             n|                    d|j         d           dS )Nr   r*   r   )prefix	untrackedall_packages
show_filesgroupbysysrootr&   )rB   rF   r.   )min_prefix_length   r1   zUnrecognized subcommand: .)r8   r   
print_helpsysexitprintr   test_installabler+   inspect_linkagesr   r	   r   rC   allrE   rF   r   rG   inspect_objectsinspect_prefix_lengthrH   r   inspect_hash_inputserror)r   r9   parseds      r?   executerW      s   %%NFF !G		j	(	(c"6>223333		j	(	( .w?? *#Z!,"6>22  
	
 
	
 
	
 
	
 
	i	'	'.w??  	
 	
 	
 	
 
	.	.	.(Ov/G
 
 
 	 HQKKK		m	+	+s&v778888E1BEEEFFF1r@   )r   r   r   r   )N)r   r   r   r7   )
__future__r   loggingrL   argparser   os.pathr   r   typingr   conda.base.contextr   r	   r%   r   conda_interfacer   r   basicConfigINFOr8   rW    r@   r?   <module>rb      s	   # " " " " "  



                         ? ? ? ? ? ? ? ?       ? ? ? ? ? ? ? ?  ', ' ' ' 'd+ d+ d+ d+N& & & & & & &r@   