o
    Je                  	   @   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0.29.35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..randomZ	_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 o/home/seandotau/au.memorygallery.club/gallery/lib/python3.10/site-packages/numpy/random/tests/test_extending.pyload^   s
   
ztest_cython.<locals>.load	extendingZ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_varZnumpy.randomr&   Zuniforms_exshapeZdtypenpZfloat64)Ztmp_pathr)   srcdir	build_dirgfidZtxt_to_findiliner#   r%   r&   valuesr!   r   r"   test_cython4   sL   

	rE   zrequires numba and cffic                  C      ddl m}  d S Nr   r$   )Znumpy.random._examples.numbar$   rH   r!   r!   r"   
test_numbao   s   rI   zrequires cffic                  C   rF   rG   )Znumpy.random._examples.cffir$   rH   r!   r!   r"   	test_cffit   s   rJ   )+importlib.utilr   r   r*   pathlibZpytestr/   r4   r2   r:   textwrapwarningsnumpyr=   Znumpy.testingr   ZcffiImportErrorflagsoptimizecatch_warningswfilterwarningsDeprecationWarningZnumbaSystemErrorr   ZCython.Compiler.Versionr	   Zcython_versionZnumpy._utilsr
   Zrequired_versionparseVersionmarkZskipifr3   maxsizeZslowrE   rI   rJ   r!   r!   r!   r"   <module>   sh    
4
