File: //usr/local/lib/python3.10/dist-packages/numpy/distutils/__pycache__/misc_util.cpython-310.pyc
o
���g] � @ s^ d dl Z d dlZd dlZd dlZd dlZd dlZd dlZd dlZd dlZd dl Z d dl
Z
d dlZd dl
mZ d dlmZ d dlZd dlmZ e� Zg Zdd� Ze�e� g d�ZG dd � d �Zd
d� Zdd
� Zdd� Zdd� Zd�dd�Zdd� Z d�dd�Z!dd� Z"dd� Z#dd� Z$d�d d!�Z%d�d"d#�Z&d$d%� Z'e'� r�e(d d&d'd(d)d*d+d,d-d.� Z)d�d0d1�Z*nd�d2d1�Z*d3d4� Z+d5d6� Z,d7d8� Z-d9d:� Z.d;d<� Z/d=d>� Z0d?e1d@e1fdAdB�Z2dCdD� Z3dEdF� Z4dGdH� Z5dIdJ� Z6e�7dKej8�j9Z:e�7dLej8�j9Z;e�7dMej8�j9Z<e�7dNej8�j9Z=dOdP� Z>dQdR� Z?dSdT� Z@dUdV� ZAdWdX� ZBdYdZ� ZCd[d\� ZDd]d^� ZEd_d`� ZFdadb� ZGdcdd� ZHdedf� ZIdgdh� ZJdidj� ZKdkdl� ZLdmdn� ZMdodp� ZNdqdr� ZOdsdt� ZPdudv� ZQd�dwdx�ZRdydz� ZSd{d|� ZTd�d}d~�ZUG dd�� d��ZVi fd�d��ZWd�d�� ZXd�d�� ZYd�d�d��ZZd�d�d��Z[d�d�� Z\d�d�d��Z]d�d�� Z^d�d�� Z_d�d�� Z`d�d�� Zad�d�� Zbd�d�hZcd�d�� Zdd�d�� ZedS )�� N)�local)�reduce)�DistutilsErrorc C s: t d urt D ]} zt�| � W q ty Y qw d S d S �N)�_tmpdirs�shutil�rmtree�OSError)�d� r �D/usr/local/lib/python3.10/dist-packages/numpy/distutils/misc_util.py�clean_up_temporary_directory s ��r
)*�
Configuration�get_numpy_include_dirs�default_config_dict�dict_append�
appendpath�generate_config_py�get_cmd�allpath�get_mathlibs�terminal_has_colors�red_text�
green_text�yellow_text� blue_text� cyan_text� cyg2win32�mingw32�all_strings�
has_f_sources�has_cxx_sources�filter_sources�get_dependencies�is_local_src_dir�get_ext_source_files�get_script_files�get_lib_source_files�get_data_files�dot_join� get_frame�
minrelpath�njoin�is_sequence� is_string�as_list�gpaths�get_language�get_build_architecture�get_info�get_pkg_info�get_num_build_jobs�sanitize_cxx_flags�exec_mod_from_locationc @ s e Zd ZdZdd� ZdS )�InstallableLiba�
Container to hold information on an installable library.
Parameters
----------
name : str
Name of the installed library.
build_info : dict
Dictionary holding build information.
target_dir : str
Absolute path specifying where to install the library.
See Also
--------
Configuration.add_installed_library
Notes
-----
The three parameters are stored as attributes with the same names.
c C s || _ || _|| _d S r )�name�
build_info�
target_dir)�selfr9 r: r; r r r �__init__F s
zInstallableLib.__init__N)�__name__�
__module__�__qualname__�__doc__r= r r r r r8 0 s r8 c C s� ddl m} z tt�d��}W n
ty t�� }Y nw t|d�}t tj
�d|��}| � }|du r4|S t|�
d�dd�t|�
d�dd�t|�
d �dd�f}td
d� |D ��rY|S tdd� |D ��S )
a�
Get number of parallel build jobs set by the --parallel command line
argument of setup.py
If the command did not receive a setting the environment variable
NPY_NUM_BUILD_JOBS is checked. If that is unset, return the number of
processors on the system, with a maximum of 8 (to prevent
overloading the system if there a lot of CPUs).
Returns
-------
out : int
number of parallel jobs that can be run
r ��get_distribution� �NPY_NUM_BUILD_JOBSN�build�parallel� build_ext�
build_clibc s s � | ]}|d u V qd S r r ��.0�xr r r � <genexpr>k s � z%get_num_build_jobs.<locals>.<genexpr>c s s � | ] }|d ur|V qd S r r rJ r r r rM n s � )�numpy.distutils.corerC �len�os�sched_getaffinity�AttributeError�multiprocessing� cpu_count�min�int�environ�get�getattr�get_command_obj�all�max)rC rT �envjobs�dist�cmdattrr r r r5 L s$ �
�r5 c C s^ ddl }|jdtdd� t| �} tt| ��D ]}| | }d|v r,|d dvr,d| | |<