HEX
Server: Apache
System: Linux zacp120.webway.host 4.18.0-553.50.1.lve.el8.x86_64 #1 SMP Thu Apr 17 19:10:24 UTC 2025 x86_64
User: govancoz (1003)
PHP: 8.3.26
Disabled: exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname
Upload Files
File: //opt/osm/venv/lib/python3.10/site-packages/setuptools/config/__pycache__/setupcfg.cpython-310.pyc
o

0inb�@s"dZddlZddlZddlZddlZddlmZddlmZddlmZddl	m
Z
mZmZm
Z
mZmZmZmZmZmZmZddlmZmZddlmZmZdd	lmZmZdd
lmZddl m!Z!dd
l"m#Z#e
rvddl$m%Z%ddl&m'Z'ee(ej)fZ*e
dedeffZ+	e
de+fZ,ededd�Z-		d;de*de.fdd�Z/ddde*ddfdd�Z0		d<ddde*dee*de1ded f
d!d"�Z2d#e-d$e(fd%d&�Z3d'ed de.fd(d)�Z4	d=d*dd+e,ded,fd-d.�Z5d/e(d0e(d1e6fd2d3�Z7Gd4d5�d5ee-�Z8Gd6d7�d7e8d8�Z9Gd9d:�d:e8d�Z:dS)>ze
Load setuptools configuration from ``setup.cfg`` files.

**API will be made private in the future**
�N)�defaultdict)�partial��wraps)�
TYPE_CHECKING�Callable�Any�Dict�Generic�Iterable�List�Optional�Tuple�TypeVar�Union)�DistutilsOptionError�DistutilsFileError)�Requirement�InvalidRequirement)�Version�InvalidVersion)�SpecifierSet)�SetuptoolsDeprecationWarning�)�expand��Distribution)�DistributionMetadata�str�Target)rr)�boundF�filepath�returncCs8ddlm}|�}|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
    rr)�setuptools.distrZfind_config_files�_apply�configuration_to_dict)r!Zfind_others�ignore_option_errorsr�dist�	filenames�handlers�r*�H/opt/osm/venv/lib/python3.10/site-packages/setuptools/config/setupcfg.py�read_configuration(s
r,r'rcCst||�|��|S)z`Apply the configuration from a ``setup.cfg`` file into an existing
    distribution object.
    )r$Z_finalize_requires)r'r!r*r*r+�apply_configurationDs
r-r*�other_filesr&)�
ConfigHandler.c	Cs�ddlm}tj�|�}tj�|�std|��t��}t�tj�	|��g|�|�}z|j
||d�t||j|d�}|�
�Wt�|�|St�|�w)zHRead configuration from ``filepath`` and applies to the ``dist`` object.r)�
_Distributionz%Configuration file %s does not exist.)r()r&)r#r0�os�path�abspath�isfiler�getcwd�chdir�dirnameZparse_config_files�parse_configuration�command_optionsZ_finalize_license_files)r'r!r.r&r0Zcurrent_directoryr(r)r*r*r+r$Ms �

�r$�
target_obj�keycCs2djdit���}t�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}Nr*)�format�locals�	functoolsr�getattr)r:r;Zgetter_nameZby_attribute�getterr*r*r+�_get_optionjsrAr)cCs<tt�}|D]}|jD]}t|j|�}|||j|<qq|S)z�Returns configuration data gathered by given handlers as a dict.

    :param list[ConfigHandler] handlers: Handlers list,
        usually from parse_configuration()

    :rtype: dict
    )r�dict�set_optionsrAr:�section_prefix)r)Zconfig_dict�handler�option�valuer*r*r+r%vs
�r%�distributionr9)�ConfigMetadataHandler�ConfigOptionsHandlercCs|t�|��-}t||||�}|��|js|j|_t|j||||j|j�}|��Wd�||fS1s5wY||fS)a�Performs additional parsing of configuration options
    for a distribution.

    Returns a list of used option handlers.

    :param Distribution distribution:
    :param dict command_options:
    :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: list
    N)r�EnsurePackagesDiscoveredrJ�parse�package_dirrI�metadata�src_root)rHr9r&�ensure_discovered�options�metar*r*r+r8�s.��

��r8�label�
orig_value�parsedcCs�d|vs
t|�dkrdSt�t��0d�|�}t|�}|jdur9d|�d|d�d�}t�|t	�Wd�dSWd�dS1sDwYdS)	amBecause users sometimes misinterpret this configuration:

    [options.extras_require]
    foo = bar;python_version<"4"

    It looks like one requirement with an environment marker
    but because there is no newline, it's parsed as two requirements
    with a semicolon as separator.

    Therefore, if:
        * input string does not contain a newline AND
        * parsed result contains two requirements AND
        * parsing of the two parts from the result ("<first>;<second>")
        leads in a valid Requirement with a valid marker
    a UserWarning is shown to inform the user about the possible problem.
    �
�N�;z#One of the parsed requirements in `z*` looks like a valid environment marker: 'rz}'
Make sure that the config is correct and check https://setuptools.pypa.io/en/latest/userguide/declarative_config.html#opt-2)
�len�
contextlib�suppressr�joinr�marker�warnings�warn�UserWarning)rSrTrUZoriginal_requirements_str�req�msgr*r*r+�%_warn_accidental_env_marker_misconfig�s

���"�rcc@s�eZdZUdZeed<	iZeeefed<	dede	de
jfdd�Ze
d	d
��Zdd�Zed(dd��Zedd��Zedd��Zedd��Zedefdd��Zdefdd�Zedd��Zedd��Zed)d d!��Zd"d#�Zd$d%�Zd&d'�ZdS)*r/z1Handles metadata supplied in configuration files.rD�aliasesr:rQrPc	Csdi}|j}|��D]\}}|�|�sq	|�|d��d�}|||<q	||_||_||_g|_||_	dS)N��.)
rD�items�
startswith�replace�stripr&r:�sectionsrCrP)	�selfr:rQr&rPrkrD�section_name�section_optionsr*r*r+�__init__�s


zConfigHandler.__init__cCstd|jj��)�.Metadata item name to parser function mapping.z!%s must provide .parsers property)�NotImplementedError�	__class__�__name__�rlr*r*r+�parsers�s
�zConfigHandler.parsersc	Cs�t�}|j}|j�||�}t|||�}||urt|��|rdSd}|j�|�}|r?z||�}Wnty>d}|js<�Ynw|rCdSt|d|d�}|durVt	|||�n||�|j
�|�dS)NFTzset_%s)�tupler:rd�getr?�KeyErrorru�	Exceptionr&�setattrrC�append)	rlZoption_namerG�unknownr:�
current_valueZskip_option�parser�setterr*r*r+�__setitem__s4��zConfigHandler.__setitem__�,cCs8t|t�r|Sd|vr|��}n|�|�}dd�|D�S)z�Represents value as a list.

        Value is split either by separator (defaults to comma) or by lines.

        :param value:
        :param separator: List items separator character.
        :rtype: list
        rVcSsg|]
}|��r|���qSr*�rj)�.0�chunkr*r*r+�
<listcomp>:sz-ConfigHandler._parse_list.<locals>.<listcomp>)�
isinstance�list�
splitlines�split)�clsrG�	separatorr*r*r+�_parse_list(s



zConfigHandler._parse_listcCsPd}i}|�|�D]}|�|�\}}}||krtd|��|��||��<q	|S)zPRepresents value as a dict.

        :param value:
        :rtype: dict
        �=z(Unable to parse option value to dict: %s)r��	partitionrrj)r�rGr��result�liner;�sep�valr*r*r+�_parse_dict<s�zConfigHandler._parse_dictcCs|��}|dvS)zQRepresents value as boolean.

        :param value:
        :rtype: bool
        )�1�true�yes)�lower�r�rGr*r*r+�_parse_boolOszConfigHandler._parse_boolc��fdd�}|S)z�Returns a parser function to make sure field inputs
        are not files.

        Parses a value after getting the key so error messages are
        more informative.

        :param key:
        :rtype: callable
        cs d}|�|�rtd�����|S)N�file:zCOnly strings are accepted for the {0} field, files are not accepted)rh�
