Your IP : 3.142.198.250


Current Path : /opt/alt/python312/lib/python3.12/site-packages/setuptools/__pycache__/
Upload File :
Current File : //opt/alt/python312/lib/python3.12/site-packages/setuptools/__pycache__/build_meta.cpython-312.pyc

�

t��e�H��,�dZddlZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
mZddlm
Z
mZmZmZmZddlZddlZddlmZddlmZddlmZdd	l	mZdd
lmZgd�Zej<dd
�j?�Z de jCdd�vZ"Gd�de#�Z$Gd�dejJjL�Z&ejNd��Z(d�Z)d�Z*d�Z+ejNd��Z,ee
e-ee-ee-dffZ.	Gd�d�Z/Gd�de/�Z0Gd�de0�Z1e0�Z2e2jfZ3e2jhZ4e2jjZ5e2jlZ6e2jnZ7e"s$e2jpZ8e2jrZ9e2jtZ:e1�Z;y) 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��eZdZd�Zy)rc��||_y�N)�
specifiers)�selfr s  ��/builddir/build/BUILDROOT/alt-python312-setuptools-69.0.2-1.el8.x86_64/opt/alt/python312/lib/python3.12/site-packages/setuptools/build_meta.py�__init__zSetupRequirementsError.__init__Ds	��$���N)�__name__�
__module__�__qualname__r#�r$r"rrCs��%r$rc�@�eZdZd�Zeejd���Zy)�Distributionc�@�tt|��}t|��r)�listrr)r!r �specifier_lists   r"�fetch_build_eggszDistribution.fetch_build_eggsIs���m�J�7�8��$�^�4�4r$c#��K�tjj}|tj_	d��|tj_y#|tj_wxYw�w)zw
        Replace
        distutils.dist.Distribution with this class
        for the duration of this context.
        N)�	distutils�corer*)�cls�origs  r"�patchzDistribution.patchNsC�����~�~�*�*��&)�	���#�	/��*.�I�N�N�'��$�I�N�N�'�s�0A'�A
