%PDF- %PDF-
Mini Shell

Mini Shell

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

�


_�dRD����dZddlZddlZddlmZddlmZddlmZm	Z	m
Z
mZmZm
Z
mZddlmZmZddlmZd	d
lmZd	dlmZmZd	dlmZerdd
lmZeeej>fZ ejBe"�Z#de de$fd�Z%de$de de&fd�Z'	d"ddde ddfd�Z(			d#de dedfd�Z)			d$de$dee de&dedde$f
d�Z*Gd�d�Z+d�Z,ede&fd��Z-Gd�dej\�Z/Gd �d!e�Z0y)%ac
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``.
�N)�contextmanager)�partial)�
TYPE_CHECKING�Callable�Dict�Mapping�Optional�Set�Union�)�	FileError�OptionError)�SetuptoolsWarning�)�expand)�_PREVIOUSLY_DEFINED�_WouldIgnoreField)�apply��Distribution�filepath�returnc�t�ddlm}t|d�5}|j|�cddd�S#1swYyxYw)Nr)�tomli�rb)�setuptools.externr�open�load)rr�files   �A/usr/lib/python3/dist-packages/setuptools/config/pyprojecttoml.py�	load_filer!s2��'�	
�h��	� ���z�z�$�� � � �s�.�7�configc���ddlm}|jjd�}t	|d�r|j�	|j
|�S#|j$r�}d|j��}|jjd�dk7r4tj|�tj|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�exr0�errors       r r.r.%s���2� �1�1�5�5�6H�I����!4�5��*�*�,�
:��!�!�&�)�)���$�$�:�)�"�*�*��6��
�7�7�=�=����*��M�M�'�"��M�M�"�*�*�%�1�"�'�'��!�<���E�7�"�W�I�.�/�T�9��:�s�A�C&�BC!�!C&�distrc�8�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_configurationr@:s$�� ��$�0D�d�
K�F��$���)�)�c���tjj|�}tjj|�st	d|�d���t|�xsi}|j
di�}|j
di�}|j
di�}|r|s|siSd|vrtjd��|r*t|d	d
��|jd|j�n|jdd�||d<||d<t|�5|d|id
�}t||�d
d
d
�|r-tjj|�}	t||	||�S|S#1swY�:xYw)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�	distutilsz[tool.distutils])�subject�include_package_dataNzinclude-package-dataT)r'rC)�os�path�abspath�isfiler
r!r,�_ExperimentalConfiguration�emit�getattr�
setdefaultrG�_ignore_errorsr.�dirname�expand_configuration)
rrr?r;�asdict�
project_table�
tool_table�setuptools_table�subset�root_dirs
          r r=r=FsX��6�w�w���x�(�H�
�7�7�>�>�(�#��-�h�\�9I�J�K�K�
�x�
 �
&�B�F��J�J�y�"�-�M����F�B�'�J�!�~�~�l�B�7���-�+;��	��j� �"�'�'�0B�'�C����4�d�;�G��#�#�$:�D�<U�<U�V��#�#�$:�D�A��F�6�N�/�J�|��	�,�	-�#�*�\�CS�4T�U�����"�#�
��7�7�?�?�8�,��#�F�H�6J�D�Q�Q��M�#�#�s�E�ErXr?c�:�t||||�j�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"rXr?r;s    r rRrR�s��(�6�8�-A�4�H�O�O�Q�QrAc
�f�eZdZ			ddedeedededfd�Zd d	�Zd
ede	de
fd
�Zd!d�Zd�Z
d�Zd�Zdee	e	ffd�Zdddee	e	ffd�Zddde	fd�Zde	dee	e	ffd�Zddde	dee	e	ffd�Zdddee	e	ffd�Zdddeee	e	ffd�Zdddee	e	fdeee	effd�Zd"d�Zd"d�Zd"d�Zy)#rZNr"rXr?r;rc��||_|xstj�|_|j	di�|_|j
j	dg�|_|j	di�j	di�|_|jj	di�|_||_	||_
t�|_y)Nr'�dynamicrCrD)
r"rH�getcwdrXr,�project_cfgr]�setuptools_cfg�dynamic_cfgr?�_dist�set�_referenced_files)�selfr"rXr?r;s     r �__init__z_ConfigExpander.__init__�s������ �/�B�I�I�K��
�!�:�:�i��4����'�'�+�+�I�r�:���$�j�j���4�8�8��r�J����.�.�2�2�9�b�A���$8��!���
�+.�5��rArc��ddlm}|j|jj	dd�d�}|j
xs||�S)Nrrr1)�src_rootr1)�setuptools.distrrXr_r,rb)rer�attrss   r �_ensure_distz_ConfigExpander._ensure_dist�s;��0�!�]�]�D�4D�4D�4H�4H��QU�4V�W���z�z�0�\�%�0�0rA�	container�field�fnc�~�||vr-t|j�5|||�||<ddd�yy#1swYyxYw�N)rPr?)rerlrmrns    r �_process_fieldz_ConfigExpander._process_field�sK���I���� 9� 9�:�
8�#%�i��&6�#7�	�%� �
8�
8��
8�
8�s�3�<c�d�|jj|i�}tj|�Srp)r`r,�_expand�canonic_package_data)rerm�package_datas   r �_canonic_package_dataz%_ConfigExpander._canonic_package_data�s+���*�*�.�.�u�b�9���+�+�L�9�9rAc���|j�|j�|jd�|j�}t||j|j
�}|5}|j}|j�|j|�|j||�ddd�|jj|j�|jS#1swY�:xYw)Nzexclude-package-data)
�_expand_packagesrvrk�_EnsurePackagesDiscoveredr_r`�package_dir�_expand_data_files�_expand_cmdclass�_expand_all_dynamicrd�updater")rer;�ctx�ensure_discoveredrzs     r rz_ConfigExpander.expand�s��������"�"�$��"�"�#9�:�� � �"��'��d�.>�.>��@S�@S�T��
�	8�%�+�7�7�K��#�#�%��!�!�+�.��$�$�T�;�7�		8�	
���%�%�d�&<�&<�=��{�{��	8�	8�s
�%AC�C'c��|jjd�}|�t|ttf�ry|jd�}t|t
�ro|j|d<|jjdi�|d<t|j�5tjdi|��|jd<ddd�yy#1swYyxYw)N�packages�findrX�package-dir�fill_package_dir�)r`r,�
isinstance�list�tuple�dictrXrOrPr?rs�
find_packages)rer�r�s   r rxz _ConfigExpander._expand_packages�s����&�&�*�*�:�6����z�(�T�5�M�B���|�|�F�#���d�D�!�#�}�}�D���'+�':�':�'E�'E�m�UW�'X�D�#�$��� 9� 9�:�
P�29�2G�2G�2O�$�2O��#�#�J�/�
P�
P�"�
P�
P�s�#C�Cc��ttj|j��}|j	|j
d|�y)N)rXz
data-files)rrs�canonic_data_filesrXrqr`)re�
data_filess  r r{z"_ConfigExpander._expand_data_files�s0���W�7�7�$�-�-�P�
����D�/�/��z�JrArzc��|j}ttj||��}|j	|j
d|�y)N)rzrX�cmdclass)rXrrsr�rqr`)rerzrXr�s    r r|z _ConfigExpander._expand_cmdclass�s7���=�=���7�+�+��x�X�����D�/�/��X�FrAc
���d}|jD�cic]}||vr||j|||���}}|j|j||�xsi|j	||�|j|�|j
|�|j|�|j|���|j�D��cic]\}}|��	||��
}}}|jj|�ycc}wcc}}w)N)�version�readme�entry-points�scripts�gui-scripts�classifiers�dependencies�optional-dependencies)r�r�r�r��optional_dependencies)r]�_obtainr~�_obtain_entry_points�_obtain_version�_obtain_readme�_obtain_classifiers�_obtain_dependencies�_obtain_optional_dependencies�itemsr_)	rer;rz�specialrm�obtained_dynamic�k�v�updatess	         r r}z#_ConfigExpander._expand_all_dynamic�s��	
�����
���G�#�
�4�<�<��e�[�9�9�
��
�
	����%�%�d�K�8�>�B��(�(��{�;��&�&�t�,��0�0��6��2�2�4�8�"&�"D�"D�T�"J�
	 �	
�%5�$:�$:�$<�N�D�A�q��
�1�a�4�N��N�������(��!
��Os�C+�<
C0�C0c�`�t||�}|�|jsd|�d�}t|��yy)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)rer;rm�previous�msgs     r �_ensure_previously_setz&_ConfigExpander._ensure_previously_setsL��&�u�-�d�3����D�$=�$=�5�e�Y�?Y�Y�
�
�c�"�"�
%>�rA�	specifierc�n�ddlm}t|j�5|j}d|vrF|j
j
||d��tj|d|�cddd�Sd|vr#tj|d||�cddd�Std|�d|����#1swYyxYw)Nr)�always_iterabler�attrz	invalid `z`: )� setuptools.extern.more_itertoolsr�rPr?rXrdr~rs�
read_files�	read_attrr6)rer��	directiverzr�rXs      r �_expand_directivez!_ConfigExpander._expand_directives���	E�
�D�5�5�
6�	F��}�}�H���"��&�&�-�-�o�i��>O�.P�Q��)�)�)�F�*;�X�F�		F�	F�
��"��(�(��6�):�K��R�
	F�	F��y���3�y�m�D�E�E�	F��s�A
B+�3B+�B+�+B4c��||jvr#|jd|��|j||�S|j||�y)Nztool.setuptools.dynamic.)rar�r�)rer;rmrzs    r r�z_ConfigExpander._obtainsS���D�$�$�$��)�)�*�5�'�2�� � ��'���
�
	
�#�#�D�%�0�rAc��d|jvr4d|jvr&tj|j	|d|��Sy)Nr�)r]rarsr�r�)rer;rzs   r r�z_ConfigExpander._obtain_version's:������$��d�6F�6F�)F��?�?�4�<�<��i��#M�N�N�rAc��d|jvry|j}d|vr)|j|di�|djdd�d�S|j	|d�y)Nr��content-typez
text/x-rst)�textr�)r]rar�r,r�)rer;ras   r r�z_ConfigExpander._obtain_readme-sh���4�<�<�'���&�&���{�"����T�8�R�8� +�H� 5� 9� 9�.�,� W��
�
	
�#�#�D�(�3�rAc������d}t�fd�|D��sy�j|d|�}|�ytj|��d�i�dtdtf���fd�}|dd�|d	d
��S)N)r�r�r�c3�:�K�|]}|�jv���y�wrp)r])�.0rmres  �r �	<genexpr>z7_ConfigExpander._obtain_entry_points.<locals>.<genexpr>?s�����=�U�5�D�L�L�(�=�s�r�rm�groupc���|�vr<�j|�}|�jvrtj||��|�|<yy)N)rm�value)�popr]rrM)rmr�r��expanded�groupsres   ���r �_set_scriptsz:_ConfigExpander._obtain_entry_points.<locals>._set_scriptsIsD�������
�
�5�)������,�%�*�*��e�D�#(����
rAr��console_scriptsr��gui_scripts)�anyr�rs�entry_points�str)rer;rz�fieldsr�r�r�r�s`     @@r r�z$_ConfigExpander._obtain_entry_points;s~���<���=�f�=�=���|�|�D�.�+�>���<���%�%�d�+��"�F�+��	(��	(�C�	(�	�Y� 1�2��]�M�2��rAc�j�d|jvr%|j|di�}|r|j�Sy)Nr�)r]r��
splitlines�rer;r�s   r r�z#_ConfigExpander._obtain_classifiersWs5���D�L�L�(��L�L��}�b�9�E���'�'�)�)�rAc�`�d|jvr |j|di�}|rt|�Sy)Nr�)r]r��_parse_requirements_listr�s   r r�z$_ConfigExpander._obtain_dependencies^s1���T�\�\�)��L�L��~�r�:�E��/��6�6�rAc�2�d|jvryd|jvrb|jd}t|t�sJ�|j	�D��cic]%\}}|t|j
d|��|i����'c}}S|j|d�ycc}}w)Nr�z.tool.setuptools.dynamic.optional-dependencies.)r]rar�r�r�r�r�r�)rer;�optional_dependencies_mapr�r�s     r r�z-_ConfigExpander._obtain_optional_dependencieses���"�$�,�,�6��"�d�&6�&6�6�(,�(8�(8�9P�(Q�%��7��>�>�>�)B�(G�(G�(I�	�%�E�9��/��*�*�H���P�!�����	�	
�	
�#�#�D�*A�B���	s�*B�NFN)rr)zpackage-data)r;r)�__name__�
__module__�__qualname__r�r	�_Path�boolrfrkr�rrqrvrrxr{rr|r}r�r�r�r�rr�r�r�r�r�r�rAr rZrZ�s}��%)�%*�)-�1��1��5�/�1�#�	1�
�~�&�1�"1�8��8�S�8�h�8�
:��"
P�K�G�G�C��H�,=�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�/�	"��8��rArZc��|j�D�cgc]3}|j�r!|j�jd�s|��5c}Scc}w)N�#)r�r2�
startswith)r��lines  r r�r�ysI���$�$�&����:�:�<��
�
�� 7� 7�� <�	
����s�8Ac#�K�|sd��y	d��y#t$r9}tjd|jj�d|���Yd}~yd}~wwxYw�w)Nzignored error: z - )�	Exceptionr3r4�	__class__r�)r?r9s  r rPrP�sP�����
��H�
���H��
�
�����(=�(=�'>�c�"��F�G�G��H�s*�A��A�	A�/A
�A�
A�Ac�@��eZdZdddedef�fd�Z�fd�Z�fd�Z�xZS)ry�distributionrr_r`c�@��t�|�|�||_||_yrp)�superrf�_project_cfg�_setuptools_cfg)rer�r_r`r�s    �r rfz"_EnsurePackagesDiscovered.__init__�s"���	����&�'���-��rAc���|j|j}}|jdi�}|j|jxsi�||_|j
j
�|jj�*|jjd�|j_|j�|jd�|_|j�|jd�|_t�|�9�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�r1�
py-modulesr�)rbr�rOr~rz�set_defaults�_ignore_ext_modules�metadatar1r�r,�
py_modulesr�r��	__enter__)rer;�cfgrzr�s    �r r�z#_EnsurePackagesDiscovered.__enter__�s�����J�J�� 4� 4�c��&)�n�n�]�B�&G�����4�+�+�1�r�2�&������-�-�/��=�=���%�!%�!2�!2�!6�!6�v�!>�D�M�M���?�?�"�!�g�g�l�3�D�O��=�=� ��G�G�J�/�D�M��w� �"�"rAc����|jjd|jj�|jjd|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�rOrbr�r�r��__exit__)re�exc_type�	exc_value�	tracebackr�s    �r r�z"_EnsurePackagesDiscovered.__exit__�sY���
	