ValueErrorr<)rGZexclude_directive�r;r*r+r~es
�z3ConfigHandler._exclude_files_parser.<locals>.parserr*)r�r;r~r*r�r+�_exclude_files_parserYs	z#ConfigHandler._exclude_files_parser�root_dircCsPd}t|t�s	|S|�|�s|S|t|�d�}dd�|�d�D�}t�||�S)aORepresents value as a string, allowing including text
        from nearest files using `file:` directive.

        Directive is sandboxed and won't reach anything outside
        directory with setup.py.

        Examples:
            file: README.rst, CHANGELOG.md, src/file.txt

        :param str value:
        :rtype: str
        r�Ncss�|]}|��VqdS�Nr�)r�r2r*r*r+�	<genexpr>�s�z,ConfigHandler._parse_file.<locals>.<genexpr>r�)r�rrhrYr�rZ
read_files)r�rGr�Zinclude_directive�specZ	filepathsr*r*r+�_parse_fileps

zConfigHandler._parse_filecCs:d}|�|�s	|S|�|d�}|�|jj�t�|||�S)z�Represents value as a module attribute.

        Examples:
            attr: package.attr
            attr: package.module.attr

        :param str value:
        :rtype: str
        zattr:re)rhri�updaterPrMrZ	read_attr)rlrGrMr�Zattr_directiveZ	attr_descr*r*r+�_parse_attr�s

zConfigHandler._parse_attrcr�)z�Returns parser function to represents value as a list.

        Parses a value applying given methods one after another.

        :param parse_methods:
        :rtype: callable
        cs|}�D]}||�}q|Sr�r*)rGrU�method��
parse_methodsr*r+rL�s
z1ConfigHandler._get_parser_compound.<locals>.parser*)r�r�rLr*r�r+�_get_parser_compound�s
z"ConfigHandler._get_parser_compoundcCs,i}|��D]
\}\}}|||�||<q|S)aParses section options into a dictionary.

        Applies a given parser to each option in a section.

        :param dict section_options:
        :param callable values_parser: function with 2 args corresponding to key, value
        :rtype: dict
        )rg)r�rn�
values_parserrGr;�_r�r*r*r+�_parse_section_to_dict_with_key�s
z-ConfigHandler._parse_section_to_dict_with_keyNcs$�r�fdd�ndd�}|�||�S)aParses section options into a dictionary.

        Optionally applies a given parser to each value.

        :param dict section_options:
        :param callable values_parser: function with 1 arg corresponding to option value
        :rtype: dict
        cs�|�Sr�r*�r��v�r�r*r+�<lambda>�sz6ConfigHandler._parse_section_to_dict.<locals>.<lambda>cSs|Sr�r*r�r*r*r+r��s�r�)r�rnr�r~r*r�r+�_parse_section_to_dict�s
z$ConfigHandler._parse_section_to_dictc	CsL|��D]\}\}}t�t��|||<Wd�n1swYqdS)zQParses configuration file section.

        :param dict section_options:
        N)rgrZr[rx)rlrn�namer�rGr*r*r+�
parse_section�s
���zConfigHandler.parse_sectioncCsb|j��D])\}}d}|rd|}t|d|�dd�d�}|dur*td|j|f��||�qdS)zTParses configuration file items from one
        or more related sections.

        rez_%szparse_section%srf�__Nz0Unsupported distribution option section: [%s.%s])rkrgr?rirrD)rlrmrnZmethod_postfixZsection_parser_methodr*r*r+rL�s"���
�zConfigHandler.parsecst�����fdd��}|S)z�this function will wrap around parameters that are deprecated

        :param msg: deprecation message
        :param warning_class: class of warning exception to be raised
        :param func: function to be wrapped around
        cst�����|i|��Sr�)r^r_)�args�kwargs��funcrb�
warning_classr*r+�config_handler�sz@ConfigHandler._deprecated_config_handler.<locals>.config_handlerr)rlr�rbr�r�r*r�r+�_deprecated_config_handler�sz(ConfigHandler._deprecated_config_handler)r�r�)rs�
__module__�__qualname__�__doc__r�__annotations__rdr	r�AllCommandOptionsrrKro�propertyrur��classmethodr�r�r�r��_Pathr�r�r�r�r�r�rLr�r*r*r*r+r/�sH
��
�
&

	



r/c
speZdZdZddddd�ZdZ	dejfd	d
dede	d
e
jdee
def�fdd�
Zedd��Zdd�Z�ZS)rIrN�url�description�classifiers�	platforms)Z	home_page�summaryZ
classifier�platformFNr:rrQr&rPrMr�cs"t��||||�||_||_dSr�)�superrorMr�)rlr:rQr&rPrMr��rrr*r+ros	
zConfigMetadataHandler.__init__cCsh|j}t|j|jd�}|j}|j}||||�|dt�||�||�|d�|�|d�dt�||||j	|d�
S)rp�r�z[The requires parameter is deprecated, please use install_requires for runtime dependencies.�license�license_filezDThe license_file parameter is deprecated, use license_files instead.)
r��keywordsZprovides�requiresZ	obsoletesr�r�r�Z
license_filesr�Zlong_description�versionZproject_urls)
r�rr�r�r�r�r�rr��_parse_version)rl�
parse_list�
parse_file�
parse_dictZexclude_files_parserr*r*r+ru s4�
��zConfigMetadataHandler.parserscCsn|�||j�}||kr+|��}zt|�W|Sty*d}t|jdit�����wt�	|�
||j|j��S)zSParses `version` option value.

        :param value:
        :rtype: str

        zCVersion loaded from {value} does not comply with PEP 440: {version}Nr*)r�r�rjrrrr<r=rr�r�rM)rlrGr��tmplr*r*r+r�Bs
���	z$ConfigMetadataHandler._parse_version)rsr�r�rDrdZstrict_moder1�curdirr��boolrrKr
rBr�ror�rur��
__classcell__r*r*r�r+rIs6��������
!rIrcs�eZdZdZdddededejf�fdd�Ze	dd	��Z
d
d�Zded
efdd�Z
edd��Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zd d!�Zd"d#�Z�ZS)$rJrQr:rr&rPcs$t��||||�|j|_i|_dSr�)r�rorOr�rM)rlr:rQr&rPr�r*r+roas
zConfigOptionsHandler.__init__cCs|j|dd�S)NrX)r�)r�r�r*r*r+�_parse_list_semicolonlsz*ConfigOptionsHandler._parse_list_semicoloncCs|j||jd�S)Nr�)r�r�)rlrGr*r*r+�_parse_file_in_rootpsz(ConfigOptionsHandler._parse_file_in_rootrSrGcCs*|�|�|��}t|||�dd�|D�S)NcSsg|]	}|�d�s|�qS)�#)rh)r�r�r*r*r+r�yszAConfigOptionsHandler._parse_requirements_list.<locals>.<listcomp>)r�r�rc)rlrSrGrUr*r*r+�_parse_requirements_listssz-ConfigOptionsHandler._parse_requirements_listcCsV|j}|j}|j}|j}|||||||�|dt�t|jd�|j|j|j	|j
|t|d�S)rpzeThe namespace_packages parameter is deprecated, consider using implicit namespaces instead (PEP 420).�install_requires)Zzip_safeZinclude_package_datarM�scriptsZeager_resourcesZdependency_links�namespace_packagesr�Zsetup_requiresZ
tests_require�packages�entry_pointsZ
py_modulesZpython_requires�cmdclass)r�r�r��_parse_cmdclassr�rrr�r��_parse_packagesr�r)rlr�Z
parse_boolr�Zparse_cmdclassr*r*r+ru{s4���zConfigOptionsHandler.parserscCs|jj}t�|�|�||j�Sr�)rPrMrr�r�r�)rlrGrMr*r*r+r��sz$ConfigOptionsHandler._parse_cmdclasscCsbddg}|��}||vr|�|�S|�|j�di��}|j||dk|j|jd�tj	di|��S)zTParses `packages` option value.

        :param value:
        :rtype: list
        zfind:zfind_namespace:z
