
    -e'                       d Z ddlmZ ddlZ ej        e          ZddlZddlm	Z	 ddl
mZmZ ddlmZ d	Zddd
ddZedk    rddlZ eej                  dk    rej        d         ndZ eej                  dk    rej        d         ndZ eee
          ZeD ]Z ee            ej         ee          dk               dS dS )zs This module is intended for use in  CI workflows to help with validating
built sdist, wheel, and conda packages.

    )annotationsN)Path   )__version__	resources   )is_full_release)validate)version	build_dirr   
str | Noner   return	list[str]c                h   g }| !t           dk    r|                    d           n,| t           k    r!|                    d|  dt            d           t          t                     rOt           dk    rD	 t          j                     n/# t
          $ r"}|                    d|            Y d}~nd}~ww xY wt          j        d	          }t          j        dd
          }|j        |j        z   }|D ]}t          |          }|	                                s|                    d|            >|
                                j        dk    r|                    d|            t|qt          |          dz  |j        z  }		 t          j        |	|          s|                    d|            # t          $ r |                    d|	            Y w xY wt          t                     j        d                             d          	                                s|                    d           |S )a   Perform some basic package validation checks for the installed package.

    Args:
        version (str | None, optional) :
            A version to compare against the package's reported version

        build_dir (str | None, optional) :
            A path to a JS build dir to make detailed BokehJS file comparisons

    Returns:
        list[str]
            A list of all errors encountered

    Nz0.0.0zInvalid version 0.0.0z!Version mismatch: given version (z) != package version ()z4SRI hashes for BokehJS files could not be verified: absolute)modeT)r   minifiedzmissing BokehJS file: r   zEmpty BokehJS file: jsz2BokehJS package file differs from build dir file: zmissing build dir file: r   zpy.typedzpy.typed is missing)r   appendr	   r   verify_sri_hashesRuntimeError	Resourcesjs_filesr   existsstatst_sizenamefilecmpcmpFileNotFoundError__file__parentsjoinpath)
r   r   errorserrminpackage_js_pathspathpackage_path
build_paths
             2lib/python3.11/site-packages/bokeh/util/package.pyr
   r
   *   s    F'!!MM1222	K		g'ggYdggghhh{## Vw(>(>	V')))) 	V 	V 	VMMTQRTTUUUUUUUU	V 	,,,AJ>>>DzDM1  G GDzz""$$ 
	GMM9499::::  (A--MM7778888"i4/,2CCJG{:|<< gMM"eWc"e"efff$ G G GEEEFFFFFG # >>!!$--j99@@BB -+,,,Ms*   2B 
B2B--B2-F00"GG__main__   )r   r   r   r   r   r   )__doc__
__future__r   logging	getLogger__name__logr   pathlibr    r   r   r   r	   __all__r
   syslenargvr   r%   errorprintexit     r-   <module>rA      so    # " " " " " g!!        & % % % % % % % $ $ $ $ $ $  '+D 3 3 3 3 3 3H zJJJ S]]a//chqkkTG"s38}}11tIXg;;;F  eCHSS[[A r@   