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: //usr/local/lib/python3.7/site-packages/setuptools/__pycache__/build_meta.cpython-37.pyc
B

N��gBM�
@s�dZddlZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
mZddlm
Z
mZmZmZmZddlZddlZddlmZddlmZddlmZdd	l	mZdd
lmZddd
dddddddg
Ze�dd���Z de �!dd�kZ"Gdd�de#�Z$Gdd�dej%j&�Z&ej'dd��Z(dd �Z)d!d"�Z*d#d$�Z+ej'd%d&��Z,ee
e-ee-ee-dffZ.Gd'd(�d(�Z/Gd)d*�d*e/�Z0Gd+d,�d,e0�Z1e0�Z2e2j3Z3e2j4Z4e2j5Z5e2j6Z6e2j7Z7e"�s�e2j8Z8e2j9Z9e2j:Z:e1�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�9/tmp/pip-unpacked-wheel-yrlplx0q/setuptools/build_meta.py�__init__BszSetupRequirementsError.__init__N)�__name__�
__module__�__qualname__r rrrrrAsc@s&eZdZdd�Zeejdd���ZdS)�DistributioncCstt|��}t|��dS)N)�listrr)rrZspecifier_listrrr�fetch_build_eggsGszDistribution.fetch_build_eggsccs*tjj}|tj_z
dVWd|tj_XdS)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+rrrrr$Fsr$ccs(tj}dd�t_z
dVWd|t_XdS)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.
    cSsdS)Nr)�attrsrrr�<lambda>e�z+no_install_setup_requires.<locals>.<lambda>N)�
setuptoolsZ_install_setup_requires)r*rrr�no_install_setup_requires\s


r3cs�fdd�t���D�S)Ncs&g|]}tj�tj��|��r|�qSr)�os�path�isdir�join)�.0�name)�a_dirrr�
<listcomp>msz1_get_immediate_subdirectories.<locals>.<listcomp>)r4�listdir)r:r)r:r�_get_immediate_subdirectorieslsr=csD�fdd�t�|�D�}y
|\}Wntk
r>td��YnX|S)Nc3s|]}|���r|VqdS)N)�endswith)r8�f)�	extensionrr�	<genexpr>ssz'_file_with_extension.<locals>.<genexpr>z[No distribution was found. Ensure that `setup.py` is not empty and that it calls `setup()`.)r4r<�
ValueError)�	directoryr@Zmatching�filer)r@r�_file_with_extensionqs
rEcCs&tj�|�st�d�Sttdt�|�S)Nz%from setuptools import setup; setup()�open)r4r5�exists�io�StringIO�getattr�tokenizerF)�setup_scriptrrr�_open_setup_scripts
rMc	cs*t���t�dd�dVWdQRXdS)N�ignorezsetup.py install is deprecated)�warnings�catch_warnings�filterwarningsrrrr�suppress_known_deprecation�s
rRc@s~eZdZdZeeeed�dd�Zdd�Zee	ed�dd	�Z
ee	ed�d
d�Zee	ed�dd
�Zee	ed�dd�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}|�|�pg}t|t�r*t�|�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)rrTrU�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)r8�optrrrrA�szB_ConfigSettingsTranslator._valid_global_options.<locals>.<genexpr>cSsh|]}|D]}|r|�qqSrr)r8Zlong_and_short�flagrrr�	<setcomp>�szB_ConfigSettingsTranslator._valid_global_options.<locals>.<setcomp>)r2�distr$�global_options)r�optionsrrr�_valid_global_options�sz/_ConfigSettingsTranslator._valid_global_options)rUrVc#s�|pi}ddddh}d|ks$d|krVt|�d�p<|�d�p<d�}|��|krPdnd	Vd
|ksfd|kr�t|�d
�p~|�d�p~d�}|��|kr�d	ndV|���|�d|�}�fd
d�|D�EdHdS)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']
        �false�no�0�off�verbosez	--verbose�1z-qz-v�quietz--quietz--global-optionc3s |]}|�d��kr|VqdS)rN)�strip)r8�arg)�validrrrA�sz9_ConfigSettingsTranslator._global_args.<locals>.<genexpr>N)rYrW�lowerrfr^)rrUr\Zfalsey�level�argsr)rpr�_global_args�sz&_ConfigSettingsTranslator._global_argsccsT|pi}d|kr2tt|dpd��}|r,dndVd|krPdt|d�gEdHdS)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-datergz
--tag-datez	--no-datez	tag-buildz--tag-buildN)r
rY)rrUr\�valrrrZ__dist_info_args�sz*_ConfigSettingsTranslator.__dist_info_argsccs:|pi}|�d�p|�d�}|s$dSdt|�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)rWrY)rrUr\�moderrr�_editable_args�s

