%PDF- %PDF-
Mini Shell

Mini Shell

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

a

z[yc�2�@s�ddlZddlZddlZddlmZgd�Ze�d�ZGdd�de�Z	Gdd�de�Z
d	d
�Zdd�ZGd
d�d�Z
Gdd�d�Zdd�Zdd�Zdd�Zdd�ZdCdd�ZdDdd�ZiZdEdd�Zedk�r�dd lmZddlZe�Zejd!d"d#d$d%�ejd&d'd#d(d%�ejd)d*d+d,�ejd-d.d#d/d%�ejd0d1d2d,�ejd3d4d#d2d%�ejd5d6d7d,�e�ej�\ZZ e!e �d8k�r�e"d9��ej#�r�e�d:�Z$e$D]&Z%ee%�Z&e'd;e&j(e&j(e&j)f��q�e d<Z*ej+�,d=�Z-e-�r�ee*d>d?e-g�Z&nee*d>d?g�Z&ej.�rej.Z.nd@Z.ej/�rVe�0dAej/�Z1e1�s8e"dB��ne1�2d<�Z(e1�2d8�Z3e3e&j4e(<ej5�rle'e&�5e.��ej6�r�e'e&�6e.��ej7�r�e'e&j7�ej8�r�e'e&j7ej8k�dS)F�N)�RawConfigParser)�FormatError�PkgNotFound�LibraryInfo�VariableSet�read_config�parse_flagsz\$\{([a-zA-Z0-9_-]+)\}c@s eZdZdZdd�Zdd�ZdS)rzQ
    Exception thrown when there is a problem parsing a configuration file.

    cCs
||_dS�N��msg��selfr�r�D/usr/lib64/python3.9/site-packages/numpy/distutils/npy_pkg_config.py�__init__szFormatError.__init__cCs|jSr	r
�r
rrr�__str__szFormatError.__str__N��__name__�
__module__�__qualname__�__doc__rrrrrrrsrc@s eZdZdZdd�Zdd�ZdS)rz3Exception raised when a package can not be located.cCs
||_dSr	r
rrrrrszPkgNotFound.__init__cCs|jSr	r
rrrrrszPkgNotFound.__str__NrrrrrrsrcCs�gggggd�}d|�d�}|D]�}d|}t|�dkr"|�d�r`|d�|dd	����q"|�d
�r�|d�|dd	����q"|�d�r�|d
�|dd	����q"|�d�r�|d�|dd	����q"|d�|�q"|S)a�
    Parse a line from a config file containing compile flags.

    Parameters
    ----------
    line : str
        A single line containing one or more compile flags.

    Returns
    -------
    d : dict
        Dictionary of parsed flags, split into relevant categories.
        These categories are the keys of `d`:

        * 'include_dirs'
        * 'library_dirs'
        * 'libraries'
        * 'macros'
        * 'ignored'

    )�include_dirs�library_dirs�	libraries�macros�ignored� z -�-rz-Ir�Nz-Lrz-lrz-Drr)�split�len�
startswith�append�strip)�line�d�flags�flagrrrrs"�



rcCs|�dd�S)N�\z\\)�replace)�valrrr�_escape_backslashIsr,c@s>eZdZdZddd�Zdd�Zddd	�Zdd
d�Zdd
�ZdS)ra$
    Object containing build information about a library.

    Parameters
    ----------
    name : str
        The library name.
    description : str
        Description of the library.
    version : str
        Version string.
    sections : dict
        The sections of the configuration file for the library. The keys are
        the section headers, the values the text under each header.
    vars : class instance
        A `VariableSet` instance, which contains ``(name, value)`` pairs for
        variables defined in the configuration file for the library.
    requires : sequence, optional
        The required libraries for the library to be installed.

    Notes
    -----
    All input parameters (except "sections" which is a method) are available as
    attributes of the same name.

    NcCs4||_||_|r||_ng|_||_||_||_dSr	)�name�description�requires�version�	_sections�vars)r
r-r.r0�sectionsr2r/rrrrgszLibraryInfo.__init__cCst|j���S)z�
        Return the section headers of the config file.

        Parameters
        ----------
        None

        Returns
        -------
        keys : list of str
            The list of section headers.

        )�listr1�keysrrrrr3rszLibraryInfo.sections�defaultcCs|j�|j|d�}t|�S)N�cflags�r2�interpolater1r,�r
�sectionr+rrrr7�szLibraryInfo.cflagscCs|j�|j|d�}t|�S)N�libsr8r:rrrr<�szLibraryInfo.libscCsVd|jd|jg}|jr&|�d�n|�dd�|j��|�d|j�d�|�S)NzName: %szDescription: %sz	Requires:zRequires: %s�,zVersion: %s�
)r-r.r/r#�joinr0)r
�mrrrr�szLibraryInfo.__str__)N)r6)r6)	rrrrrr3r7r<rrrrrrLs


rc@sHeZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dS)ra
    Container object for the variables defined in a config file.

    `VariableSet` can be used as a plain dictionary, with the variable names
    as keys.

    Parameters
    ----------
    d : dict
        Dict of items in the "variables" section of the configuration file.

    cCs0tdd�|��D��|_i|_i|_|��dS)NcSsg|]\}}||f�qSrr)�.0�k�vrrr�
