HEX
Server: Apache
System: Linux zacp120.webway.host 4.18.0-553.50.1.lve.el8.x86_64 #1 SMP Thu Apr 17 19:10:24 UTC 2025 x86_64
User: govancoz (1003)
PHP: 8.3.26
Disabled: exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname
Upload Files
File: //opt/osm/venv/lib/python3.10/site-packages/setuptools/__pycache__/build_meta.cpython-310.pyc
o

0iSL�@s�dZddlZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
mZddlm
Z
mZmZmZmZddlZddlZddlmZddlmZddlmZdd	lmZdd
lmZgd�Ze�dd
�� �Z!de!�"dd�vZ#Gdd�de$�Z%Gdd�dej&j'�Z'ej(dd��Z)dd�Z*dd�Z+dd�Z,ej(dd��Z-ee
e.ee.ee.dffZ/	Gdd �d �Z0Gd!d"�d"e0�Z1Gd#d$�d$e1�Z2e1�Z3e3j4Z4e3j5Z5e3j6Z6e3j7Z7e3j8Z8e#s�e3j9Z9e3j:Z:e3j;Z;e2�Z<dS)%a-A PEP 517 interface to setuptools

Previously, when a user or a command line tool (let's call it a "frontend")
needed to make a request of setuptools to take a certain action, for
example, generating a list of installation requirements, the frontend would
would call "setup.py egg_info" or "setup.py bdist_wheel" on the command line.

PEP 517 defines a different method of interfacing with setuptools. Rather
than calling "setup.py" directly, the frontend should:

  1. Set the current directory to the directory with a setup.py file
  2. Import this module into a safe python interpreter (one in which
     setuptools can potentially set global variables or crash hard).
  3. Call one of the functions defined in PEP 517.

What each function does is defined in PEP 517. However, here is a "casual"
definition of the functions (this definition should not be relied on for
bug reports or API stability):

  - `build_wheel`: build a wheel in the folder and return the basename
  - `get_requires_for_build_wheel`: get the `setup_requires` to build
  - `prepare_metadata_for_build_wheel`: get the `install_requires`
  - `build_sdist`: build an sdist in the folder and return the basename
  - `get_requires_for_build_sdist`: get the `setup_requires` to build

Again, this is not a formal definition! Just a "taste" of the module.
�N)�Path)�Dict�Iterator�List�Optional�Union�)�errors)�	same_path)�
parse_strings)�SetuptoolsDeprecationWarning)�	strtobool)
�get_requires_for_build_sdist�get_requires_for_build_wheel� prepare_metadata_for_build_wheel�build_wheel�build_sdist�get_requires_for_build_editable�#prepare_metadata_for_build_editable�build_editable�
__legacy__�SetupRequirementsError�SETUPTOOLS_ENABLE_FEATURES�zlegacy-editable�_�-c@seZdZdd�ZdS)rcCs
||_dS�N)�
specifiers)�selfr�r�C/opt/osm/venv/lib/python3.10/site-packages/setuptools/build_meta.py�__init__B�
zSetupRequirementsError.__init__N)�__name__�
__module__�__qualname__r!rrrr rAsrc@s&eZdZdd�Zeejdd���ZdS)�DistributioncCstt|��}t|��r)�listrr)rrZspecifier_listrrr �fetch_build_eggsGszDistribution.fetch_build_eggsccs2�tjj}|tj_z
dVW|tj_dS|tj_w)zw
        Replace
        distutils.dist.Distribution with this class
        for the duration of this context.
        N)�	distutils�corer&)�cls�origrrr �patchLs�zDistribution.patchN)r#r$r%r(�classmethod�
contextlib�contextmanagerr-rrrr r&Fs
r&ccs.�tj}dd�t_z	dVW|t_dS|t_w)a
Temporarily disable installing setup_requires

    Under PEP 517, the backend reports build dependencies to the frontend,
    and the frontend is responsible for ensuring they're installed.
    So setuptools (acting as a backend) should not try to install them.
    cSsdSrr)�attrsrrr �<lambda>esz+no_install_setup_requires.<locals>.<lambda>N)�
setuptoolsZ_install_setup_requires)r,rrr �no_install_setup_requires\s�
r4cs�fdd�t���D�S)Ncs&g|]}tj�tj��|��r|�qSr)�os�path�isdir�join)�.0�name�Za_dirrr �
<listcomp>ms
�z1_get_immediate_subdirectories.<locals>.<listcomp>)r5�listdirr;rr;r �_get_immediate_subdirectorieslsr>cs<�fdd�t�|�D�}z|\}W|Stytd��w)Nc3s�|]
}|���r|VqdSr��endswith�r9�f��	extensionrr �	<genexpr>rs��
�z'_file_with_extension.<locals>.<genexpr>z[No distribution was found. Ensure that `setup.py` is not empty and that it calls `setup()`.)r5r=�
ValueError)�	directoryrDZmatching�filerrCr �_file_with_extensionqs
����rIcCs&tj�|�st�d�Sttdt�|�S)Nz%from setuptools import setup; setup()�open)r5r6�exists�io�StringIO�getattr�tokenizerJ��setup_scriptrrr �_open_setup_scripts
rRccsB�t���t�dd�dVWd�dS1swYdS)N�ignorezsetup.py install is deprecated)�warnings�catch_warnings�filterwarningsrrrr �suppress_known_deprecation�s
�
"�rWc@s�eZdZdZdededeefdd�Zdd�Zdede	efd	d
�Z
dede	efdd�Zdede	efd
d�Zdede	efdd�Z
dS)�_ConfigSettingsTranslatorz�Translate ``config_settings`` into distutils-style command arguments.
    Only a limited number of options is currently supported.
    �key�config_settings�returncCs.|pi}|�|�p
g}t|t�rt�|�S|S)aA
        Get the value of a specific key in ``config_settings`` as a list of strings.

        >>> fn = _ConfigSettingsTranslator()._get_config
        >>> fn("--global-option", None)
        []
        >>> fn("--global-option", {})
        []
        >>> fn("--global-option", {'--global-option': 'foo'})
        ['foo']
        >>> fn("--global-option", {'--global-option': ['foo']})
        ['foo']
        >>> fn("--global-option", {'--global-option': 'foo'})
        ['foo']
        >>> fn("--global-option", {'--global-option': 'foo bar'})
        ['foo', 'bar']
        )�get�
isinstance�str�shlex�split)rrYrZ�cfg�optsrrr �_get_config�sz%_ConfigSettingsTranslator._get_configcCs"dd�tjjjD�}dd�|D�S)z>Global options accepted by setuptools (e.g. quiet or verbose).css�|]	}|dd�VqdS)N�r)r9�optrrr rE�s�zB_ConfigSettingsTranslator._valid_global_options.<locals>.<genexpr>cSsh|]}|D]}|r|�qqSrr)r9Zlong_and_short�flagrrr �	<setcomp>�szB_ConfigSettingsTranslator._valid_global_options.<locals>.<setcomp>)r3�distr&�global_options)r�optionsrrr �_valid_global_options�sz/_ConfigSettingsTranslator._valid_global_optionsc#s��|pi}hd�}d|vsd|vr*t|�d�p|�d�pd�}|��|vr'dndVd|vs2d|vrKt|�d�p>|�d�p>d�}|��|vrHdndV|���|�d	|�}�fd
d�|D�EdHdS)
a�
        Let the user specify ``verbose`` or ``quiet`` + escape hatch via
        ``--global-option``.
        Note: ``-v``, ``-vv``, ``-vvv`` have similar effects in setuptools,
        so we just have to cover the basic scenario ``-v``.

        >>> fn = _ConfigSettingsTranslator()._global_args
        >>> list(fn(None))
        []
        >>> list(fn({"verbose": "False"}))
        ['-q']
        >>> list(fn({"verbose": "1"}))
        ['-v']
        >>> list(fn({"--verbose": None}))
        ['-v']
        >>> list(fn({"verbose": "true", "--global-option": "-q --no-user-cfg"}))
        ['-v', '-q', '--no-user-cfg']
        >>> list(fn({"--quiet": None}))
        ['-q']
        >�off�no�false�0�verbosez	--verbose�1z-qz-v�quietz--quiet�--global-optionc3s"�|]}|�d��vr|VqdS)rN)�strip)r9�arg�Zvalidrr rE�s� z9_ConfigSettingsTranslator._global_args.<locals>.<genexpr>N)r^r\�lowerrkrc)rrZraZfalsey�level�argsrrvr �_global_args�s�z&_ConfigSettingsTranslator._global_argsccsZ�|pi}d|vrtt|dpd��}|rdndVd|vr+dt|d�gEdHdSdS)a�
        The ``dist_info`` command accepts ``tag-date`` and ``tag-build``.

        .. warning::
           We cannot use this yet as it requires the ``sdist`` and ``bdist_wheel``
           commands run in ``build_sdist`` and ``build_wheel`` to re-use the egg-info
           directory created in ``prepare_metadata_for_build_wheel``.

        >>> fn = _ConfigSettingsTranslator()._ConfigSettingsTranslator__dist_info_args
        >>> list(fn(None))
        []
        >>> list(fn({"tag-date": "False"}))
        ['--no-date']
        >>> list(fn({"tag-date": None}))
        ['--no-date']
        >>> list(fn({"tag-date": "true", "tag-build": ".a"}))
        ['--tag-date', '--tag-build', '.a']
        ztag-daternz