z(_ConfigSettingsTranslator._editable_argsccsv|�d|�}|��}g}x*|D]"}|�d�|kr|�|�|VqW|�d|�EdH|rrtjdd|�d�dd	�dS)
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`...
        z--global-optionrz--build-optionNz7Incompatible `config_settings` passed to build backend.z
                The arguments z� were given via `--global-option`.
                Please use `--build-option` instead,
                `--global-option` is reserved for flags like `--verbose` or `--quiet`.
                )i��	�)Zdue_date)r^rfrn�appendr�emit)rrUrsZglobal_optsZbad_argsrorrr�_arbitrary_argss



z)_ConfigSettingsTranslator._arbitrary_argsN)r!r"r#�__doc__rY�_ConfigSettingsrr^rfrrtZ)_ConfigSettingsTranslator__dist_info_argsrwr|rrrrrS�s"rSc@s�eZdZdd�Zd!dd�Zd"dd�Zd#d	d
�Zeeed�dd
�Zeee	d�dd�Z
d$dd�Zdd�Zd%dd�Z
d&dd�Zeeeed�dd�Zes�d'dd�Zd(dd�Zd)dd �ZdS)*�_BuildMetaBackendc
Csvtjdd�|�|�d|�|��t_y t���|��WdQRXWn,tk
rp}z||j7}Wdd}~XYnX|S)Nr�egg_info)r�)	�sys�argvrtr|r$r+�	run_setuprr)rrU�requirements�errr�_get_build_requires:s
z%_BuildMetaBackend._get_build_requires�setup.pyc	CsDtj�|�}d}t|��}|���dd�}WdQRXt|t��dS)N�__main__z\r\nz\n)r4r5�abspathrM�read�replace�exec�locals)rrL�__file__r!r?�coderrrr�Is

z_BuildMetaBackend.run_setupNcCs|j|dgd�S)N�wheel)r�)r�)rrUrrrrTsz._BuildMetaBackend.get_requires_for_build_wheelcCs|j|gd�S)N)r�)r�)rrUrrrrWsz._BuildMetaBackend.get_requires_for_build_sdist)�metadata_directory�suffixrVcCs.|�||�}t|j|�s(t�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�moverYr9)rr�r��info_dirrrr�_bubble_up_info_directoryZsz+_BuildMetaBackend._bubble_up_info_directorycs�xlt�|�D]^\}}}�fdd�|D�}t|�dks@t|�dkrt|�dks\td��d���t||d�SqWd��d|��}t�|��dS)	Ncsg|]}|���r|�qSr)r>)r8r?)r�rrr;isz:_BuildMetaBackend._find_info_directory.<locals>.<listcomp>rrz	Multiple z directories foundzNo z directory found in )r4�walk�len�AssertionErrorrr	Z
InternalError)rr�r�r��dirsr�
candidates�msgr)r�rr�gsz&_BuildMetaBackend._find_info_directoryc	CsVtjdd�|�|�dd|df�t_t��|��WdQRX|�|d�|�|d�S)NrZ	dist_infoz--output-dirz--keep-egg-infoz	.egg-infoz
.dist-info)r�r�rtr3r�r�)rr�rUrrrrrs
z2_BuildMetaBackend.prepare_metadata_for_build_wheelc	
Cs�tj�|�}tj|dd�d|d�}tjf|���}tjdd�|�|�|d|f|�	|��t_t
��|��WdQRXt||�}tj�
||�}tj�|�r�t�|�t�tj�
||�|�WdQRX|S)NT)�exist_okz.tmp-)�prefix�dirrz
--dist-dir)r4r5r��makedirs�tempfile�TemporaryDirectoryr�r�rtr|r3r�rEr7rG�remove�rename)	rZ
setup_commandZresult_extensionZresult_directoryrUZ	temp_optsZtmp_dist_dirZresult_basename�result_pathrrr�_build_with_temp_dir�s$

 z&_BuildMetaBackend._build_with_temp_dirc	Cs$t��|�dgd||�SQRXdS)N�bdist_wheelz.whl)rRr�)r�wheel_directoryrUr�rrrr�s
z_BuildMetaBackend.build_wheelcCs|�dddgd||�S)N�sdistz	--formats�gztarz.tar.gz)r�)r�sdist_directoryrUrrrr�sz_BuildMetaBackend.build_sdist)r�rVcCs>|sdStt|��d��}t|�dks*t�|r:t|d�SdS)Nz*.dist-inforr)r%r�globr�r�rY)rr�Zdist_info_candidatesrrr�_get_dist_info_dir�s
z$_BuildMetaBackend._get_dist_info_dirc	CsL|�|�}|rd|gng}d||�|��}t��|�|d||�SQRXdS)Nz--dist-info-dir�editable_wheelz.whl)r�)r�rwrRr�)rr�rUr�r�r]�cmdrrrr�s
z _BuildMetaBackend.build_editablecCs
|�|�S)N)r)rrUrrrr�sz1_BuildMetaBackend.get_requires_for_build_editablecCs|�||�S)N)r)rr�rUrrrr�sz5_BuildMetaBackend.prepare_metadata_for_build_editable)r�)N)N)N)NN)N)NN)N)N)r!r"r#r�r�rrrYr�rr�rr�rrrr��LEGACY_EDITABLErrrrrrrr9s 








rcs"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.
    �setup.pyc
s�ttj�}tj�tj�|��}|tjkr6tj�d|�tjd}|tjd<ztt	|�j
|d�Wd|tjdd�<|tjd<XdS)Nr)rL)r%r�r5r4�dirnamer��insertr��superr�r�)rrL�sys_pathZ
script_dirZ
sys_argv_0)�	__class__rrr��s



z!_BuildMetaLegacyBackend.run_setup)r�)r!r"r#r}r��
__classcell__rr)r�rr��s
r�)<r}rHr4rZr�rKr�r-r�rO�pathlibr�typingrrrrrr2r'rr	�_pathr
Z_reqsrr�distutils.utilr
�__all__�getenvrqrr�r��
BaseExceptionrrcr$r.r3r=rErMrRrYr~rSrr�Z_BACKENDrrrrrrrrrrrrr�<module>sl)