�A'�
A$�$A'N)r%r&r'r.�classmethod�
contextlib�contextmanagerr4r(r$r"r*r*Hs)��5�
����/���/r$r*c#�K�tj}d�t_	d��|t_y#|t_wxYw�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.
    c��yrr()�attrss r"�<lambda>z+no_install_setup_requires.<locals>.<lambda>gs�r$N)�
setuptools�_install_setup_requires)r3s r"�no_install_setup_requiresr>^s3�����-�-�D�);�J�&�2�
�-1�
�*��T�
�*�s�A�0�A�
=�Ac	���tj|�D�cgc]B}tjjtjj	||��s�A|��Dc}Scc}wr)�os�listdir�path�isdir�join)�a_dir�names  r"�_get_immediate_subdirectoriesrGnsG�����E�*���b�g�g�m�m�B�G�G�L�L��PT�<U�.V�����s�AA"�A"c�~���fd�tj|�D�}	|\}|S#t$rtd��wxYw)Nc3�F�K�|]}|j��s�|���y�wr)�endswith)�.0�f�	extensions  �r"�	<genexpr>z'_file_with_extension.<locals>.<genexpr>us�����J�a�A�J�J�y�4I��J�s�!�!z[No distribution was found. Ensure that `setup.py` is not empty and that it calls `setup()`.)r@rA�
ValueError)�	directoryrM�matching�files `  r"�_file_with_extensionrStsL���J�2�:�:�i�0�J�H�
�����K���
��
8�
�	
�
�s�'�<c��tjj|�stjd�Sttdt�|�S)Nz%from setuptools import setup; setup()�open)r@rB�exists�io�StringIO�getattr�tokenizerU��setup_scripts r"�_open_setup_scriptr]�s8��
�7�7�>�>�,�'��{�{�C�D�D�*�7�8�V�T�*�<�8�8r$c#�K�tj�5tjdd�d��ddd�y#1swYyxYw�w)N�ignorezsetup.py install is deprecated)�warnings�catch_warnings�filterwarningsr(r$r"�suppress_known_deprecationrc�s:����	�	 �	 �	"������*J�K�
����s�A�;�	A�A�Ac��eZdZdZdededeefd�Zdedeefd�Z	dedeefd�Z
dedeefd�Zdedeefd	�Zy
)�_ConfigSettingsTranslatorz�Translate ``config_settings`` into distutils-style command arguments.
    Only a limited number of options is currently supported.
    �key�config_settings�returnc��|xsi}|j|�xsg}t|t�rtj|�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)r!rfrg�cfg�optss     r"�_get_configz%_ConfigSettingsTranslator._get_config�s=��$�#����w�w�s�|�!�r��$.�t�S�$9�u�{�{�4� �C�t�Cr$c#�K�|xsi}hd�}d|vsd|vrIt|jd�xs|jd�xsd�}|j�|vrdnd��d|vsd|vrIt|jd�xs|jd�xsd�}|j�|vrdnd��|jd	|�Ed
{���y
7��w)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']
        >�0�no�off�false�verbosez	--verbose�1z-qz-v�quietz--quietz--global-optionN)rlrj�lowerrq)r!rgro�falsey�levels     r"�_global_argsz&_ConfigSettingsTranslator._global_args�s�����*�#���,�����{�c�1�����	�*�I�c�g�g�k�.B�I�c�J�E� �;�;�=�F�2�4��=��c�>�Y�#�-������(�E�C�G�G�I�,>�E�#�F�E� �;�;�=�F�2�4��=��#�#�$5��G�G�G�s�CC�C
�Cc#�K�|xsi}d|vr#tt|dxsd��}|rdnd��d|vrdt|d�gEd{���yy7��w)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 reuse 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-datervz
--tag-datez	--no-datez	tag-buildz--tag-buildN)rrl)r!rgro�vals    r"�__dist_info_argsz*_ConfigSettingsTranslator.__dist_info_args�sd����&�#�������C��J�� :�7�;�<�C�#&�<�K�8��#��%�s�3�{�+;�'<�=�=�=��=�s�AA�A�Ac#�K�|xsi}|jd�xs|jd�}|sydt|�gEd{���y7��w)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-mode�
editable_modeNz--mode)rjrl)r!rgro�modes    r"�_editable_argsz(_ConfigSettingsTranslator._editable_args�sF�����#����w�w��'�C�3�7�7�?�+C�����c�$�i�(�(�(�s�>A�A�Ac#�DK�|jd|�Ed{���y7��w)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']
        >>> list(fn({'--global-option': 'foo'}))
        []
        z--build-optionN)rq�r!rgs  r"�_arbitrary_argsz)_ConfigSettingsTranslator._arbitrary_argss����*�#�#�$4�o�F�F�F�s� �� N)
r%r&r'�__doc__rl�_ConfigSettingsrrqrr}�)_ConfigSettingsTranslator__dist_info_argsr�r�r(r$r"rere�s����D�s�D�_�D��c��D�,H�O�H���
�H�@>��>�H�S�M�>�4)�o�)�(�3�-�)� G��G�8�C�=�Gr$rec��eZdZd�Zdd�Zdd�Zdd�Zdededefd	�Zdedede	fd
�Z
	dd�Zd�Z	dd
�Z
dd�Zdeedeefd�Zes	dd�Zdd�Z	dd�Zyy)�_BuildMetaBackendc�*�gtjdd�|j|��d�t_	tj	�5|j�ddd�|S#1swY|SxYw#t$r}||jz
}Yd}~|Sd}~wwxYw)Nr	�egg_info)�sys�argvr}r*r4�	run_setuprr )r!rg�requirements�es    r"�_get_build_requiresz%_BuildMetaBackend._get_build_requiress���
�
�X�X�b�q�\�
�
�
�
��
/�
�
�
���
	)��#�#�%�
!���� �
!�
��
!�
���&�	)��A�L�L�(�L����	)�s5�A/�A"�A/�"A,�'A/�,A/�/	B�8B
�
Bc�f�tjj|�}d}t|�5}|j	�jdd�}ddd�	t
t��y#1swY�xYw#t$r/}|jr�tjddd��Yd}~yd}~wwxYw)N�__main__z\r\nz\nz6Running `setup.py` directly as CLI tool is deprecated.znPlease avoid using `sys.exit(0)` or similar statements that don't fit in the paradigm of a configuration file.zAhttps://blog.ganssle.io/articles/2021/10/setup-py-deprecated.html)�see_url)r@rB�abspathr]�read�replace�exec�locals�
SystemExit�coder
�emit)r!r\�__file__r%rLr�r�s       r"r�z_BuildMetaBackend.run_setup-s����7�7�?�?�<�0����
��
)�	4�Q��6�6�8�#�#�G�U�3�D�	4�	���v�x� �		4�	4��
�
	��v�v��(�-�-�H�J�+�	
�
��	
	�s#�!A,�A8�,A5�8	B0�%B+�+B0Nc�*�|j|dg��S)N�wheel�r��r�r�s  r"rz._BuildMetaBackend.get_requires_for_build_wheelDs���'�'��w�i�'�P�Pr$c�(�|j|g��S)Nr�r�r�s  r"rz._BuildMetaBackend.get_requires_for_build_sdistGs���'�'��b�'�I�Ir$�metadata_directory�suffixrhc��|j||�}t|j|�stjt|�|�|jS)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�moverlrF)r!r�r��info_dirs    r"�_bubble_up_info_directoryz+_BuildMetaBackend._bubble_up_info_directoryJsC���,�,�-?��H������*<�=��K�K��H�
�'9�:��}�}�r$c�P�tj|�D]m\}}}|D�cgc]}|j|�s�|��}}t|�dk7st|�dk7s�Et|�dk(sJd|�d���t	||d�cSd|�d|��}tj|��cc}w)Nrr	z	Multiple z directories foundzNo z directory found in )r@�walkrJ�lenrr
�
InternalError)	r!r�r�r��dirsrrL�
candidates�msgs	         r"r�z&_BuildMetaBackend._find_info_directoryWs���!�w�w�'9�:�	3�O�F�D�!�%)�@��Q�Z�Z��-?�!�@�J�@��:��!�#�s�4�y�A�~��:��!�+�S�y���@R�-S�S��F�J�q�M�2�2�	3��F�8�/�0B�/C�D���"�"�3�'�'��As
�B#�B#c��gtjdd�|j|��d�d�|�d�t_t�5|j	�ddd�|j|d�|j|d�S#1swY�-xYw)Nr	�	dist_infoz--output-dirz--keep-egg-infoz	.egg-infoz
.dist-info)r�r�r}r>r�r��r!r�rgs   r"rz2_BuildMetaBackend.prepare_metadata_for_build_wheelbs���
�
�X�X�b�q�\�
�
�
�
��
/�
�
�
�
�	
�

�
�
�

���'�
(�	��N�N��	�	
�&�&�'9�;�G��-�-�.@�,�O�O�		�	�s�A?�?Bc���tjj|�}tj|d��d|d�}t	j
di|��5}gtjdd�|j|��|�d�|�t_t�5|j�ddd�t||�}tjj||�}tjj|�rtj|�tjtjj||�|�ddd�|S#1swY��xYw#1swYSxYw)NT)�exist_okz.tmp-)�prefix�dirr	z
--dist-dirr()r@rBr��makedirs�tempfile�TemporaryDirectoryr�r�r}r>r�rSrDrV�remove�rename)	r!�
setup_command�result_extension�result_directoryrg�	temp_opts�tmp_dist_dir�result_basename�result_paths	         r"�_build_with_temp_dirz&_BuildMetaBackend._build_with_temp_dirss:���7�7�?�?�+;�<��	���$�t�4�&�/?�@�	�
�
(�
(�
5�9�
5�	P������"�1����"�"�?�3�����	�
��C�H�+�,�
!���� �
!�3�<�AQ�R�O��'�'�,�,�'7��I�K��w�w�~�~�k�*��	�	�+�&��I�I�b�g�g�l�l�<��A�;�O�!	P�$��
!�
!��	P�$��s&�AE�E�"BE�E	�
E�Ec��t�5|jdg|j|��d||�cddd�S#1swYyxYw)N�bdist_wheel�.whl)rcr�r�)r!�wheel_directoryrgr�s    r"rz_BuildMetaBackend.build_wheel�sL��(�
)�	��,�,��G��!5�!5�o�!F�G����	�	�	�	�s	�&;�Ac�.�|jgd�d||�S)N)�sdistz	--formats�gztarz.tar.gz)r�)r!�sdist_directoryrgs   r"rz_BuildMetaBackend.build_sdist�s���(�(�+�Y���
�	
r$c��|sytt|�jd��}t|�dksJ�|rt	|d�SdS)Nz*.dist-infor	r)r,r�globr�rl)r!r��dist_info_candidatess   r"�_get_dist_info_dirz$_BuildMetaBackend._get_dist_info_dir�sM��!��#�D�);�$<�$A�$A�-�$P�Q���'�(�A�-�-�/C�s�'��*�+�M��Mr$c���|j|�}|rd|gng}dg|�|j|��}t�5|j|d||�cddd�S#1swYyxYw)Nz--dist-info-dir�editable_wheelr�)r�r�rcr�)r!r�rgr�r�rp�cmds       r"rz _BuildMetaBackend.build_editable�ss���.�.�/A�B�H�4<�%�x�0�"�D�#�R�d�R�T�-@�-@��-Q�R�C�+�-�
��0�0����/��
�
�
�s�A�A!c�$�|j|�Sr)rr�s  r"rz1_BuildMetaBackend.get_requires_for_build_editable�s���4�4�_�E�Er$c�&�|j||�Sr)rr�s   r"rz5_BuildMetaBackend.prepare_metadata_for_build_editable�s���8�8�"�O��
r$�zsetup.pyr)NN)r%r&r'r�r�rrrlr�rr�rr�rrrr��LEGACY_EDITABLErrrr(r$r"r�r�s�����.Q�J��C����QT��	(�s�	(�C�	(�D�	(�37�P�"�<IM�	�
�
N�X�c�]�N�x�PS�}�N��MQ�
	�	F�7;�	�)r$r�c�$��eZdZdZd�fd�	Z�xZS)�_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.
    c�,��ttj�}tjj	tjj|��}|tjvr tjj
d|�tjd}|tjd<	tt|�+|��|tjdd|tjd<y#|tjdd|tjd<wxYw)Nrr[)r,r�rBr@�dirnamer��insertr��superr�r�)r!r\�sys_path�
script_dir�
sys_argv_0�	__class__s     �r"r�z!_BuildMetaLegacyBackend.run_setup�s��������>���W�W�_�_�R�W�W�_�_�\�%B�C�
��S�X�X�%��H�H�O�O�A�z�*�
�X�X�a�[�
�"������		%��)�4�:��:�U�#�C�H�H�Q�K�$�C�H�H�Q�K��#�C�H�H�Q�K�$�C�H�H�Q�K�s�0C+�+(Dr�)r%r&r'r�r��
__classcell__)r�s@r"r�r��s���	�%�%r$r�)<r�rWr@rmr�rZr�r6r�r`�pathlibr�typingrrrrrr<r0rr
�_pathr�_reqsrr
�distutils.utilr�__all__�getenvrzrr�r��
BaseExceptionr�distr*r7r>rGrSr]rcrlr�rer�r��_BACKENDrrrrrrrrrr(r$r"�<module>r�s����8
�	��
��
�����8�8����� �2�$���'�R�Y�Y�'C�R�H�N�N�P��#�'A�'I�'I�#�s�'S�S��%�]�%�
/�:�?�?�/�/�/�,���2��2��	�9��������4��U�3��S�	�4�+?�%@� @�A�B���|G�|G�~b�1�b�J%%�/�%%�R���'�D�D��'�D�D��#+�#L�#L� ��"�"���"�"���&.�&N�&N�#�*2�*V�*V�'��,�,�N�%�
&�
r$

?>