DE r d Z ddlZddlZddlZddlZddlmZ ddlmZ ddlmZ ddl m Z mZmZm Z mZmZmZmZmZmZmZ ddlmZmZ ddlmZmZ dd lmZmZ dd lmZ ddl m!Z! dd l"m#Z# e rddl$m%Z% ddl&m'Z' ee(ej) f Z*e dedef f Z+ e de+f Z, eded Z- d4de*de.fdZ/ddde*ddfdZ0 d5ddde*dee* de1ded f dZ2d e-d!e(fd"Z3d#ed de.fd$Z4 d6d%dd&e,ded' fd(Z5d)e(d*e(d+e6fd,Z7 G d- d.ee- Z8 G d/ d0e8d1 Z9 G d2 d3e8d Z:dS )7ze Load setuptools configuration from ``setup.cfg`` files. **API will be made private in the future** N)defaultdict)partialwraps) TYPE_CHECKINGCallableAnyDictGenericIterableListOptionalTupleTypeVarUnion)DistutilsOptionErrorDistutilsFileError)RequirementInvalidRequirement)VersionInvalidVersion)SpecifierSet)SetuptoolsDeprecationWarning )expandDistribution)DistributionMetadatastrTarget)r r )boundFfilepathreturnc 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_applyconfiguration_to_dict)r" find_othersignore_option_errorsr dist filenameshandlerss /builddir/build/BUILDROOT/alt-python311-setuptools-65.6.3-2.el9.x86_64/opt/alt/python311/lib/python3.11/site-packages/setuptools/config/setupcfg.pyread_configurationr/ ( s^ ( -,,,,,<>>D,7?&&(((RIdHi1EFFH *** 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 r. apply_configurationr3 D s+ 4Kr0 other_filesr* ) ConfigHandler.c ( ddl m} t j | }t j | st d|z 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 ) _Distributionz%Configuration file %s does not exist.)r, )r* )r% r8 ospathabspathisfiler getcwdchdirdirnameparse_config_filesparse_configurationcommand_options_finalize_license_files)r+ r" r5 r* r8 current_directoryr, r- s r. r' r' M s .-----wx((H 7>>(## U !H8!STTT HRW__X & &'''(+(x(I$(((CCC&$&=Q $$&&& "####"####Os "AC9 9D target_objkeyc dj di t }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. z get_{key}r4 )formatlocals functoolsr getattr)rE rF getter_nameby_attributegetters r. _get_optionrO j sP %+$00vxx00K$Wj#>>L Zl ; ;F688Or0 r- c t t }| D ]1}|j D ]'}t |j | }|||j |<