Hacked By AnonymousFox

Current Path : /opt/cloudlinux/venv/lib/python3.11/site-packages/setuptools/config/__pycache__/
Upload File :
Current File : //opt/cloudlinux/venv/lib/python3.11/site-packages/setuptools/config/__pycache__/pyprojecttoml.cpython-311.pyc

�

�܋f�D���dZddlmZddlZddlZddlmZddlmZddl	m
Z
mZmZddl
mZdd	lmZmZdd
lmZddlmZdd
lmZmZddlmZe
rddlmZddlmZej e!��Z"d.d�Z#d/d�Z$	d0d1d�Z%			d2d3d�Z&			d4d5d#�Z'Gd$�d%��Z(d&�Z)ed6d'���Z*Gd(�d)ej+��Z,Gd*�d+e��Z-Gd,�d-e��Z.dS)7ac
Load setuptools configuration from ``pyproject.toml`` files.

**PRIVATE MODULE**: API reserved for setuptools internal usage only.

To read project metadata, consider using
``build.util.project_wheel_metadata`` (https://pypi.org/project/build/).
For simple scenarios, you can also try parsing the file directly
with the help of ``tomllib`` or ``tomli``.
�)�annotationsN)�contextmanager)�partial)�
TYPE_CHECKING�Callable�Mapping�)�StrPath)�	FileError�InvalidConfigError)�SetuptoolsWarning�)�expand)�_PREVIOUSLY_DEFINED�_MissingDynamic)�apply��Distribution)�Self�filepathr
�return�dictc��ddlm}t|d��5}|�|��cddd��S#1swxYwYdS)Nr	)�tomllib�rb)�compat.py310r�open�load)rr�files   �V/opt/cloudlinux/venv/lib64/python3.11/site-packages/setuptools/config/pyprojecttoml.py�	load_filer!"s���&�&�&�&�&�&�	
�h��	�	�"���|�|�D�!�!�"�"�"�"�"�"�"�"�"�"�"�"����"�"�"�"�"�"s
�9�=�=�config�boolc���ddlm}|j�d��}t	|d��r|���	|�|��S#|j$r�}d|j��}|j	�
d��dkr9t�|��t�|j
��d|j	�d	�}t|�d
|����d�d}~wwxYw)Nr)�_validate_pyprojectztrove-classifier�_disable_downloadzconfiguration error: �`�projectzinvalid pyproject.toml config: �.�
)�r%�FORMAT_FUNCTIONS�get�hasattrr&�validate�ValidationError�summary�name�strip�_logger�debug�details�
ValueError)r"r�	validator�trove_classifier�exr1�errors       r r/r/)s��2�2�2�2�2�2� �1�5�5�6H�I�I����!4�5�5�-��*�*�,�,�,�
:��!�!�&�)�)�)���$�:�:�:�6�"�*�6�6��
�7�=�=�����*�*��M�M�'�"�"�"��M�M�"�*�%�%�%�<�"�'�<�<�<���E�.�.�W�.�.�/�/�T�9�����:���s�A�
C+�%BC&�&C+F�distrc�H�t|d||��}t|||��S)zeApply the configuration from a ``pyproject.toml`` file into an existing
    distribution object.
    T)�read_configuration�_apply)r<r�ignore_option_errorsr"s    r �apply_configurationrA>s*�� ��$�0D�d�
K�
K�F��$���)�)�)�T�Distribution | Nonec�~�tj�|��}tj�|��st	d|�d����t|��pi}|�di��}|�di��}|�di��}|r|s|siSd|�di��vrt���d|vrt�d�	��|r-t|d
d���|�d|j��n|�dd
��||d<||d<t|��5|d|id�}t||��ddd��n#1swxYwY|r1tj�|��}	t!||	||��S|S)a�Read given configuration file and returns options from it as a dict.

    :param str|unicode filepath: Path to configuration file in the ``pyproject.toml``
        format.

    :param bool expand: Whether to expand directives and other computed values
        (i.e. post-process the given configuration)

    :param bool ignore_option_errors: Whether to silently ignore
        options, values of which could not be resolved (e.g. due to exceptions
        in directives such as file:, attr:, etc.).
        If False exceptions are propagated as expected.

    :param Distribution|None: Distribution object to which the configuration refers.
        If not given a dummy object will be created and discarded after the
        configuration is read. This is used for auto-discovery of packages and in the
        case a dynamic configuration (e.g. ``attr`` or ``cmdclass``) is expanded.
        When ``expand=False`` this object is simply ignored.

    :rtype: dict
    zConfiguration file z does not exist.r(�tool�
setuptools�tools�	distutilsz[tool.distutils])�subject�include_package_dataNzinclude-package-dataT)r(rE)�os�path�abspath�isfilerr!r-�_ToolsTypoInMetadata�emit�_ExperimentalConfiguration�getattr�
setdefaultrJ�_ignore_errorsr/�dirname�expand_configuration)
rrr@r<�asdict�
project_table�
tool_table�setuptools_table�subset�root_dirs
          r r>r>Js!��6�w���x�(�(�H�
�7�>�>�(�#�#�L��J�h�J�J�J�K�K�K�
�x�
 �
 �
&�B�F��J�J�y�"�-�-�M����F�B�'�'�J�!�~�~�l�B�7�7����-��+;���	��v�z�z�'�2�.�.�.�.��!�!�#�#�#��j� � �"�'�'�0B�'�C�C�C��B���4�d�;�;�G��#�#�$:�D�<U�V�V�V�V��#�#�$:�D�A�A�A��F�6�N�/�J�|��	�,�	-�	-�#�#�*�\�CS�4T�U�U�����"�"�"�#�#�#�#�#�#�#�#�#�#�#����#�#�#�#�
�R��7�?�?�8�,�,��#�F�H�6J�D�Q�Q�Q��Ms�E?�?F�Fr\�StrPath | Noner@c�J�t||||�����S)a�Given a configuration with unresolved fields (e.g. dynamic, cmdclass, ...)
    find their final values.

    :param dict config: Dict containing the configuration for the distribution
    :param str root_dir: Top-level directory for the distribution/project
        (the same directory where ``pyproject.toml`` is place)
    :param bool ignore_option_errors: see :func:`read_configuration`
    :param Distribution|None: Distribution object to which the configuration refers.
        If not given a dummy object will be created and discarded after the
        configuration is read. Used in the case a dynamic configuration
        (e.g. ``attr`` or ``cmdclass``).

    :rtype: dict
    )�_ConfigExpanderr)r"r\r@r<s    r rVrV�s%��(�6�8�-A�4�H�H�O�O�Q�Q�QrBc��eZdZ			d*d+d�Zd,d�Zd-d�Zd.d�Zd�Zd�Zd�Z	d/d�Z
d0d�Zd1d�Zd2d �Z
d3d!�Zd0d"�Zd4d$�Zd5d&�Zd6d'�Zd6d(�Zd6d)�ZdS)7r_NFr"rr\r]r@r#r<rCc��||_|ptj��|_|�di��|_|j�dg��|_|�di���di��|_|j�di��|_||_	||_
t��|_dS)Nr(�dynamicrErF)
r"rK�getcwdr\r-�project_cfgrb�setuptools_cfg�dynamic_cfgr@�_dist�set�_referenced_files)�selfr"r\r@r<s     r �__init__z_ConfigExpander.__init__�s������ �/�B�I�K�K��
�!�:�:�i��4�4����'�+�+�I�r�:�:���$�j�j���4�4�8�8��r�J�J����.�2�2�9�b�A�A���$8��!���
�+.�5�5����rBrrc�x�ddlm}|j|j�dd��d�}|jp
||��S)Nrrr2)�src_rootr2)�setuptools.distrr\rdr-rg)rjr�attrss   r �_ensure_distz_ConfigExpander._ensure_dist�sN��0�0�0�0�0�0�!�]�D�4D�4H�4H��QU�4V�4V�W�W���z�0�\�\�%�0�0�0rB�	container�field�str�fnrc��||vrCt|j��5|||��||<ddd��dS#1swxYwYdSdS�N)rTr@)rjrqrrrts    r �_process_fieldz_ConfigExpander._process_field�s����I����� 9�:�:�
8�
8�#%�2�i��&6�#7�#7�	�%� �
8�
8�
8�
8�
8�
8�
8�
8�
8�
8�
8�
8����
8�
8�
8�
8�
8�
8��s
�;�?�?�package-datac�`�|j�|i��}tj|��Srv)rer-�_expand�canonic_package_data)rjrr�package_datas   r �_canonic_package_dataz%_ConfigExpander._canonic_package_data�s+���*�.�.�u�b�9�9���+�L�9�9�9rBc���|���|���|�d��|���}t||j|j��}|5}|j}|���|�|��|�	||��ddd��n#1swxYwY|j
�|j
��|jS)Nzexclude-package-data)
�_expand_packagesr}rp�_EnsurePackagesDiscoveredrdre�package_dir�_expand_data_files�_expand_cmdclass�_expand_all_dynamicri�updater")rjr<�ctx�ensure_discoveredr�s     r rz_ConfigExpander.expand�s&���������"�"�$�$�$��"�"�#9�:�:�:�� � �"�"��'��d�.>��@S�T�T��
�	8�%�+�7�K��#�#�%�%�%��!�!�+�.�.�.��$�$�T�;�7�7�7�		8�	8�	8�	8�	8�	8�	8�	8�	8�	8�	8����	8�	8�	8�	8�	
��%�%�d�&<�=�=�=��{�s�/AC�C�	Cc��|j�d��}|�t|ttf��rdS|�d��}t|t
��rp|j|d<|j�di��|d<t|j	��5tjdi|��|jd<ddd��dS#1swxYwYdSdS)N�packages�findr\�package-dir�fill_package_dir�)rer-�
isinstance�list�tuplerr\rSrTr@rz�
find_packages)rjr�r�s   r rz _ConfigExpander._expand_packages�s8���&�*�*�:�6�6����z�(�T�5�M�B�B���F��|�|�F�#�#���d�D�!�!�	P�#�}�D���'+�':�'E�'E�m�UW�'X�'X�D�#�$��� 9�:�:�
P�
P�29�2G�2O�2O�$�2O�2O��#�J�/�
P�
P�
P�
P�
P�
P�
P�
P�
P�
P�
P�
P����
P�
P�
P�
P�
P�
P�	P�	Ps�!C�C�Cc�~�ttj|j���}|�|jd|��dS)N)r\z
data-files)rrz�canonic_data_filesr\rwre)rj�
data_filess  r r�z"_ConfigExpander._expand_data_files�s:���W�7�$�-�P�P�P�
����D�/��z�J�J�J�J�JrBr��Mapping[str, str]c��|j}ttj||���}|�|jd|��dS)N)r�r\�cmdclass)r\rrzr�rwre)rjr�r\r�s    r r�z _ConfigExpander._expand_cmdclass�sA���=���7�+��x�X�X�X�����D�/��X�F�F�F�F�FrBc
�������d�����fd��jD��}|�������pi�����������������������������d�|���D��}�j	�|��dS)N)�version�readme�entry-points�scripts�gui-scripts�classifiers�dependencies�optional-dependenciesc�H��i|]}|�v�|���|�����Sr�)�_obtain)�.0rrr<r�rj�specials  ����r �
<dictcomp>z7_ConfigExpander._expand_all_dynamic.<locals>.<dictcomp>�s@���
�
�
���G�#�#�
�4�<�<��e�[�9�9�#�#�#rB)r�r�r�r��optional_dependenciesc��i|]
\}}|�||��Srvr�)r��k�vs   r r�z7_ConfigExpander._expand_all_dynamic.<locals>.<dictcomp>	s��N�N�N�D�A�q��
�1�a�
�
�
rB)
rbr��_obtain_entry_points�_obtain_version�_obtain_readme�_obtain_classifiers�_obtain_dependencies�_obtain_optional_dependencies�itemsrd)rjr<r��obtained_dynamic�updatesr�s```  @r r�z#_ConfigExpander._expand_all_dynamic�s������	
��
�
�
�
�
�
�
���
�
�
��
	����%�%�d�K�8�8�>�B��(�(��{�;�;��&�&�t�,�,��0�0��6�6��2�2�4�8�8�"&�"D�"D�T�"J�"J�
	 �	
�	
�	
�O�N�$4�$:�$:�$<�$<�N�N�N�������(�(�(�(�(rBc�p�t||��}|�|jsd|�d�}t|���dSdS)Nz#No configuration found for dynamic z�.
Some dynamic fields need to be specified via `tool.setuptools.dynamic`
others must be specified via the equivalent attribute in `setup.py`.)rr@r)rjr<rr�previous�msgs     r �_ensure_previously_setz&_ConfigExpander._ensure_previously_sets_��&�u�-�d�3�3����D�$=��Y�e�Y�Y�Y�
�
%�S�)�)�)�
���rB�	specifierc��ddlm}t|j��5|j}d|vrP|j�||d����tj|d|��cddd��Sd|vr(tj	|d||��cddd��Std|�d|�����#1swxYwYdS)Nr)�always_iterabler�attrz	invalid `z`: )� setuptools.extern.more_itertoolsr�rTr@r\rir�rz�
read_files�	read_attrr7)rjr��	directiver�r�r\s      r �_expand_directivez!_ConfigExpander._expand_directives]��	E�D�D�D�D�D�
�D�5�
6�
6�	F�	F��}�H���"�"��&�-�-�o�o�i��>O�.P�.P�Q�Q�Q��)�)�F�*;�X�F�F�		F�	F�	F�	F�	F�	F�	F�	F�
��"�"��(��6�):�K��R�R�
	F�	F�	F�	F�	F�	F�	F�	F��D��D�D�y�D�D�E�E�E�	F�	F�	F�	F����	F�	F�	F�	F��ts�AB8�7B8�#B8�8B<�?B<c��||jvr%|�d|��|j||��S|�||��dS)Nztool.setuptools.dynamic.)rfr�r�)rjr<rrr�s    r r�z_ConfigExpander._obtain%s^���D�$�$�$��)�)�2�5�2�2�� ��'����
�
	
�#�#�D�%�0�0�0��trBc�|�d|jvr2d|jvr)tj|�|d|����SdS)Nr�)rbrfrzr�r�)rjr<r�s   r r�z_ConfigExpander._obtain_version/sA�����$�$��d�6F�)F�)F��?�4�<�<��i��#M�#M�N�N�N��trB�dict[str, str] | Nonec���d|jvrdS|j}d|vr4|�|di��|d�dd��d�S|�|d��dS)Nr��content-typez
text/x-rst)�textr�)rbrfr�r-r�)rjr<rfs   r r�z_ConfigExpander._obtain_readme5s~���4�<�'�'��4��&���{�"�"����T�8�R�8�8� +�H� 5� 9� 9�.�,� W� W���
�
	
�#�#�D�(�3�3�3��trB�dict[str, dict] | Nonec������d}t�fd�|D����sdS��|d|��}|�dStj|���d�i�d���fd�}|dd	��|d
d���S)
N)r�r�r�c3�*�K�|]
}|�jvV��dSrv)rb)r�rrrjs  �r �	<genexpr>z7_ConfigExpander._obtain_entry_points.<locals>.<genexpr>Gs*�����=�=�U�5�D�L�(�=�=�=�=�=�=rBr�rrrs�groupc���|�vrG��|��}|�jvr"ttj||�����|�|<dSdSrv)�poprbrrr6)rrr��value�expanded�groupsrjs   ���r �_set_scriptsz:_ConfigExpander._obtain_entry_points.<locals>._set_scriptsQsY��������
�
�5�)�)�����,�,�,�_�-D�U�E�-R�-R�S�S�S�"'������	�rBr��console_scriptsr��gui_scripts)rrrsr�rs)�anyr�rz�entry_points)rjr<r��fieldsr�r�r�r�s`     @@r r�z$_ConfigExpander._obtain_entry_pointsCs������<���=�=�=�=�f�=�=�=�=�=�	��4��|�|�D�.�+�>�>���<��4��%�d�+�+��"�F�+��	(�	(�	(�	(�	(�	(�	(�	(�	��Y� 1�2�2�2���]�M�2�2�2��rBc�r�d|jvr-|�|di��}|r|���SdS)Nr�)rbr��
splitlines�rjr<r�s   r r�z#_ConfigExpander._obtain_classifiers]sC���D�L�(�(��L�L��}�b�9�9�E��
*��'�'�)�)�)��trBc�h�d|jvr(|�|di��}|rt|��SdS)Nr�)rbr��_parse_requirements_listr�s   r r�z$_ConfigExpander._obtain_dependenciesds?���T�\�)�)��L�L��~�r�:�:�E��
7�/��6�6�6��trBc����d�jvrdSd�jvrD�jd}t|t��sJ��fd�|���D��S��|d��dS)Nr�c
�f��i|]-\}}|t��d|��|i������.S)z.tool.setuptools.dynamic.optional-dependencies.)r�r�)r�r�r�rjs   �r r�zA_ConfigExpander._obtain_optional_dependencies.<locals>.<dictcomp>qs`���	�	�	�%�E�9��/��*�*�P��P�P�!������	�	�	rB)rbrfr�rr�r�)rjr<�optional_dependencies_maps`  r r�z-_ConfigExpander._obtain_optional_dependenciesks����"�$�,�6�6��4�"�d�&6�6�6�(,�(8�9P�(Q�%��7��>�>�>�>�>�	�	�	�	�)B�(G�(G�(I�(I�	�	�	�	
�	
�#�#�D�*A�B�B�B��trB�NFN)r"rr\r]r@r#r<rC)rr)rqrrrrsrtr)rx)r�r�)r<rr�r�)r<rrrrs)r�rsr�r�)r<rrrrsr�r�)r<rrr�)r<rr�r�rr�)r<r)�__name__�
__module__�__qualname__rkrprwr}rrr�r�r�r�r�r�r�r�r�r�r�r�r�rBr r_r_�s�������$(�%*�$(�1�1�1�1�1�"1�1�1�1�8�8�8�8�
:�:�:�:����"
P�
P�
P�K�K�K�G�G�G�G�
)�)�)�)�<*�*�*�*�
�
�
�
�����������������4�������������rBr_c�>�d�|���D��S)Nc��g|]?}|����|����d���=|��@S)�#)r3�
startswith)r��lines  r �
<listcomp>z,_parse_requirements_list.<locals>.<listcomp>�sV�������:�:�<�<��!%�
�
��� 7� 7�� <� <�����rB)r�)r�s r r�r�s/�����$�$�&�&����rBc#�K�|sdV�dS	dV�dS#t$r5}t�d|jj�d|����Yd}~dSd}~wwxYw)Nzignored error: z - )�	Exceptionr4r5�	__class__r�)r@r:s  r rTrT�s�������
������H�
��������H�H�H��
�
�F���(=�F�F�"�F�F�G�G�G�G�G�G�G�G�G�����H���s��
A�*A�Ac�6��eZdZd�fd�Zd�fd	�Z�fd
�Z�xZS)
r��distributionrrdrrec�f��t���|��||_||_dSrv)�superrk�_project_cfg�_setuptools_cfg)rjr�rdrer�s    �r rkz"_EnsurePackagesDiscovered.__init__�s3���	������&�&�&�'���-����rBrrc����|j|j}}|�di��}|�|jpi��||_|j���|jj�$|j	�
d��|j_|j�|�
d��|_|j�|�
d��|_t�����S)z�When entering the context, the values of ``packages``, ``py_modules`` and
        ``package_dir`` that are missing in ``dist`` are copied from ``setuptools_cfg``.
        r�Nr2�
