
    0]                     f    d dl mZ d dlmZmZ d dlmZmZ d dlm	Z	 d dl
mZ  G d de          ZdS )	    )print_function)CondaPackageCheckCondaRecipeCheck)PackageErrorRecipeError)ensure_list)	getLoggerc                   L    e Zd ZdZe	 dd            Ze	 	 	 	 dd            ZdS )VerifyzDVerify class is called by the CLI but may be used as an API as well.NFc                    t          |           }d|v r|d         sd|v r/|d         r't          t                                        d           g }t	          |          D ]\}|                    d          rE t          ||                      }|+|j        t          |          vr|	                    |           ]|r|rt          |          | t          d |D                       fS )zRun all package checks in order to verify a conda package.
        checks_to_ignore should be a list, tuple, or set of codes, such as ['C1102', 'C1104'].
        Codes are listed in readme.md.  Package codes follow 1xxx, recipe codes follow 2xxx.ignore_scriptsrun_scriptsIgnoring legacy ignore_scripts or run_scripts.  These have been replaced by the checks_to_ignore argument, which takes alist of codes, documented at https://github.com/conda/conda-verify#checkscheckNc                 2    g | ]} d j         |dd          S z[{}] {}   Nformat.0cs     3lib/python3.11/site-packages/conda_verify/verify.py
<listcomp>z)Verify.verify_package.<locals>.<listcomp>0   +    HHH$I$ae,HHH    )r   r	   __name__warndir
startswithgetattrcoder   appendr   sorted)path_to_packagechecks_to_ignoreexit_on_errorkwpackage_checkchecks_to_displaymethodr   s           r   verify_packagezVerify.verify_package   s/    */::""r*:';"RB}$5h$$\   -(( 	4 	4F  )) 4 7v6688$;$< < * * &,,U333 	& 	&u%%%HH6GHHHII
 	
r   c                    t          | |          }d|v r|d         sd|v r/|d         r't          t                                        d           g }d t	          |          D             D ]G} t          ||                      }|r+|j        t          |          vr|                    |           H|r|rt          |d                   |t          d |D                       fS )zRun all recipe checks in order to verify a conda recipe.
        checks_to_ignore should be a list, tuple, or set of codes, such as ['C2102', 'C2104'].
        Codes are listed in readme.md.  Package codes follow 1xxx, recipe codes follow 2xxx.r   r   r   c              3   D   K   | ]}|                     d           |V  dS )check_N)r    )r   _s     r   	<genexpr>z'Verify.verify_recipe.<locals>.<genexpr>J   s3      NNQq||H7M7MNqNNNNNNr   r   c                 2    g | ]} d j         |dd          S r   r   r   s     r   r   z(Verify.verify_recipe.<locals>.<listcomp>S   r   r   )r   r	   r   r   r   r!   r"   r   r#   r   r$   )	rendered_meta
recipe_dirr&   r'   r(   recipe_checkr*   r+   r   s	            r   verify_recipezVerify.verify_recipe3   s%    (zBB""r*:';"RB}$5h$$\   NN#l"3"3NNN 	0 	0F1GL&1133E 0;7G+H+HHH!((/// 	4 	4/2333HH6GHHHII
 	
r   )NNF)NNNF)r   
__module____qualname____doc__staticmethodr,   r6    r   r   r   r   
   sh        NNCH#
 #
 #
 \#
J 	 
  
  
 \ 
  
  
r   r   N)
__future__r   conda_verify.checksr   r   conda_verify.errorsr   r   conda_verify.utilitiesr   loggingr	   objectr   r;   r   r   <module>rB      s    % % % % % % C C C C C C C C 9 9 9 9 9 9 9 9 . . . . . .      J
 J
 J
 J
 J
V J
 J
 J
 J
 J
r   