packages.findr)�
namespacesr�Zfill_package_dirNr*)
rjr��parse_section_packages__findrkrwr�r�rMrZ
find_packages)rlrGZfind_directivesZ
trimmed_value�find_kwargsr*r*r+r��s
�
�z$ConfigOptionsHandler._parse_packagescsR|�||j�}gd��t�fdd�|��D��}|�d�}|dur'|d|d<|S)z�Parses `packages.find` configuration file section.

        To be used in conjunction with _parse_packages().

        :param dict section_options:
        )�where�include�excludecs$g|]\}}|�vr|r||f�qSr*r*)r��kr��Z
valid_keysr*r+r��s$zEConfigOptionsHandler.parse_section_packages__find.<locals>.<listcomp>r�Nr)r�r�rBrgrw)rlrnZsection_datar�r�r*r�r+r��s�
z1ConfigOptionsHandler.parse_section_packages__findcCs|�||j�}||d<dS)z`Parses `entry_points` configuration file section.

        :param dict section_options:
        r�N)r�r��rlrnrUr*r*r+�parse_section_entry_points�sz/ConfigOptionsHandler.parse_section_entry_pointscCs|�||j�}t�|�Sr�)r�r�rZcanonic_package_data)rlrn�package_datar*r*r+�_parse_package_data�s
z(ConfigOptionsHandler._parse_package_datacC�|�|�|d<dS)z`Parses `package_data` configuration file section.

        :param dict section_options:
        r�N�r��rlrnr*r*r+�parse_section_package_data��z/ConfigOptionsHandler.parse_section_package_datacCr�)zhParses `exclude_package_data` configuration file section.

        :param dict section_options:
        Zexclude_package_dataNr�r�r*r*r+�"parse_section_exclude_package_data�r�z7ConfigOptionsHandler.parse_section_exclude_package_datacs ��|�fdd��}|�d<dS)zbParses `extras_require` configuration file section.

        :param dict section_options:
        cs��d|�d�|�S)Nzextras_require[�])r�)r�r�rtr*r+r��szCConfigOptionsHandler.parse_section_extras_require.<locals>.<lambda>Zextras_requireNr�r�r*rtr+�parse_section_extras_require�s

�z1ConfigOptionsHandler.parse_section_extras_requirecCs$|�||j�}t�||j�|d<dS)z^Parses `data_files` configuration file section.

        :param dict section_options:
        Z
data_filesN)r�r�rZcanonic_data_filesr�r�r*r*r+�parse_section_data_files�sz-ConfigOptionsHandler.parse_section_data_files)rsr�r�rDr�r�rrKror�r�r�rr�r�rur�r�r�r�r�r�r�r�r�r�r*r*r�r+rJ]s4����

 rJ)FF)r*F)F);r�r1rZr>r^�collectionsrrr�typingrrrr	r
rrr
rrrZdistutils.errorsrrZ(setuptools.extern.packaging.requirementsrrZ#setuptools.extern.packaging.versionrrZ&setuptools.extern.packaging.specifiersrZsetuptools._deprecation_warningrrerr#r�distutils.distrr�PathLiker�ZSingleCommandOptionsr�rrBr,r-r�r$rAr%r8r�rcr/rIrJr*r*r*r+�<module>sx4��
������
����
�+!0[