%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib64/python3.9/site-packages/numpy/distutils/tests/__pycache__/
Upload File :
Create Path :
Current File : //lib64/python3.9/site-packages/numpy/distutils/tests/__pycache__/test_system_info.cpython-39.pyc

a

z[yc+�@s"ddlZddlZddlZddlmZmZddlmZmZddl	m
Z
ddlmZm
Z
mZddlmZmZddlmZmZmZddlmZdd	lmZmZdd
lmZddd
�ZdatadZdd�Ze�ZGdd�de�Z Gdd�de �Z!Gdd�de �Z"Gdd�de �Z#Gdd�d�Z$dd�Z%dS)�N)�mkstemp�mkdtemp)�Popen�PIPE)�DistutilsError)�assert_�assert_equal�
assert_raises)�	ccompiler�customized_ccompiler)�system_info�ConfigParser�mkl_info)�AliasedOptionError)�default_lib_dirs�default_include_dirs)�_shell_utils�cCstttd��|��t�}|�S)zg
    notfound_action:
      0 - do nothing
      1 - display warning message
      2 - raise error
    )�temp1�temp2�duplicate_options)�	Temp1Info�	Temp2Info�DuplicateOptionInfo�get�lower�_system_info)�nameZnotfound_actionZcl�r�L/usr/lib64/python3.9/site-packages/numpy/distutils/tests/test_system_info.py�	get_classs��r a�
[ALL]
library_dirs = {dir1:s}{pathsep:s}{dir2:s}
libraries = {lib1:s},{lib2:s}
extra_compile_args = -I/fake/directory -I"/path with/spaces" -Os
runtime_library_dirs = {dir1:s}

[temp1]
library_dirs = {dir1:s}
libraries = {lib1:s}
runtime_library_dirs = {dir1:s}

[temp2]
library_dirs = {dir2:s}
libraries = {lib2:s}
extra_link_args = -Wl,-rpath={lib2_escaped:s}
rpath = {dir2:s}

[duplicate_options]
mylib_libs = {lib1:s}
libraries = {lib2:s}
z�
/* This file is generated from numpy/distutils/testing/test_system_info.py */
#include<stdio.h>
void foo(void) {
   printf("Hello foo");
}
void bar(void) {
   printf("Hello bar");
}
cCs�t�}z
|j}WnHtyXz|js.|��WnttfyJYYdS0|jg}Yn0z.t|t	t	d�}|j
��|j��|�
�Wnty�YdS0dS)z? Return True if there appears to be an executable compiler
    F)�stdout�stderrT)r�compiler�AttributeErrorZinitializedZ
initializer�
ValueErrorZccrrr!�closer"�wait�OSError)r#�cmd�prrr�
have_compiler@s$



r+c@s$eZdZeedfdd�Zdd�ZdS)rrc	Cs2i|j_g|_ddddddddd�}t|�|_dS)N��0)�library_dirsZinclude_dirsZruntime_library_dirs�rpathZsrc_dirsZsearch_static_first�extra_compile_args�extra_link_args)�	__class__�infoZlocal_prefixesr
�cp)�selfrr�	verbosity�defaultsrrr�__init__\s�z_system_info.__init__cCs||d�}|S)z-Override _check_libs to return with all dirs )�	librariesr.r)r5�lib_dirsZlibsZopt_libsZextsr3rrr�_check_libsos
z_system_info._check_libsN)�__name__�
__module__�__qualname__rrr8r;rrrrrZs
�
rc@seZdZdZdZdS)r�For testing purposesrN�r<r=r>�__doc__�sectionrrrrrusrc@seZdZdZdZdS)rr?rNr@rrrrrzsrc@seZdZdZdZdS)rr?rNr@rrrrr~src@s�eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Ze	j
jed
d�dd��Z
e	j
jed
d�e	j
jdee���vdd�dd���Zde����dg�vZe	j
jedd�dd��ZdS)�TestSystemInfoReadingcCs�t�|_tj�|jd�|_tj�|jd�|_t�|_tj�|jd�|_tj�|jd�|_	t
jfi|j|j|j|j	tjt
j�|j	g�d���at�\}|_t�|�t|jd��}|�t�Wd�n1s�0Yt|jd��}|�t�Wd�n1�s0Yt|jd��}|�t�Wd�n1�s>0Ydd	�}|td
�|j�|_|td�|j�|_|td�|j�|_|td
�|j�|_dS)z Create the libraries zfoo.cz	libfoo.sozbar.cz	libbar.so)Zdir1Zlib1Zdir2Zlib2�pathsepZlib2_escaped�wNcSs|g|_|��|S�N)�filesZparse_config_files)�c�site_cfgrrr�site_and_parse�sz:TestSystemInfoReading.setup_method.<locals>.site_and_parse�defaultrrr)r�_dir1�os�path�join�_src1�_lib1�_dir2�_src2�_lib2�simple_site�formatrDrZNativeParserrIr�_sitecfgr&�open�write�fakelib_c_textr �	c_default�c_temp1�c_temp2�
c_dup_options)r5�fdrJrrr�setup_method�s:�
	
