Your IP : 216.73.217.79


Current Path : /lib/python3/dist-packages/setuptools/config/__pycache__/
Upload File :
Current File : //lib/python3/dist-packages/setuptools/config/__pycache__/pyprojecttoml.cpython-311.pyc

�

���c�L��>�dZddlZddlZddlZddlmZddlmZddlm	Z	m
Z
mZmZm
Z
mZmZddlmZmZddlmZdd	lmZdd
lmZmZe	rddlmZeeejfZej e!��Z"ded
e#fd�Z$de#ded
e%fd�Z&	d'ddded
dfd�Z'			d(dededfd�Z(de#de#dedd
e%fd�Z)			d)de#deede%dedd
e#f
d�Z*Gd�d��Z+d�Z,ede%fd ���Z-Gd!�d"ej.��Z/Gd#�d$e0��Z1Gd%�d&e0��Z2dS)*z�
Load setuptools configuration from ``pyproject.toml`` files.

**PRIVATE MODULE**: API reserved for setuptools internal usage only.
�N)�contextmanager)�partial)�
TYPE_CHECKING�Callable�Dict�Optional�Mapping�Set�Union)�	FileError�OptionError�)�expand)�apply)�_PREVIOUSLY_DEFINED�_WouldIgnoreField��Distribution�filepath�returnc��ddlm}t|d��5}|�|��cddd��S#1swxYwYdS)Nr)�tomli�rb)�setuptools.externr�open�load)rr�files   �A/usr/lib/python3/dist-packages/setuptools/config/pyprojecttoml.py�	load_filers���'�'�'�'�'�'�	
�h��	�	� ���z�z�$��� � � � � � � � � � � � ���� � � � � � s
�9�=�=�configc���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�exr.�errors       rr,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)r9r�ignore_option_errorsr s    r�apply_configurationr>6s*�� ��$�0D�d�
K�
K�F��$���)�)�)�Tc��tj�|��}tj�|��st	d|�d����t|��pi}|�di��}|�di��}|�di��}|r|s|siS|rd}tj|t��|�
��}	|r-t|dd���|�d	|j
��n|�d	d
��||d<||d<	|d|id�}
t|
|��n]#t$rP}t!||	|��ricYd}~S|r+t"�d|jj�d
|����n�Yd}~nd}~wwxYw|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�
setuptoolszDSupport for `[tool.setuptools]` in `pyproject.toml` is still *beta*.�include_package_dataNzinclude-package-dataT)r%rA�ignored error: � - )�os�path�abspath�isfilerrr*�warnings�warn�_BetaConfiguration�copy�getattr�
setdefaultrCr,�	Exception�_skip_bad_configr1r2�	__class__�__name__�dirname�expand_configuration)
rrr=r9�asdict�
project_table�
tool_table�setuptools_table�msg�orig_setuptools_table�subsetr7�root_dirs
             rr;r;Bs6��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����-��+;���	��/�T���
�c�-�.�.�.�-�1�1�3�3���B���4�d�;�;�G��#�#�$:�D�<U�V�V�V�V��#�#�$:�D�A�A�A��F�6�N�/�J�|��
�*�\�CS�4T�U�U�����"�"�"�"���	�	�	��M�+@�$�G�G�	��I�I�I�I�I�I� �	��M�M�J�B�L�,A�J�J�b�J�J�K�K�K�K��
L�K�K�K�K�����	�����R��7�?�?�8�,�,��#�F�H�6J�D�Q�Q�Q��Ms$�/E�
F!�F�#F!�).F�F!�project_cfg�setuptools_cfgc��|�|jj�|jj�	|j�dS|rdSt	|�����}hd�}||kr5t
jt�	��td���dSdS)z8Be temporarily forgiving with invalid ``pyproject.toml``NF>�requires-pythonr/�version�python_requires�)�
stacklevelT)
�metadatar/rb�install_requires�set�keysrJrK�_InvalidFile�message)r^r_r9�given_config�popular_subsets     rrQrQ�s����|��
��"��M�!�)��!�)��u����u��{�'�'�)�)�*�*�L�N�N�N�N��~�%�%�	�
�l�*�*�,�,�l�q�I�I�I�I��t��5r?r]r=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=r9s    rrUrU�s%��(�6�8�-A�4�H�H�O�O�Q�Q�Qr?c
��eZdZ			d!dedeedededfd�Zd"d
�Zdede	d
e
fd�Zd#d�Zd�Z
d�Zd�Zdee	e	ffd�Zdddee	e	ffd�Zddde	fd�Zde	dee	e	ffd�Zddde	dee	e	ffd�Zdddee	e	ffd�Zddd	eee	e	ffd�Zdddee	e	fd	eee	effd�Zd$d�Zd$d�Zd$d �ZdS)%roNFr r]r=r9rc��||_|ptj��|_|�di��|_|j�dg��|_|�di���di��|_|j�di��|_||_	||_
t��|_dS)Nr%�dynamicrArB)
r rF�getcwdr]r*r^rrr_�dynamic_cfgr=�_distrh�_referenced_files)�selfr r]r=r9s     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����r?rc�x�ddlm}|j|j�dd��d�}|jp
||��S)Nrrr/)�src_rootr/)�setuptools.distrr]r^r*ru)rwr�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�0r?�	container�field�fnc��||vrCt|j��5|||��||<ddd��dS#1swxYwYdSdS�N)�_ignore_errorsr=)rwr~rr�s    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|��Sr�)r_r*�_expand�canonic_package_data)rwr�package_datas   r�_canonic_package_dataz%_ConfigExpander._canonic_package_data�s+���*�.�.�u�b�9�9���+�L�9�9�9r?c���|���|���|�d��|���}t||j|j��}|5}|j}|���|�|��|�	||��ddd��n#1swxYwY|j
�|j
��|jS)Nzexclude-package-data)
�_expand_packagesr�r}�_EnsurePackagesDiscoveredr^r_�package_dir�_expand_data_files�_expand_cmdclass�_expand_all_dynamicrv�updater )rwr9�ctx�ensure_discoveredr�s     rrz_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�)r_r*�
isinstance�list�tuple�dictr]rOr�r=r��
find_packages)rwr�r�s   rr�z _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)rr��canonic_data_filesr]r�r_)rw�
data_filess  rr�z"_ConfigExpander._expand_data_filess:���W�7�$�-�P�P�P�
����D�/��z�J�J�J�J�Jr?r�c��|j}ttj||���}|�|jd|��dS)N)r�r]�cmdclass)r]rr�r�r�r_)rwr�r]r�s    rr�z _ConfigExpander._expand_cmdclasssA���=���7�+��x�X�X�X�����D�/��X�F�F�F�F�Fr?c
�������d�����fd��jD��}|�������pi�����������������������������d�|���D��}�j	�|��dS)N)rb�readme�entry-points�scripts�gui-scripts�classifiers�dependencies�optional-dependenciesc�H��i|]}|�v�|���|�����Sr�)�_obtain)�.0rr9r�rw�specials  ����r�
<dictcomp>z7_ConfigExpander._expand_all_dynamic.<locals>.<dictcomp>s@���
�
�
���G�#�#�
�4�<�<��e�[�9�9�#�#�#r?)rbr�r�r��optional_dependenciesc��i|]
\}}|�||��Sr�r�)r��k�vs   rr�z7_ConfigExpander._expand_all_dynamic.<locals>.<dictcomp>(s��N�N�N�D�A�q��
�1�a�
�
�
r?)
rrr��_obtain_entry_points�_obtain_version�_obtain_readme�_obtain_classifiers�_obtain_dependencies�_obtain_optional_dependencies�itemsr^)rwr9r��obtained_dynamic�updatesr�s```  @rr�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�������(�(�(�(�(r?c�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
)rwr9r�previousrZs     r�_ensure_previously_setz&_ConfigExpander._ensure_previously_set+s_��&�u�-�d�3�3����D�$=��Y�e�Y�Y�Y�
�
�c�"�"�"�
���r?�	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�r�r=r]rvr�r��
read_files�	read_attrr4)rwr��	directiver�r�r]s      r�_expand_directivez!_ConfigExpander._expand_directive5s]��	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.)rtr�r�)rwr9rr�s    rr�z_ConfigExpander._obtainDs^���D�$�$�$��)�)�2�5�2�2�� ��'����
�
	
�#�#�D�%�0�0�0��tr?c�|�d|jvr2d|jvr)tj|�|d|����SdS)Nrb)rrrtr�rbr�)rwr9r�s   rr�z_ConfigExpander._obtain_versionNsA�����$�$��d�6F�)F�)F��?�4�<�<��i��#M�#M�N�N�N��tr?c���d|jvrdS|j}d|vr4|�|di��|d�dd��d�S|�|d��dS)Nr��content-typez
text/x-rst)�textr�)rrrtr�r*r�)rwr9rts   rr�z_ConfigExpander._obtain_readmeTs~���4�<�'�'��4��&���{�"�"����T�8�R�8�8� +�H� 5� 9� 9�.�,� W� W���
�
	
�#�#�D�(�3�3�3��tr?c�����d}t�fd�|D����sdS��|d|��}|�dStj|���d�i�dtdtf���fd�}|dd��|d	d
���S)N)r�r�r�c3�*�K�|]
}|�jvV��dSr�)rr)r�rrws  �r�	<genexpr>z7_ConfigExpander._obtain_entry_points.<locals>.<genexpr>fs*�����=�=�U�5�D�L�(�=�=�=�=�=�=r?r�r�groupc���|�vrT��|��}|�jvr/tj||��}t	j|t��|�|<dSdSr�)�poprrrrkrJrK)rr��valuerZ�expanded�groupsrws    ���r�_set_scriptsz:_ConfigExpander._obtain_entry_points.<locals>._set_scriptspse��������
�
�5�)�)�����,�,�+�3�E�5�A�A�C��M�#�'8�9�9�9�#(�������r?r��console_scriptsr��gui_scripts)�anyr�r��entry_points�str)rwr9r��fieldsr�r�r�r�s`     @@rr�z$_ConfigExpander._obtain_entry_pointsbs������<���=�=�=�=�f�=�=�=�=�=�	��4��|�|�D�.�+�>�>���<��4��%�d�+�+��"�F�+��	(��	(�C�	(�	(�	(�	(�	(�	(�	(�	(�	��Y� 1�2�2�2���]�M�2�2�2��r?c�r�d|jvr-|�|di��}|r|���SdS)Nr�)rrr��
splitlines�rwr9r�s   rr�z#_ConfigExpander._obtain_classifierssC���D�L�(�(��L�L��}�b�9�9�E��
*��'�'�)�)�)��tr?c�h�d|jvr(|�|di��}|rt|��SdS)Nr�)rrr��_parse_requirements_listr�s   rr�z$_ConfigExpander._obtain_dependencies�s?���T�\�)�)��L�L��~�r�:�:�E��
7�/��6�6�6��tr?c����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�rws   �rr�zA_ConfigExpander._obtain_optional_dependencies.<locals>.<dictcomp>�s_������%�E�9��/��0F�0F�L�U�L�L���1�1�����r?)rrrtr�r�r�r�)rwr9�optional_dependencies_maps`  rr�z-_ConfigExpander._obtain_optional_dependencies�s����"�$�,�6�6��4�"�d�&6�6�6�(,�(8�9P�(Q�%��7��>�>�>�>�>�����)B�(G�(G�(I�(I�
���
�	
�#�#�D�*A�B�B�B��tr?�NFN)rr)r�)r9r)rS�
__module__�__qualname__r�r�_Path�boolrxr}r�rr�r�rr�r�r	r�r�r�r�r�r�rr�r�r�r�r�r�r?rroro�s�������%)�%*�)-�1�1��1��5�/�1�#�	1�
�~�&�1�1�1�1�"1�1�1�1�8��8�S�8�h�8�8�8�8�
:�:�:�:����"
P�
P�
P�K�K�K�G�G�C��H�,=�G�G�G�G�
)��)�W�S�RU�X�EV�)�)�)�)�<#�>�#�#�#�#�#�#�
��
�6=�c�3�h�6G�
�
�
�
��N��3��W�S�RU�X�EV������N����c��AR������>��h�t�C��H�~�6N������"��18��c��1B��	�$�s�D�y�/�	"�����:�������������r?roc�>�d�|���D��S)Nc��g|]?}|����|����d���=|��@S)�#)r0�
startswith)r��lines  r�
<listcomp>z,_parse_requirements_list.<locals>.<listcomp>�sV�������:�:�<�<��!%�
�
��� 7� 7�� <� <�����r?)r�)r�s rr�r��s/�����$�$�&�&����r?c#�K�|sdV�dS	dV�dS#t$r5}t�d|jj�d|����Yd}~dSd}~wwxYw)NrDrE)rPr1r2rRrS)r=r7s  rr�r��s�������
������H�
��������H�H�H��
�
�F���(=�F�F�"�F�F�G�G�G�G�G�G�G�G�G�����H���s��
A�*A�Ac�@��eZdZdddedef�fd�Z�fd�Z�fd�Z�xZS)r��distributionrr^r_c�f��t���|��||_||_dSr�)�superrx�_project_cfg�_setuptools_cfg)rwr�r^r_rRs    �rrxz"_EnsurePackagesDiscovered.__init__�s3���	������&�&�&�'���-����r?c����|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�Nr/�
py-modulesr�)rur�rOr�r��set_defaults�_ignore_ext_modulesrfr/r�r*�
py_modulesr�r��	__enter__)rwr9�cfgr�rRs    �rr�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� � �"�"�"r?c����|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�rOrur�r�r��__exit__)rw�exc_type�	exc_value�	tracebackrRs    �rrz"_EnsurePackagesDiscovered.__exit__�s]���
	
��'�'�
�D�J�4G�H�H�H���'�'��d�j�6K�L�L�L��w�w����)�Y�?�?�?r?)rSr�r�r�rxr�r�
__classcell__)rRs@rr�r��s��������.�*�.�9=�.�OS�.�.�.�.�.�.�#�#�#�#�#�,@�@�@�@�@�@�@�@�@r?r�c��eZdZdZdS)rLzJExplicitly inform users that some `pyproject.toml` configuration is *beta*N)rSr�r��__doc__r�r?rrLrL�s������T�T�T�Tr?rLc�(�eZdZdZed���ZdS)rja�The given `pyproject.toml` file is invalid and would be ignored.
    !!


    ############################
    # Invalid `pyproject.toml` #
    ############################

    Any configurations in `pyproject.toml` will be ignored.
    Please note that future releases of setuptools will halt the build process
    if an invalid file is given.

    To prevent setuptools from considering `pyproject.toml` please
    DO NOT include the `[project]` or `[tool.setuptools]` tables in your file.
    

!!
    c�.�ddlm}||j��S)Nr)�cleandoc)�inspectrr)�clsrs  rrkz_InvalidFile.message�s&��$�$�$�$�$�$��x���$�$�$r?N)rSr�r�r�classmethodrkr�r?rrjrj�s9������
�
��%�%��[�%�%�%r?rj)F)TFNr�)3r�loggingrFrJ�
contextlibr�	functoolsr�typingrrrrr	r
r�setuptools.errorsrr
r(rr��_apply_pyprojecttomlrr<rrr{rr��PathLiker��	getLoggerrSr1r�rr�r,r>r;rQrUror�r��EnsurePackagesDiscoveredr��UserWarningrLrjr�r?r�<module>rs�����
����	�	�	�	�����%�%�%�%�%�%�������O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�4�4�4�4�4�4�4�4�������1�1�1�1�1�1�H�H�H�H�H�H�H�H��-�,�,�,�,�,�,�
�c�2�;����
�'�
�H�
%�
%�� �� �$� � � � �:�T�:�U�:�t�:�:�:�:�0�	*�	*�
�	*��	*��		*�	*�	*�	*���%)�	L�L��L��>�
"�	L�L�L�L�^���'+��3;�N�3K��	�����@!%�!&�%)�	R�R��R��u�o�R��R��>�
"�	R�

�R�R�R�R�.V�V�V�V�V�V�V�V�r����H��H�H�H���H�%@�%@�%@�%@�%@�� @�%@�%@�%@�PU�U�U�U�U��U�U�U�%�%�%�%�%�;�%�%�%�%�%r?