���'�'�
�D�J�J�4G�4G�H����'�'��d�j�j�6K�6K�L��w���)�Y�?�?rA)r�r�r�r�rfr�r��
__classcell__)r�s@r ryry�s1���.�*�.�9=�.�OS�.�#�,@�@rAryc��eZdZdZy)rLz``{subject}` in `pyproject.toml` is still *experimental* and likely to change in future releases.N)r�r�r��_SUMMARYr�rAr rLrL�s��	3�
rArL)F)TFNr�)1�__doc__�loggingrH�
contextlibr�	functoolsr�typingrrrrr	r
r�errorsr
r�warningsrr*rrs�_apply_pyprojecttomlrrrr>rirr��PathLiker��	getLoggerr�r3r�r!r�r.r@r=rRrZr�rP�EnsurePackagesDiscoveredryrLr�rAr �<module>rss��	��	�%��O�O�O�+�(��H�1��,�
�c�2�;�;����
�'�
�
�H�
%�� �� �$� �:�T�:�U�:�t�:�0�	*�
�	*��	*��		*���%)�	?��?��>�
"�	?�H!%�!&�%)�	R��R��u�o�R��R��>�
"�	R�

�R�.W�W�t��H��H��H�%@�� @� @�%@�P�!2�rA

Zerion Mini Shell 1.0