o
    hS                  	   @   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..random	_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 u/var/www/html/construction_image-detection-poc/venv/lib/python3.10/site-packages/numpy/random/tests/test_extending.pyloadf   s
   
ztest_cython.<locals>.load	extending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_varnumpy.randomr+   uniforms_exshapedtypenpfloat64)tmp_pathr.   srcdir	build_dirnative_filefgfidtxt_to_findliner'   r*   r+   valuesr%   r"   r&   test_cython/   s^   



	rR   zrequires numba and cffic                  C      ddl m}  d S Nr   r(   )numpy.random._examples.numbar(   rU   r%   r%   r&   
test_numbaw   s   rW   zrequires cffic                  C   rS   rT   )numpy.random._examples.cffir(   rU   r%   r%   r&   	test_cffi|   s   rY   )*importlib.utilr   r   r/   pytestr4   r=   r:   r@   warningsnumpyrF   numpy.testingr   r   cffiImportErrorflagsoptimizecatch_warningsr   filterwarningsDeprecationWarningnumbaSystemErrorr   Cython.Compiler.Versionr
   cython_versionnumpy._utilsr   required_versionparseVersionmarkskipifr<   maxsizeslowrR   rW   rY   r%   r%   r%   r&   <module>   sl    
=