py-modulesr�)rgr�rSr�r��set_defaults�_ignore_ext_modules�metadatar2r�r-�
py_modulesr�r��	__enter__)rjr<�cfgr�r�s    �r r�z#_EnsurePackagesDiscovered.__enter__�s�����J�� 4�c��&)�n�n�]�B�&G�&G�����4�+�1�r�2�2�2�&�����-�-�/�/�/��=��%�!%�!2�!6�!6�v�!>�!>�D�M���?�"�!�g�g�l�3�3�D�O��=� ��G�G�J�/�/�D�M��w�w� � �"�"�"rBc����|j�d|jj��|j�d|jj��t���|||��S)z�When exiting the context, if values of ``packages``, ``py_modules`` and
        ``package_dir`` are missing in ``setuptools_cfg``, copy from ``dist``.
        r�r�)r�rSrgr�r�r��__exit__)rj�exc_type�	exc_value�	tracebackr�s    �r r�z"_EnsurePackagesDiscovered.__exit__�s]���
	
��'�'�
�D�J�4G�H�H�H���'�'��d�j�6K�L�L�L��w�w����)�Y�?�?�?rB)r�rrdrrer)rr)r�r�r�rkr�r��
__classcell__)r�s@r r�r��s}�������.�.�.�.�.�.�#�#�#�#�#�#�,@�@�@�@�@�@�@�@�@rBr�c��eZdZdZdS)rQz``{subject}` in `pyproject.toml` is still *experimental* and likely to change in future releases.N�r�r�r��_SUMMARYr�rBr rQrQ�s������	3�
�H�HrBrQc��eZdZdZdS)rOzNIgnoring [tools.setuptools] in pyproject.toml, did you mean [tool.setuptools]?Nrr�rBr rOrO�s������X�
�H�HrBrO)rr
rr)r"rrr
rr#)F)r<rrr
rr)TFN)rr
r<rCr�)
r"rr\r]r@r#r<rCrr)r@r#)/�__doc__�
__future__r�loggingrK�
contextlibr�	functoolsr�typingrrr�_pathr
�errorsrr�warningsr
r+rrz�_apply_pyprojecttomlrrrr?rnr�typing_extensionsr�	getLoggerr�r4r!r/rAr>rVr_r�rT�EnsurePackagesDiscoveredr�rQrOr�rBr �<module>rs���	�	�#�"�"�"�"�"�����	�	�	�	�%�%�%�%�%�%�������3�3�3�3�3�3�3�3�3�3�������2�2�2�2�2�2�2�2�(�(�(�(�(�(�������F�F�F�F�F�F�F�F�1�1�1�1�1�1��'�,�,�,�,�,�,�&�&�&�&�&�&�
�'�
�H�
%�
%��"�"�"�"�:�:�:�:�0�	*�	*�	*�	*�	*��� $�	C�C�C�C�C�P $�!&� $�	R�R�R�R�R�.U�U�U�U�U�U�U�U�p����H�H�H���H�%@�%@�%@�%@�%@�� @�%@�%@�%@�P�����!2���������,�����rB

Hacked By AnonymousFox1.0, Coded By AnonymousFox