HEX
Server: Apache
System: Linux p3plzcpnl506847.prod.phx3.secureserver.net 4.18.0-553.54.1.lve.el8.x86_64 #1 SMP Wed Jun 4 13:01:13 UTC 2025 x86_64
User: slfopp7cb1df (5698090)
PHP: 8.1.34
Disabled: NONE
Upload Files
File: //opt/python38/lib/python3.8/site-packages/setuptools/__pycache__/config.cpython-38.pyc
U

�i�_�T�@s&ddlmZmZddlZddlZddlZddlZddlZddlZddl	Z	ddl
mZddlmZddlm
Z
ddlZddlmZmZddlmZmZddlmZdd	lmZmZeZGd
d�d�Zejdd
��Zddd�Zdd�Z dd�Z!ddd�Z"Gdd�d�Z#Gdd�de#�Z$Gdd�de#�Z%dS)�)�absolute_import�unicode_literalsN)�defaultdict)�partial��wraps)�DistutilsOptionError�DistutilsFileError)�
LegacyVersion�parse)�SpecifierSet)�string_types�PY3c@s eZdZdZdd�Zdd�ZdS)�StaticModulez0
    Attempt to load the module by the name
    c	CsLtj�|�}t|j��}|��}W5QRXt�|�}t|��	t
