o
    Df(                  	   @   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 zd dlZW n eyG   dZY nw ejjdkrPdZz#ejddZedde d dlZW d   n1 smw   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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   T)recordalways )version)_pep440z3.0.6win32l        z7Failing in 32-bit Windows wheel build job, skip for now)reasonz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 Z/home/ubuntu/webapp/venv/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   

	rM   zrequires numba and cffic                  C      ddl m}  d S Nr   r%   )numpy.random._examples.numbar%   rP   r"   r"   r#   
test_numbal   s   rR   zrequires cffic                  C   rN   rO   )numpy.random._examples.cffir%   rP   r"   r"   r#   	test_cffiq   s   rT   )+importlib.utilr   r   r,   pathlibpytestr1   r6   r4   r<   textwrapwarningsnumpyrB   numpy.testingr   cffiImportErrorflagsoptimizecatch_warningswfilterwarningsDeprecationWarningnumbaSystemErrorr   Cython.Compiler.Versionr	   cython_versionnumpy._utilsr
   required_versionparseVersionmarkskipifr5   maxsizeslowrM   rR   rT   r"   r"   r"   r#   <module>   sh    
4
