o
    [ZhS                  	   @   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mZmZ zd dlZW n eyA   dZY nw ejjdkrJdZz#e	jddZe	dde d dlZW d   n1 sgw   Y  W n eefyz   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	|d	 }t
|d
!}|d |dtj d |dtj d W d    n1 sYw   Y  tjdkrttjddddd|t	|gd ntjddd|t	|gd tjg dd | t	d d }t
|d }d}|D ]}	||	v r nqJ 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..randomZ	_examplescythonbuildT)exist_okzinterpreter-native-file.iniwz[binaries]
z
python = 'z'
zpython3 = ''r   mesonsetupz--buildtype=releasez--vsenvz--native-file)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 P/var/www/auris/lib/python3.10/site-packages/numpy/random/tests/test_extending.pyloadf   s
   
ztest_cython.<locals>.load	extendingZextending_cppextending_distributions)PCG64
   d)r*   )globospathjoindirname__file__shutilcopytreemakedirsstropenwritesys
executableplatform
subprocess
check_callformat	sysconfigget_config_varZnumpy.randomr)   Zuniforms_exshapeZdtypenpZfloat64)Ztmp_pathr,   srcdir	build_dirZnative_filefgZfidZtxt_to_findliner&   r(   r)   valuesr$   r!   r%   test_cython/   s^   



	rH   zrequires numba and cffic                  C      ddl m}  d S Nr   r'   )Znumpy.random._examples.numbar'   rK   r$   r$   r%   
test_numbaw   s   rL   zrequires cffic                  C   rI   rJ   )Znumpy.random._examples.cffir'   rK   r$   r$   r%   	test_cffi|   s   rM   )*importlib.utilr   r   r-   Zpytestr2   r;   r8   r>   warningsnumpyrA   Znumpy.testingr   r   ZcffiImportErrorflagsoptimizecatch_warningsr   filterwarningsDeprecationWarningZnumbaSystemErrorr   ZCython.Compiler.Versionr
   Zcython_versionZnumpy._utilsr   Zrequired_versionparseVersionmarkZskipifr:   maxsizeZslowrH   rL   rM   r$   r$   r$   r%   <module>   sl    
=
