o
    h                  	   @   s  d dl mZmZ d dlZd dlZd dlZd dlZd dlZd dlZd dl	Z	d dl
Z
d dlZd dlZd dlmZmZ zd dlZW n eyI   dZY nw ejjdkrRdZz#ejddZedde d dlZW d   n1 sow   Y  W n eefy   dZY nw zd dlZd d	lmZ W n ey   dZY nw d d
lm Z  dZ!e "ee #e!k rdZej$j%eddej$j%ej&dkoej'dk ddej$j%eddej$j%edu ddej$j(dd Z)ej$j%edu pedu dddd Z*ej$j%edu dddd Z+dS )    )spec_from_file_locationmodule_from_specN)IS_WASMIS_EDITABLE   T)recordalways )version)_pep440z3.0.6z)Editable install cannot find .pxd headers)reasonwin32l        z7Failing in 32-bit Windows wheel build job, skip for nowzCan't start subprocesszrequires cythonc                    s  dd l }tjtjtd}t|| d  | d d d }|d tjdd t	j
d	kr>tjd
dddt|gd ntjd
dt|gd tjg dd | td d }t|d  }d}t|D ]
\}}||v ru nqkJ d|W d    n1 sw   Y  td  fdd}	|	d |	d |	d}
ddlm} |
|ddd}|jdksJ |jtjksJ d S )Nr   z..random	_examplescythonbuildT)exist_okr   mesonsetupz--buildtype=releasez--vsenv)cwd)r   compilez-vv*zextending.pyx.cz+NumPy API declarations from "numpy/__init__Fz-Could not find '{}' in C file, wrong pxd used
EXT_SUFFIXc                    s0   |    }t| |}t|}|j| |S )N)with_suffixr   r   loaderexec_module)modnamesospecmodsuffix
target_dir U/var/www/vscode/kcb/lib/python3.10/site-packages/numpy/random/tests/test_extending.pyload_   s
   
ztest_cython.<locals>.load	extendingextending_cppextending_distributions)PCG64
   d)r*   )globospathjoindirname__file__shutilcopytreemakedirssysplatform
subprocess
check_callstropen	enumerateformat	sysconfigget_config_varnumpy.randomr)   uniforms_exshapedtypenpfloat64)tmp_pathr,   srcdir	build_dirgfidtxt_to_findiliner%   r(   r)   valuesr#   r    r$   test_cython1   sL   

	rN   zrequires numba and cffic                  C      ddl m}  d S Nr   r&   )numpy.random._examples.numbar&   rQ   r#   r#   r$   
test_numbap   s   rS   zrequires cffic                  C   rO   rP   )numpy.random._examples.cffir&   rQ   r#   r#   r$   	test_cffiu   s   rU   ),importlib.utilr   r   r-   pathlibpytestr2   r7   r5   r=   textwrapwarningsnumpyrC   numpy.testingr   r   cffiImportErrorflagsoptimizecatch_warningswfilterwarningsDeprecationWarningnumbaSystemErrorr   Cython.Compiler.Versionr
   cython_versionnumpy._utilsr   required_versionparseVersionmarkskipifr6   maxsizeslowrN   rS   rU   r#   r#   r#   r$   <module>   sp    
4