--tag-datez	--no-datez	tag-buildz--tag-buildN)r
r^)rrZra�valrrr Z__dist_info_args�s��z*_ConfigSettingsTranslator.__dist_info_argsccs<�|pi}|�d�p|�d�}|sdSdt|�gEdHdS)a
        The ``editable_wheel`` command accepts ``editable-mode=strict``.

        >>> fn = _ConfigSettingsTranslator()._editable_args
        >>> list(fn(None))
        []
        >>> list(fn({"editable-mode": "strict"}))
        ['--mode', 'strict']
        z
editable-modeZ
editable_modeNz--mode)r\r^)rrZra�moderrr �_editable_args�s�
z(_ConfigSettingsTranslator._editable_argsccsx�|�d|�}|��}g}|D]}|�d�|vr |�|�|Vq|�d|�EdH|r:d|�d�}t�|t�dSdS)aV
        Users may expect to pass arbitrary lists of arguments to a command
        via "--global-option" (example provided in PEP 517 of a "escape hatch").

        >>> fn = _ConfigSettingsTranslator()._arbitrary_args
        >>> list(fn(None))
        []
        >>> list(fn({}))
        []
        >>> list(fn({'--build-option': 'foo'}))
        ['foo']
        >>> list(fn({'--build-option': ['foo']}))
        ['foo']
        >>> list(fn({'--build-option': 'foo'}))
        ['foo']
        >>> list(fn({'--build-option': 'foo bar'}))
        ['foo', 'bar']
        >>> warnings.simplefilter('error', SetuptoolsDeprecationWarning)
        >>> list(fn({'--global-option': 'foo'}))  # doctest: +IGNORE_EXCEPTION_DETAIL
        Traceback (most recent call last):
        SetuptoolsDeprecationWarning: ...arguments given via `--global-option`...
        rsrz--build-optionNz
            The arguments z� were given via `--global-option`.
            Please use `--build-option` instead,
            `--global-option` is reserved to flags like `--verbose` or `--quiet`.
            )rcrkrt�appendrT�warnr)rrZryZglobal_optsZbad_argsru�msgrrr �_arbitrary_argss �
���z)_ConfigSettingsTranslator._arbitrary_argsN)r#r$r%�__doc__r^�_ConfigSettingsrrcrkrrzZ)_ConfigSettingsTranslator__dist_info_argsr}r�rrrr rX�s"rXc@s�eZdZdd�Zd"dd�Zd#dd�Zd#d	d
�Zdeded
efdd�Zdeded
e	fdd�Z
	d#dd�Zdd�Z		d$dd�Z
d#dd�Zdeed
eefdd�Zese	d$dd�Zd#dd�Z	d#d d!�ZdSdS)%�_BuildMetaBackendc
Cs�gtjdd��|�|��d�|�|��t_zt���|��Wd�W|S1s,wYW|StyK}z||j7}WYd}~|Sd}~ww)Nr�egg_info)	�sys�argvrzr�r&r-�	run_setuprr)rrZ�requirements�errr �_get_build_requires7s*����

�����z%_BuildMetaBackend._get_build_requires�setup.pycCsP|}d}t|��}|���dd�}Wd�n1swYt|t��dS)N�__main__z\r\nz\n)rR�read�replace�exec�locals)rrQ�__file__r#rB�coderrr r�Fs
�z_BuildMetaBackend.run_setupNcCs|j|dgd�S)N�wheel�r��r��rrZrrr rQsz._BuildMetaBackend.get_requires_for_build_wheelcCs|j|gd�S)Nr�r�r�rrr rTsz._BuildMetaBackend.get_requires_for_build_sdist�metadata_directory�suffixr[cCs.|�||�}t|j|�st�t|�|�|jS)z�
        PEP 517 requires that the .dist-info directory be placed in the
        metadata_directory. To comply, we MUST copy the directory to the root.

        Returns the basename of the info directory, e.g. `proj-0.0.0.dist-info`.
        )�_find_info_directoryr