��|`dS�N)�	importlib�util�	find_spec�open�origin�read�astr�vars�update�locals�self)r�name�spec�strm�src�module�r!�5/tmp/pip-unpacked-wheel-tlqm5ymo/setuptools/config.py�__init__s
zStaticModule.__init__csHzt�fdd�|jjD��WStk
rBtdjft����YnXdS)Nc3sH|]@}t|tj�r|jD](}t|tj�r|j�krt�|j�VqqdSr)�
isinstancerZAssign�targets�Name�id�literal_eval�value)�.0Z	statement�target��attrr!r"�	<genexpr>&s
�z+StaticModule.__getattr__.<locals>.<genexpr>z#{self.name} has no attribute {attr})�nextr �body�	Exception�AttributeError�formatr)rr-r!r,r"�__getattr__$s�
�zStaticModule.__getattr__N)�__name__�
__module__�__qualname__�__doc__r#r4r!r!r!r"rsrc	cs,ztj�d|�dVW5tj�|�XdS)zH
    Add path to front of sys.path for the duration of the context.
    rN)�sys�path�remove�insert)r:r!r!r"�
patch_path2s
r=Fc		Cs�ddlm}m}tj�|�}tj�|�s4td|��t��}t�	tj�
|��zJ|�}|rb|��ng}||krx|�|�|j
||d�t||j|d�}W5t�	|�Xt|�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)�Distribution�
_Distributionz%Configuration file %s does not exist.)�	filenames)�ignore_option_errors)Zsetuptools.distr>r?�osr:�abspath�isfiler	�getcwd�chdir�dirname�find_config_files�append�parse_config_files�parse_configuration�command_options�configuration_to_dict)	�filepathZfind_othersrAr>r?Zcurrent_directory�distr@�handlersr!r!r"�read_configuration>s*�
�
rQcCs.djft��}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})r3r�	functoolsr�getattr)�
target_obj�keyZgetter_nameZby_attribute�getterr!r!r"�_get_optionmsrWcCs<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_optionsrWrT�section_prefix)rPZconfig_dict�handler�optionr)r!r!r"rMys
rMcCs6t|||�}|��t|j|||j�}|��||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
    )�ConfigOptionsHandlerr�ConfigMetadataHandler�metadata�package_dir)�distributionrLrA�options�metar!r!r"rK�s��rKc@s�eZdZdZdZiZd%dd�Zedd��Zdd	�Z	e
d&dd��Ze
d
d��Ze
dd��Z
e
dd��Ze
dd��Zedd��Zedd��Ze
d'dd��Ze
dd��Ze
d(dd��Zdd �Zd!d"�Zd#d$�ZdS))�
ConfigHandlerz1Handles metadata supplied in configuration files.NFcCs^i}|j}|��D].\}}|�|�s&q|�|d��d�}|||<q||_||_||_g|_dS)N��.)	rZ�items�
startswith�replace�striprArT�sectionsrY)rrTrbrArkrZ�section_name�section_optionsr!r!r"r#�s

zConfigHandler.__init__cCstd|jj��dS)�.Metadata item name to parser function mapping.z!%s must provide .parsers propertyN)�NotImplementedError�	__class__r5)rr!r!r"�parsers�s
�zConfigHandler.parsersc	Cs�t�}|j}|j�||�}t|||�}||kr6t|��|r>dSd}|j�|�}|r�z||�}Wn tk
r~d}|jsz�YnX|r�dSt|d|d�}|dkr�t	|||�n||�|j
�|�dS)NFTzset_%s)�tuplerT�aliases�getrS�KeyErrorrqr1rA�setattrrYrI)	rZoption_namer)�unknownrTZ
current_valueZskip_option�parser�setterr!r!r"�__setitem__�s0zConfigHandler.__setitem__�,cCs8t|t�r|Sd|kr |��}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
        �
cSsg|]}|��r|���qSr!)rj)r*�chunkr!r!r"�
<listcomp>sz-ConfigHandler._parse_list.<locals>.<listcomp>)r$�list�
splitlines�split)�clsr)�	separatorr!r!r"�_parse_list�s



zConfigHandler._parse_listcCsPd}i}|�|�D]8}|�|�\}}}||kr:td|��|��||��<q|S)zPRepresents value as a dict.

        :param value:
        :rtype: dict
        �=z(Unable to parse option value to dict: %s)r��	partitionrrj)r�r)r��result�linerU�sep�valr!r!r"�_parse_dicts�zConfigHandler._parse_dictcCs|��}|dkS)zQRepresents value as boolean.

        :param value:
        :rtype: bool
        )�1�true�yes)�lower)r�r)r!r!r"�_parse_boolszConfigHandler._parse_boolcs�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�
ValueErrorr3)r)Zexclude_directive�rUr!r"rx-s
��z3ConfigHandler._exclude_files_parser.<locals>.parserr!)r�rUrxr!r�r"�_exclude_files_parser"sz#ConfigHandler._exclude_files_parsercs\d}t|t�s|S|�|�s |S|t|�d�}dd�|�d�D�}d��fdd�|D��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|]}tj�|���VqdSr)rBr:rCrj�r*r:r!r!r"r.Msz,ConfigHandler._parse_file.<locals>.<genexpr>r{r|c3s.|]&}��|�stj�|�r��|�VqdS)TN)�
_assert_localrBr:rD�
_read_filer��r�r!r"r.Ns

�)r$r
rh�lenr��join)r�r)Zinclude_directiverZ	filepathsr!r�r"�_parse_file6s

�zConfigHandler._parse_filecCs|�t���std|��dS)Nz#`file:` directive can not access %s)rhrBrEr)rNr!r!r"r�Us�zConfigHandler._assert_localc
Cs.tj|dd��}|��W5QR�SQRXdS)Nzutf-8)�encoding)�iorr)rN�fr!r!r"r�[szConfigHandler._read_filec
Csd}|�|�s|S|�|d����d�}|��}d�|�}|p@d}t��}|r�|d|kr�||d}|�dd�}	t	|	�dkr�tj
�t��|	d�}|	d}q�|}nd|kr�tj
�t��|d�}t|��Dztt
|�|�WW5QR�Stk
�rt�|�}
YnXW5QRXt|
|�S)z�Represents value as a module attribute.

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

        :param str value:
        :rtype: str
        zattr:rerfr#r�/�)rhrirjr��popr�rBrE�rsplitr�r:r=rSrr1r�
import_module)r�r)r`Zattr_directiveZ
attrs_path�	attr_name�module_name�parent_pathZcustom_path�partsr r!r!r"�_parse_attr`s0



