%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib/python3/dist-packages/setuptools/__pycache__/
Upload File :
Create Path :
Current File : //lib/python3/dist-packages/setuptools/__pycache__/build_meta.cpython-312.pyc

�


_�d{N��,�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  �7/usr/lib/python3/dist-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�Zd�Zdede	efd�Z
dede	efd�Zdede	efd	�Zdede	efd
�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��d�tjjjD�}|D��chc]}|D]}|s�|��	�c}}Scc}}w)z>Global options accepted by setuptools (e.g. quiet or verbose).c3�&K�|]	}|dd���y�w)N�r()rK�opts  r"rNzB_ConfigSettingsTranslator._valid_global_options.<locals>.<genexpr>�s����R�s�3�r��7�R�s�)r<�distr*�global_options)r!�options�long_and_short�flags    r"�_valid_global_optionsz/_ConfigSettingsTranslator._valid_global_options�s?��R�j�o�o�&B�&B�&Q�&Q�R��+2�V��~�V�t�QU��V��V�V��Vs
�A�Ac#���K�|xsi}hd�}d|vsd|vrIt|jd�xs|jd�xsd�}|j�|vrdnd��d|vsd|vrIt|jd�xs|jd�xsd�}|j�|vrdnd��|j��|j	d	|�}�fd
�|D�Ed{���y7��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--quiet�--global-optionc3�J�K�|]}|jd��vs�|���y�w)rN)�strip)rK�arg�valids  �r"rNz9_ConfigSettingsTranslator._global_args.<locals>.<genexpr>�s �����C�C�3�9�9�S�>�U�+B�C�C�s�#�#N)rlrj�lowerr{rq)r!rgro�falsey�level�argsr�s      @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��=��*�*�,����� 1�?�C��C�4�C�C�C�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-dater�z
--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#�*K�|jd|�}|j�}g}|D]+}|jd�|vs�|j|�|���-|jd|�Ed{���|rt	j
dd|�d�d�	�yy7�$�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']
        >>> warnings.simplefilter('error', SetuptoolsDeprecationWarning)
        >>> list(fn({'--global-option': 'foo'}))  # doctest: +IGNORE_EXCEPTION_DETAIL
        Traceback (most recent call last):
        SetuptoolsDeprecationWarning: ...arguments given via `--global-option`...
        r�rz--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��	�)�due_date)rqr{r��appendr
�emit)r!rgr��global_opts�bad_argsr�s      r"�_arbitrary_argsz)_ConfigSettingsTranslator._arbitrary_args
s�����.��� 1�?�C���0�0�2�����	�C��y�y��~�[�0�����$��	�	�
�#�#�$4�o�F�F�F��(�-�-�I��'�l�+��
'�
��	G�s�=B�,B�,B�-%BN)r%r&r'�__doc__rl�_ConfigSettingsrrqr{rr��)_ConfigSettingsTranslator__dist_info_argsr�r�r(r$r"rere�s����D�s�D�_�D��c��D�,W�
 D�O� D���
� D�D>��>�H�S�M�>�4)�o�)�(�3�-�)� +��+�8�C�=�+r$rec��eZdZd�Zdd�Zdd�Zdd�Zdededefd	�Zdedede	fd
�Z
	dd�Zd�Z	dd
�Z
dd�Zdeedeefd�Zes	dd�Zdd�Z	dd�Zyy)�_BuildMetaBackendc�L�gtjdd�|j|��d�|j|��t_	tj�5|j
�ddd�|S#1swY|SxYw#t$r}||jz
}Yd}~|Sd}~wwxYw)Nr	�egg_info)	�sys�argvr�r�r*r4�	run_setuprr )r!rg�requirements�es    r"�_get_build_requiresz%_BuildMetaBackend._get_build_requires<s���
�
�X�X�b�q�\�
�
�
�
��
/�
�
�
��
!�
!�/�
2�	
���	)��#�#�%�
!���� �
!�
��
!�
���&�	)��A�L�L�(�L����	)�s6�B�A3�)B�3A=�8B�=B�	B#�	B�B#c�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
r�)r!r\�__file__r%rLr�r�s       r"r�z_BuildMetaBackend.run_setupKs����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!rgs  r"rz._BuildMetaBackend.get_requires_for_build_wheelbs���'�'��w�i�'�P�Pr$c�(�|j|g��S)Nr�r�r�s  r"rz._BuildMetaBackend.get_requires_for_build_sdistes���'�'��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_directoryhsC���,�,�-?��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_directoryus���!�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_wheel�s���
�
�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�|�|j|��t_t�5|j�ddd�t||�}tjj||�}tjj|�rtj|�tj tjj||�|�ddd�|S#1swY��xYw#1swYSxYw)NT)�exist_okz.tmp-)�prefix�dirr	z
--dist-dirr()r@rBr��makedirs�tempfile�TemporaryDirectoryr�r�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_dir�sO���7�7�?�?�+;�<��	���$�t�4�&�/?�@�	�
�
(�
(�
5�9�
5�	P������"�1����"�"�?�3�����	�
���%�%�o�6�
�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�3BE%�E"	�E%�%E/c�l�t�5|jdgd||�cddd�S#1swYyxYw)N�bdist_wheel�.whl)rcr�)r!�wheel_directoryrgr�s    r"rz_BuildMetaBackend.build_wheel�s8��(�
)�	��,�,�����/��	�	�	�s�*�3c�.�|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�sP��!��#�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__�getenvr�rr�r��
BaseExceptionrrvr*r7r>rGrSr]rcrlr�rer�r��_BACKENDrrrrrrrrrr(r$r"�<module>rs����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���Y�Y�x`�1�`�F%%�/�%%�R���'�D�D��'�D�D��#+�#L�#L� ��"�"���"�"���&.�&N�&N�#�*2�*V�*V�'��,�,�N�%�
&�
r$

Zerion Mini Shell 1.0