�parent�shutil�mover^r:)rr�r��info_dirrrr �_bubble_up_info_directoryWsz+_BuildMetaBackend._bubble_up_info_directorycs�t�|�D]1\}}}�fdd�|D�}t|�dkst|�dkr6t|�dks-Jd��d���t||d�Sqd��d|��}t�|��)	Ncsg|]	}|���r|�qSrr?rA�r�rr r<fsz:_BuildMetaBackend._find_info_directory.<locals>.<listcomp>rrz	Multiple z directories foundzNo z directory found in )r5�walk�lenrr	Z
InternalError)rr�r�r��dirsr�
candidatesr�rr�r r�ds�
z&_BuildMetaBackend._find_info_directorycCstgtjdd��|�|��d�d�|�d�t_t��|��Wd�n1s)wY|�|d�|�|d�S)NrZ	dist_infoz--output-dirz--keep-egg-infoz	.egg-infoz
.dist-info)r�r�rzr4r�r��rr�rZrrr ros$������
�z2_BuildMetaBackend.prepare_metadata_for_build_wheelc	Cs�tj�|�}tj|dd�tj|d��\}gtjdd��|�|��|�d�|�|�	|��t_t
��|��Wd�n1s@wYt||�}tj�
||�}tj�|�r\t�|�t�tj�
||�|�Wd�|S1srwY|S)NT)�exist_ok)�dirrz
--dist-dir)r5r6�abspath�makedirs�tempfile�TemporaryDirectoryr�r�rzr�r4r�rIr8rK�remove�rename)rZ
setup_commandZresult_extensionZresult_directoryrZZtmp_dist_dirZresult_basename�result_pathrrr �_build_with_temp_dir~s<������
��

��z&_BuildMetaBackend._build_with_temp_dircCs<t��|�dgd||�Wd�S1swYdS)N�bdist_wheel�.whl)rWr�)r�wheel_directoryrZr�rrr r�s

�$�z_BuildMetaBackend.build_wheelcCs|�gd�d||�S)N)�sdistz	--formats�gztarz.tar.gz)r�)r�sdist_directoryrZrrr r�s
�z_BuildMetaBackend.build_sdistcCs>|sdStt|��d��}t|�dksJ�|rt|d�SdS)Nz*.dist-inforr)r'r�globr�r^)rr�Zdist_info_candidatesrrr �_get_dist_info_dir�s
z$_BuildMetaBackend._get_dist_info_dircCsh|�|�}|rd|gng}dg|�|�|��}t��|�|d||�Wd�S1s-wYdS)Nz--dist-info-dirZeditable_wheelr�)r�r}rWr�)rr�rZr�r�rb�cmdrrr r�s
�$�z _BuildMetaBackend.build_editablecCs
|�|�Sr)rr�rrr r�r"z1_BuildMetaBackend.get_requires_for_build_editablecCs|�||�Sr)rr�rrr r�s�z5_BuildMetaBackend.prepare_metadata_for_build_editable�r�r)NN)r#r$r%r�r�rrr^r�rr�rr�rrrr��LEGACY_EDITABLErrrrrrr r�6s,




�
�

�
��r�cs"eZdZdZd�fdd�	Z�ZS)�_BuildMetaLegacyBackendaOCompatibility backend for setuptools

    This is a version of setuptools.build_meta that endeavors
    to maintain backwards
    compatibility with pre-PEP 517 modes of invocation. It
    exists as a temporary
    bridge between the old packaging mechanism and the new
    packaging mechanism,
    and will eventually be removed.
    r�c
s�ttj�}tj�tj�|��}|tjvrtj�d|�tjd}|tjd<ztt	|�j
|d�W|tjdd�<|tjd<dS|tjdd�<|tjd<w)NrrP)r'r�r6r5�dirnamer��insertr��superr�r�)rrQ�sys_pathZ
script_dirZ
sys_argv_0��	__class__rr r��s 



���z!_BuildMetaLegacyBackend.run_setupr�)r#r$r%r�r��
__classcell__rrr�r r��s
r�)=r�rLr5r_r�rOr�r/r�rT�pathlibr�typingrrrrrr3r)rr	�_pathr
Z_reqsrZ_deprecation_warningrZdistutils.utilr
�__all__�getenvrwrr�r��
BaseExceptionrrhr&r0r4r>rIrRrWr^r�rXr�r�Z_BACKENDrrrrrrrrrrrrr �<module>sb

)