<listcomp>��z(VariableSet.__init__.<locals>.<listcomp>)�dict�items�	_raw_data�_re�_re_sub�_init_parse)r
r&rrrr�szVariableSet.__init__cCs$|j��D]\}}|�||�q
dSr	)rHrG�_init_parse_var)r
rBrCrrrrK�szVariableSet._init_parsecCs"t�d|�|j|<||j|<dS)Nz\$\{%s\})�re�compilerIrJ�r
r-�valuerrrrL�szVariableSet._init_parse_varcs2�fdd�}t�|�r.||�}||kr(q.|}q|S)Ncs,�j��D]}�j|��j||�}q
|Sr	)rIr5�subrJ)rPrBrrr�_interpolate�sz-VariableSet.interpolate.<locals>._interpolate)�_VAR�search)r
rPrRZnvaluerrrr9�s
zVariableSet.interpolatecCst|j���S)z�
        Return the list of variable names.

        Parameters
        ----------
        None

        Returns
        -------
        names : list of str
            The names of all variables in the `VariableSet` instance.

        )r4rHr5rrrr�	variables�szVariableSet.variablescCs
|j|Sr	)rH)r
r-rrr�__getitem__�szVariableSet.__getitem__cCs||j|<|�||�dSr	)rHrLrOrrr�__setitem__�s
zVariableSet.__setitem__N)rrrrrrKrLr9rUrVrWrrrrr�srcCsR|�d�std��t|�d��}dD]}||vr$td|��q$d|vrNg|d<|S)N�metazNo meta section found !)r-r.r0z6Option %s (section [meta]) is mandatory, but not foundr/)�has_sectionrrFrG)�configr&rBrrr�
parse_meta�s
�r[cCs:|�d�std��i}|�d�D]\}}|||<q t|�S)NrUzNo variables section found !)rYrrGr)rZr&r-rPrrr�parse_variables�s

r\cCsttfSr	)Zmeta_d�r)rZrrr�parse_sections�sr^cCsd|S)Nz%s.inir)�pkg_namerrr�pkg_to_filename�sr`cs�|r�fdd�|D�}n�g}t�}|�|�}t|�dksJtdt|���t|�}i}|�d�r�|�d�D]\}}t|�||<qjdd�|�	�D�}	i}
i}|	D]H}i}
|�
|d�r�|�|d�||<|�|�D]\}}||
|<q�|
|
|<q�|||
|fS)Ncsg|]}tj�|���qSr)�os�pathr?)rAr&��filenamerrrD�rEz parse_config.<locals>.<listcomp>�zCould not find file(s) %srUcSsg|]}|dvr|�qS))rXrUr)rA�srrrrDrEr/)r�readr!r�strr[rYrGr,r3Z
has_option�get)rd�dirs�	filenamesrZ�nrXr2r-rPZsecsr3r/rfr&rrcr�parse_config�s.



rmcs���fdd���|�\}}}}d|vrtd|vrt|d}|tjvrTtd||df��tj|}ttj�|j��|d<t|d|d|d|t	|�d	�S)
Ncs�t|��\}}}}|��D]p\}}�t|��\}}}	}
|��D]\}}||vr>|||<q>|	|��D]$\}
}|rd|||
d|7<qdq||||fS)Nz %s)rmrGr`)�frXr2r3�reqsZrnameZrvalueZnmetaZnvarsZ	nsectionsZnreqsrBrCZonameZovalue��_read_configrjrrrqs
z&_read_config_imp.<locals>._read_configZpkgdir�pkgnamez-You should import %s to get information on %sr-r.r0)r-r.r0r3r2)
�sys�modules�
ValueErrorr,rarb�dirname�__file__rr)rkrjrXr2r3rorr�modrrpr�_read_config_imps

�
�rycCs<z
t|WSty6tt|�|�}|t|<|YS0dS)a
    Return library info for a package from its configuration file.

    Parameters
    ----------
    pkgname : str
        Name of the package (should match the name of the .ini file, without
        the extension, e.g. foo for the file foo.ini).
    dirs : sequence, optional
        If given, should be a sequence of directories - usually including
        the NumPy base directory - where to look for npy-pkg-config files.

    Returns
    -------
    pkginfo : class instance
        The `LibraryInfo` instance containing the build information.

    Raises
    ------
    PkgNotFound
        If the package is not found.

    See Also
    --------
    misc_util.get_info, misc_util.get_pkg_info

    Examples
    --------
    >>> npymath_info = np.distutils.npy_pkg_config.read_config('npymath')
    >>> type(npymath_info)
    <class 'numpy.distutils.npy_pkg_config.LibraryInfo'>
    >>> print(npymath_info)
    Name: npymath
    Description: Portable, core math library implementing C99 standard
    Requires:
    Version: 0.1  #random

    N)�_CACHE�KeyErrorryr`)rrrjrCrrrrFs'
r�__main__)�OptionParserz--cflagsr7�
store_truez*output all preprocessor and compiler flags)�dest�action�helpz--libsr<zoutput all linker flagsz
--use-sectionr;z/use this section instead of default for options)rr�z	--versionr0zoutput versionz--atleast-version�min_versionzMinimal versionz
--list-all�list_allz--define-variable�define_variablez%Replace variable with the given valuerz(Expect package name on the command line:z*.iniz
%s	%s - %sreZNPY_PKG_CONFIG_PATHznumpy/core/lib/npy-pkg-config�.r6z([\S]+)=([\S]+)zH--define-variable option should be of the form --define-variable=foo=bar)N)N)N)9rsrMraZconfigparserr�__all__rNrS�OSErrorrrrr,rrr[r\r^r`rmryrzrrZoptparser}�glob�parserZ
add_option�
parse_args�argv�options�argsr!rur��filesrn�info�printr-r.r_�environrir&r;r�rTr@�grouprPr2r7r<r0r�rrrr�<module>s�
*HD
$
(
3

�
��
��
��







Zerion Mini Shell 1.0