o
    ðT·jS  ã                	   @   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 r§dZej"j#edd�ej"j#ej$dkoºe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 pãe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q¡J d |¡ƒ‚W d   ƒ n1 s»w   Y  t d¡‰ ‡ ‡fdd„}
|
d ƒ |
d!ƒ |
d"ƒ}dd#lm} | |dƒd$d%¡}|jd&ksîJ ‚|jtjksöJ ‚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© úd/home/dinkstrade/pdmp-scanner/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    ÿ
ý€þÿþþ=ÿ
