관리-도구
편집 파일: setupcfg.cpython-311.pyc
� �܋f�c � �\ � d Z ddlmZ ddlZddlZddlZddlmZ ddlmZ ddlm Z ddl mZmZm Z mZmZmZmZmZmZ dd lmZ dd lmZmZ ddlmZ ddlmZmZ dd lm Z ddl!m"Z"m#Z# ddl$m%Z% ddl&m'Z' erddl(m)Z) ddl*m+Z+ edede f f Z, ede,f Z- eded �� � Z. dBdCd�Z/dDd �Z0 dEdFd'�Z1dGd*�Z2dHd,�Z3 dIdJd1�Z4dKd6�Z5 G d7� d8ee. � � Z6 G d9� d:e6d; � � Z7 G d<� d=e6d � � Z8 G d>� d?e%� � Z9 G d@� dAe%� � Z:dS )La< Load setuptools configuration from ``setup.cfg`` files. **API will be made private in the future** 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 ``configparser``. � )�annotationsN)�defaultdict)�partial��wraps) � TYPE_CHECKING�Callable�Any�Dict�Generic�Iterable�Tuple�TypeVar�Union� )�StrPath)� FileError�OptionError)�default_environment)�InvalidRequirement�Requirement)�SpecifierSet)�InvalidVersion�Version)�SetuptoolsDeprecationWarning� )�expand)�DistributionMetadata��Distribution�str�Target)r r )�boundF�filepathr �return�dictc � � ddl m} |� � }|r|� � � ng }t || ||� � }t |� � S )a, Read given configuration file and returns options from it as a dict. :param str|unicode filepath: Path to configuration file to get options from. :param bool find_others: Whether to search for other configuration files which could be on in various places. :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. :rtype: dict r r )�setuptools.distr �find_config_files�_apply�configuration_to_dict)r$ �find_others�ignore_option_errorsr �dist� filenames�handlerss �Q/opt/cloudlinux/venv/lib64/python3.11/site-packages/setuptools/config/setupcfg.py�read_configurationr2 8 s^ � �$ -�,�,�,�,�,��<�>�>�D�,7�?��&�&�(�(�(�R�I��d�H�i�1E�F�F�H� ��*�*�*� r. r c �N � t | |� � | � � � | S )z`Apply the configuration from a ``setup.cfg`` file into an existing distribution object. )r* �_finalize_requires)r. r$ s r1 �apply_configurationr6 R s+ � � �4������������Kr3 � �other_files�Iterable[StrPath]r- �bool�tuple[ConfigHandler, ...]c �* � ddl m} t j � |� � }t j � |� � st d|� d�� � �t j � � }t j t j � |� � � � g |�|�} |� | |�� � t | | j |�� � }| � � � t j |� � n# t j |� � w xY w|S )zHRead configuration from ``filepath`` and applies to the ``dist`` object.r )� _DistributionzConfiguration file z does not exist.)r/ )r- )r( r= �os�path�abspath�isfiler �getcwd�chdir�dirname�parse_config_files�parse_configuration�command_options�_finalize_license_files)r. r$ r8 r- r= �current_directoryr/ r0 s r1 r* r* [ s � � .�-�-�-�-�-��w���x�(�(�H� �7�>�>�(�#�#� J��H�h�H�H�H�I�I�I�� �����H�R�W�_�_�X� &� &�'�'�'�(�+�(�x�(�I�$��(�(���(�C�C�C�&��$�&�=Q� � � �� �$�$�&�&�&� ��"�#�#�#�#����"�#�#�#�#�����Os �#AC: �:D� target_obj�keyc �x � d|� �}t j t | |� � }t | ||� � } |� � S )z� Given a target object and option key, get that option from the target object, either through a get_{key} method or from an attribute directly. �get_)� functoolsr �getattr)rJ rK �getter_name�by_attribute�getters r1 �_get_optionrS y s? � � ��,�,�K��$�W�j�#�>�>�L� �Z��l� ;� ;�F��6�8�8�Or3 r0 c � � t t � � }| D ]1}|j D ]'}t |j |� � }|||j |<