zConfigHandler._parse_attrcs�fdd�}|S)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|Srr!)r)�parsed�method��
parse_methodsr!r"r�s
z1ConfigHandler._get_parser_compound.<locals>.parser!)r�r�rr!r�r"�_get_parser_compound�s	z"ConfigHandler._get_parser_compoundcCs6i}|pdd�}|��D]\}\}}||�||<q|S)z�Parses section options into a dictionary.

        Optionally applies a given parser to values.

        :param dict section_options:
        :param callable values_parser:
        :rtype: dict
        cSs|Srr!)r�r!r!r"�<lambda>��z6ConfigHandler._parse_section_to_dict.<locals>.<lambda>)rg)r�rmZ
values_parserr)rU�_r�r!r!r"�_parse_section_to_dict�s

z$ConfigHandler._parse_section_to_dictc	Cs<|��D].\}\}}z|||<Wqtk
r4YqXqdS)zQParses configuration file section.

        :param dict section_options:
        N)rgru)rrmrr�r)r!r!r"�
parse_section�s
zConfigHandler.parse_sectioncCsb|j��D]R\}}d}|r"d|}t|d|�dd�d�}|dkrTtd|j|f��||�q
dS)zTParses configuration file items from one
        or more related sections.

        rez_%szparse_section%srf�__Nz0Unsupported distribution option section: [%s.%s])rkrgrSrirrZ)rrlrmZmethod_postfixZsection_parser_methodr!r!r"r�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�����||�Sr)�warnings�warn)�args�kwargs��func�msg�
warning_classr!r"�config_handler�sz@ConfigHandler._deprecated_config_handler.<locals>.config_handlerr)rr�r�r�r�r!r�r"�_deprecated_config_handler�sz(ConfigHandler._deprecated_config_handler)F)r{)N)N)r5r6r7r8rZrsr#�propertyrqrz�classmethodr�r�r�r�r��staticmethodr�r�r�r�r�r�rr�r!r!r!r"rd�s<

&

	



-
rdcsHeZdZdZddddd�ZdZd�fd	d
�	Zedd��Zd
d�Z	�Z
S)r^r_�url�description�classifiers�	platforms)Z	home_page�summary�
classifier�platformFNcstt|��|||�||_dSr)�superr^r#r`)rrTrbrAr`�rpr!r"r#�s�zConfigMetadataHandler.__init__c
CsN|j}|j}|j}|j}||||�|dt�||�||�|d�||||j|d�S)rnz[The requires parameter is deprecated, please use install_requires for runtime dependencies.�license)r��keywords�provides�requires�	obsoletesr�r�Z
license_filesr��long_description�version�project_urls)r�r�r�r�r��DeprecationWarningr��_parse_version)r�
parse_listZ
parse_file�
parse_dictZexclude_files_parserr!r!r"rq�s*�
�zConfigMetadataHandler.parserscCs�|�|�}||krB|��}tt|�t�r>d}t|jft����|S|�||j	�}t
|�r^|�}t|t�s�t|d�r�d�
tt|��}nd|}|S)zSParses `version` option value.

        :param value:
        :rtype: str

        zCVersion loaded from {value} does not comply with PEP 440: {version}�__iter__rfz%s)r�rjr$rr