(**�z"TestSystemInfoReading.setup_methodcCspzt�|j�Wnty"Yn0zt�|j�WntyFYn0zt�|j�WntyjYn0dSrF)�shutil�rmtreerL�	ExceptionrRrM�removerW)r5rrr�teardown_method�sz%TestSystemInfoReading.teardown_methodcCsb|j}t|��|j|jg�t|��|j|jg�t|��|jg�|�	�}t|dgd��dS)Nr0)z-I/fake/directoryz-I/path with/spacesz-Os)
r[r�get_lib_dirsrLrR�
get_librariesrQrT�get_runtime_lib_dirs�calc_extra_info�r5�tsiZextrarrr�test_all�szTestSystemInfoReading.test_allcCs@|j}t|��|jg�t|��|jg�t|��|jg�dSrF)r\rrfrLrgrQrh�r5rkrrr�
test_temp1�sz TestSystemInfoReading.test_temp1cCsb|j}t|��|jg�t|��|jg�t|jdd�|jg�|��}t|dd|jg�dS)Nr/)�keyr1z-Wl,-rpath=)r]rrfrRrgrTrhrirjrrr�
test_temp2�sz TestSystemInfoReading.test_temp2cCsN|j}tt|jdd�t|�d|jg�|jg�t|�d|jg�|jg�dS)NZ
mylib_libsr9)r^r	rZget_option_singlerZget_libsrQrTrmrrr�test_duplicate_options�sz,TestSystemInfoReading.test_duplicate_optionszMissing compiler)�reasonc	Cs�t�}t��}zft�|j�|jtj�|j�g|jd�t	tj�
|j�dd��pdtj�
|j�dd���Wt�|�nt�|�0dS)N)�
output_dir�.c�.oz.obj)rrM�getcwd�chdirrL�compilerN�basenamerPr�isfile�replace)r5rH�previousDirrrr�
test_compile1�s�z#TestSystemInfoReading.test_compile1ZmsvczFails with MSVC compiler c	Cs�|j}t�}|��d}t��}zRt�|j�|jtj�	|j
�g|j|d�ttj�|j
�
dd���Wt�|�nt�|�0dS)Nr1)rsZextra_postargsrtru)r]rrirMrvrwrRrxrNryrSrrzr{)r5rkrHr1r|rrr�
test_compile2�s�z#TestSystemInfoReading.test_compile2Zmkl_rtr9zD`[DEFAULT]` override doesn't work if numpy is built with MKL supportc	Cs�t��}tj�|jd�}t�|j|��zXt�|j�t	�}|j
dd�tj�}|�
�|ksbJ�t|d��"}|���ddd�}Wd�n1s�0Yt|d��}|�|�Wd�n1s�0Yt	�}|�
�|ks�J�t|d��"}|���dd	d�}Wd�n1�s0Yt|d��}|�|�Wd�n1�sR0Yt	�}|�
�|k�stJ�Wt�|�nt�|�0dS)
Nzsite.cfgZALLr.�rz[ALL]z[mkl]rrEz	[DEFAULT])rMrvrNrOrLra�copyrWrwrr4�splitrDrfrX�readr{rY)r5r|Zcfgr3r:ZfidZmklZdfltrrr�test_overridess*0(2*z$TestSystemInfoReading.test_overridesN)r<r=r>r`rerlrnrprq�pytestZmarkZskipif�
HAVE_COMPILERr}�reprr
Znew_compilerr~rZcalc_libraries_inforZHAS_MKLZxfailr�rrrrrC�s )	

�rCcCs~ddlm}d}td�}|�|d�|||�\}}t|�dksBJ�|td�ksRJ�t|�dksbJ�|�|d	�|||�\}}t|�dks�J�t|�dks�J�d
D]T}|�||�d��|||�\}}t|�dks�J�|td
�ks�J�t|�dks�J�q�t�t��&|�|d�|||�Wd�n1�s.0Yt�t��&|�|d�|||�Wd�n1�sp0YdS)Nr)�_parse_env_orderZ#NPY_TESTS_DISTUTILS_PARSE_ENV_ORDERZabcdefzb,i,e,f�Zbefrr,z^!zb,i,e�Zacdfzb,^e,iz!b,^e,i)�numpy.distutils.system_infor��listZsetenv�lenr�Zraisesr%)Zmonkeypatchr��envZ
base_order�order�unknown�prefixrrr�test_distutils_parse_env_order$s0*r�)r)&rMrar�Ztempfilerr�
subprocessrrZdistutils.errorsrZ
numpy.testingrrr	Znumpy.distutilsr
rr�rr
rrrrrr rUrIrZr+r�rrrrrCr�rrrr�<module>s0

"

Zerion Mini Shell 1.0