rr3rr�r`�callabler
�hasattrr��map�str)rr)r��tmplr!r!r"r�s 
�

z$ConfigMetadataHandler._parse_version)FN)r5r6r7rZrsZstrict_moder#r�rqr��
__classcell__r!r!r�r"r^�s��
r^c@s\eZdZdZedd��Zdd�Zdd�Zdd	�Zd
d�Z	dd
�Z
dd�Zdd�Zdd�Z
dS)r]rbcCsN|j}t|jdd�}|j}|j}|||||||||||||||j|j|td�S)rn�;�r�)Zzip_safeZuse_2to3Zinclude_package_datar`Zuse_2to3_fixersZuse_2to3_exclude_fixersZconvert_2to3_doctests�scriptsZeager_resourcesZdependency_linksZnamespace_packagesZinstall_requiresZsetup_requiresZ
tests_require�packages�entry_points�
py_modulesZpython_requires)r�rr�r��_parse_packagesr�r)rr�Zparse_list_semicolonZ
parse_boolr�r!r!r"rq>s.�zConfigOptionsHandler.parserscCszddg}|��}||kr"|�|�S||dk}|r>ts>td��|�|j�di��}|rdddlm}nddlm	}|f|�S)	zTParses `packages` option value.

        :param value:
        :rtype: list
        zfind:zfind_namespace:r�z8find_namespace: directive is unsupported on Python < 3.3z
packages.findr)�find_namespace_packages)�
find_packages)
rjr�rr�parse_section_packages__findrkrt�
setuptoolsr�r�)rr)Zfind_directivesZ
trimmed_valueZfindns�find_kwargsr�r!r!r"r�[s 
��z$ConfigOptionsHandler._parse_packagescsT|�||j�}dddg�t�fdd�|��D��}|�d�}|dk	rP|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|]\}}|�kr|r||f�qSr!r!�r*�k�v�Z
valid_keysr!r"r~�szEConfigOptionsHandler.parse_section_packages__find.<locals>.<listcomp>Nr)r�r�rXrgrt)rrmZsection_datar�r�r!r�r"r�ws�
�
z1ConfigOptionsHandler.parse_section_packages__findcCs|�||j�}||d<dS)z`Parses `entry_points` configuration file section.

        :param dict section_options:
        r�N)r�r��rrmr�r!r!r"�parse_section_entry_points�sz/ConfigOptionsHandler.parse_section_entry_pointscCs.|�||j�}|�d�}|r*||d<|d=|S)N�*re)r�r�rt)rrmr��rootr!r!r"�_parse_package_data�s
z(ConfigOptionsHandler._parse_package_datacCs|�|�|d<dS)z`Parses `package_data` configuration file section.

        :param dict section_options:
        �package_dataN�r��rrmr!r!r"�parse_section_package_data�sz/ConfigOptionsHandler.parse_section_package_datacCs|�|�|d<dS)zhParses `exclude_package_data` configuration file section.

        :param dict section_options:
        Zexclude_package_dataNr�r�r!r!r"�"parse_section_exclude_package_data�s�z7ConfigOptionsHandler.parse_section_exclude_package_datacCs"t|jdd�}|�||�|d<dS)zbParses `extras_require` configuration file section.

        :param dict section_options:
        r�r�Zextras_requireN)rr�r�)rrmr�r!r!r"�parse_section_extras_require�s
�z1ConfigOptionsHandler.parse_section_extras_requirecCs(|�||j�}dd�|��D�|d<dS)z^Parses `data_files` configuration file section.

        :param dict section_options:
        cSsg|]\}}||f�qSr!r!r�r!r!r"r~�szAConfigOptionsHandler.parse_section_data_files.<locals>.<listcomp>�
data_filesN)r�r�rgr�r!r!r"�parse_section_data_files�sz-ConfigOptionsHandler.parse_section_data_filesN)r5r6r7rZr�rqr�r�r�r�r�r�r�r�r!r!r!r"r]:s

	r])FF)F)&�
__future__rrrr�rBr9r�rRr�collectionsrrr�
contextlib�distutils.errorsrr	Z#setuptools.extern.packaging.versionr
rZ&setuptools.extern.packaging.specifiersrZsetuptools.extern.sixr
r�type�
__metaclass__r�contextmanagerr=rQrWrMrKrdr^r]r!r!r!r"�<module>s>
�
/�
@V