403Webshell
Server IP : 127.0.0.1  /  Your IP : 216.73.216.109
Web Server : Apache/2.4.54 (Win64) OpenSSL/1.1.1q PHP/8.1.10
System : Windows NT DESKTOP-E5T4RUN 10.0 build 19045 (Windows 10) AMD64
User : SERVERWEB ( 0)
PHP Version : 8.1.10
Disable Function : NONE
MySQL : OFF |  cURL : ON |  WGET : OFF |  Perl : OFF |  Python : OFF |  Sudo : OFF |  Pkexec : OFF
Directory :  C:/cygwin64/lib/python3.9/site-packages/setuptools/config/__pycache__/

Upload File :
current_dir [ Writeable] document_root [ Writeable]

 

Command :


[ Back ]     

Current File : C:/cygwin64/lib/python3.9/site-packages/setuptools/config/__pycache__/setupcfg.cpython-39.opt-1.pyc
a

��ed�@s$dZddlZddlZddlZddlmZddlmZddlmZddlm	Z	m
Z
mZmZm
Z
mZmZmZmZmZmZmZddlmZdd	lmZmZdd
lmZddlmZmZddl m!Z!dd
l"m#Z#m$Z$ddl%m&Z&ddl'm(Z(e	�rddl)m*Z*ddl+m,Z,ededeffZ-ede-fZ.ededd�Z/d<ee0d�dd�Z1dedd�dd�Z2d=deeee3ed d!�d"d#�Z4e/e5d$�d%d&�Z6ed e0d'�d(d)�Z7d>de.ed*d+�d,d-�Z8e5e5e9d.�d/d0�Z:Gd1d2�d2e
e/�Z;Gd3d4�d4e;d5�Z<Gd6d7�d7e;d�Z=Gd8d9�d9e&�Z>Gd:d;�d;e&�Z?dS)?a<
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``.
�N)�defaultdict)�partial��wraps)�
TYPE_CHECKING�Callable�Any�Dict�Generic�Iterable�List�Optional�Set�Tuple�TypeVar�Union�)�StrPath)�	FileError�OptionError)�default_environment)�InvalidRequirement�Requirement)�SpecifierSet)�InvalidVersion�Version)�SetuptoolsDeprecationWarning�)�expand)�DistributionMetadata��Distribution�str�Target)r!r)�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.distr!Zfind_config_files�_apply�configuration_to_dict)r%Zfind_others�ignore_option_errorsr!�dist�	filenames�handlers�r.�>/usr/lib/python3.9/site-packages/setuptools/config/setupcfg.py�read_configuration9s
r0r!)r+r%r&cCst||�|��|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_configurationSs
r1r.)�
ConfigHandler.)r+r%�other_filesr*r&c	Cs�ddlm}tj�|�}tj�|�s4td|�d���t��}t�tj�	|��g|�|�}z4|j
||d�t||j|d�}|�
�Wt�|�nt�|�0|S)zHRead configuration from ``filepath`` and applies to the ``dist`` object.r)�
_DistributionzConfiguration file z does not exist.)r,)r*)r'r4�os�path�abspath�isfiler�getcwd�chdir�dirnameZparse_config_files�parse_configuration�command_optionsZ_finalize_license_files)r+r%r3r*r4Zcurrent_directoryr,r-r.r.r/r(\s�
r()�
target_obj�keycCs*d|��}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.
    Zget_)�	functoolsr�getattr)r>r?Zgetter_nameZby_attribute�getterr.r.r/�_get_optionzs
rC)r-r&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_optionsrCr>�section_prefix)r-Zconfig_dictZhandler�option�valuer.r.r/r)�s
r))�ConfigMetadataHandler�ConfigOptionsHandler)�distributionr=r&cCs�t�|��f}t||||�}|��|js0|j|_t|j||||j|j�}|��|j�	|j|j�Wd�n1sv0Y||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�_referenced_files�update)rKr=r*�ensure_discovered�options�metar.r.r/r<�s.���"r<)�label�
orig_value�parsedc
s�d|vst��dkrdSt���}z,t�d�}|j|vrLtj|�dd�WnVty�}z>t�fdd�|D��r�tj	|�dd�}t|�|�WYd}~n
d}~00dS)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.
    �
rNr)Zfield�reqc3s|]}�d�|�VqdS)rN��
startswith)�.0Zmarker�rXr.r/�	<genexpr>��z8_warn_accidental_env_marker_misconfig.<locals>.<genexpr>)
�len�
marker_env�keysr�name�_AmbiguousMarker�emitr�any�message)rVrWrXZmarkersrZZex�msgr.r^r/�%_warn_accidental_env_marker_misconfig�s

rjc@s�eZdZUdZeed<iZeeefed<ee	e
jd�dd�Ze
e	d�dd	��Zed
d��Zdd
�Ze
d*dd��Ze
dd��Ze
dd��Ze
dd��Zed�dd�Zed�dd�Ze
dd��Ze
dd��Ze
d+d!d"��Zd#d$�Zd d%�d&d'�Zd(d)�Zd S),r2z1Handles metadata supplied in configuration files.rF�aliases)r>rTrScCs4||_||_t|�|��|_g|_||_t�|_dS�N)	r*r>rD�_section_options�sectionsrErS�setrQ��selfr>rTr*rSr.r.r/�__init__�szConfigHandler.__init__)rTccs>|��D]0\}}|�|j�\}}}|r(q|�d�|fVqdS)N�.)�items�	partitionrF�lstrip)�clsrTZ	full_namerHZpre�seprdr.r.r/rms
zConfigHandler._section_optionscCstd|jj��dS)�.Metadata item name to parser function mapping.z!%s must provide .parsers propertyN)�NotImplementedError�	__class__�__name__�rqr.r.r/�parserss
�zConfigHandler.parsersc	
Cs�|j}|j�||�}zt||�}Wn.tyP}zt|�|�WYd}~n
d}~00|rZdSz|j�|dd��|�}Wntf|jy�YdS0t	�
|j|�}t|d||�}||�|j�
|�dS)NcSs|Srlr.)�xr.r.r/�<lambda>&r`z+ConfigHandler.__setitem__.<locals>.<lambda>zset_%s)r>rk�getrA�AttributeError�KeyErrorr~�	Exceptionr*r@r�__setattr__rE�append)	rqZoption_namerHr>Z
current_value�erXZ
simple_setter�setterr.r.r/�__setitem__s  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
        rYcSsg|]}|��r|���qSr.��strip)r]�chunkr.r.r/�
<listcomp>Br`z-ConfigHandler._parse_list.<locals>.<listcomp>)�
isinstance�list�
splitlines�split)rwrH�	separatorr.r.r/�_parse_list0s



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

        :param value:
        :rtype: dict
        �=z&Unable to parse option value to dict: )r�rurr�)rwrHr��result�liner?rx�valr.r.r/�_parse_dictDszConfigHandler._parse_dictcCs|��}|dvS)zQRepresents value as boolean.

        :param value:
        :rtype: bool
        )�1�trueZyes)�lower�rwrHr.r.r/�_parse_boolUszConfigHandler._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)r\�
ValueError�format)rHZexclude_directive�r?r.r/�parserks
��z3ConfigHandler._exclude_files_parser.<locals>.parserr.)rwr?r�r.r�r/�_exclude_files_parser_s	z#ConfigHandler._exclude_files_parser��root_dircCs\d}t|t�s|S|�|�s |S|t|�d�}dd�|�d�D�}|j�|�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�NcSsg|]}|���qSr.r�)r]r6r.r.r/r��r`z-ConfigHandler._parse_file.<locals>.<listcomp>r�)	r�r"r\rar�rQrRrZ
read_files)rqrHr�Zinclude_directive�specZ	filepathsr.r.r/�_parse_filevs


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:�)r\�replacerRrSrNrZ	read_attr)rqrHrNr�Zattr_directiveZ	attr_descr.r.r/�_parse_attr�s

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|Srlr.)rHrX�method��
parse_methodsr.r/rM�s
z1ConfigHandler._get_parser_compound.<locals>.parser.)rwr�rMr.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
        )rt)rw�section_options�
values_parserrHr?�_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�|�Srlr.�r��v�r�r.r/r��r`z6ConfigHandler._parse_section_to_dict.<locals>.<lambda>cSs|Srlr.r�r.r.r/r��r`�r�)rwr�r�r�r.r�r/�_parse_section_to_dict�s
z$ConfigHandler._parse_section_to_dictc	CsL|��D]>\}\}}t�t��|||<Wd�q1s<0YqdS)zQParses configuration file section.

        :param dict section_options:
        N)rt�
contextlib�suppressr�)rqr�rdr�rHr.r.r/�
parse_section�szConfigHandler.parse_section)r&cCsh|j��D]X\}}d}|r"d|}t|d|�dd�d�}|durZtd|j�d|�d���||�q
dS)	zTParses configuration file items from one
        or more related sections.

        r�z_%szparse_section%srs�__Nz*Unsupported distribution option section: [�])rnrtrAr�rrF)rqZsection_namer�Zmethod_postfixZsection_parser_methodr.r.r/rM�s$����zConfigHandler.parsecst�����fdd��}|S)z�this function will wrap around parameters that are deprecated

        :param msg: deprecation message
        :param func: function to be wrapped around
        cs.��dd�tjd�fi����|i|��S)N�
stacklevelrz Deprecated config in `setup.cfg`)�
setdefault�_DeprecatedConfigrf)�args�kwargs��func�kwrir.r/�config_handler�sz@ConfigHandler._deprecated_config_handler.<locals>.config_handlerr)rqr�rir�r�r.r�r/�_deprecated_config_handler�sz(ConfigHandler._deprecated_config_handler)r�)N)r|�
__module__�__qualname__�__doc__r"�__annotations__rkr	r#�AllCommandOptionsrrLrr�classmethodrm�propertyr~r�r�r�r�r�rr�r�r�r�r�r�rMr�r.r.r.r/r2�s>
	�


	



r2csdeZdZdZddddd�ZdZdejfd	ee	e
jee
ed
��fdd�
Zed
d��Zdd�Z�ZS)rIrO�url�description�classifiers�	platforms)Z	home_pageZsummaryZ
classifier�platformFNr)r>rTr*rSrNr�cs"t��||||�||_||_dSrl)�superrrrNr�)rqr>rTr*rSrNr��r{r.r/rrs	zConfigMetadataHandler.__init__cCsL|j}t|j|jd�}|j}|j}|||||�||�|d�||||j|d�S)ryr��license)r��keywordsZprovidesZ	obsoletesr�r�Z
license_filesr�Zlong_description�versionZproject_urls)r�rr�r�r�r�r��_parse_version)rq�
parse_listZ
parse_file�
parse_dictZexclude_files_parserr.r.r/r~$s 
�zConfigMetadataHandler.parsersc
Cs�|�||j�}||krj|��}zt|�Wn:tyd}z"td|�d|���|�WYd}~n
d}~00|St�|�||j	|j��S)zSParses `version` option value.

        :param value:
        :rtype: str

        zVersion loaded from z does not comply with PEP 440: N)
r�r�r�rrrrr�r�rN)rqrHr�r�r.r.r/r�:s���z$ConfigMetadataHandler._parse_version)r|r�r�rFrkZstrict_moder5�curdirr��boolrrLr
rDrrrr�r~r��
__classcell__r.r.r�r/rIs(���

rIrcs�eZdZdZdeeejd��fdd�Ze	dd��Z
dd	�Zeed
�dd�Z
ed
d��Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd �Z�ZS)!rJrTr!)r>rTr*rScs$t��||||�|j|_i|_dSrl)r�rrrPr�rNrpr�r.r/rrWszConfigOptionsHandler.__init__cCs|j|dd�S)N�;)r�)r�r�r.r.r/�_parse_list_semicolonbsz*ConfigOptionsHandler._parse_list_semicoloncCs|j||jd�S)Nr�)r�r�)rqrHr.r.r/�_parse_file_in_rootfsz(ConfigOptionsHandler._parse_file_in_root)rVrHcCs*|�|�|��}t|||�dd�|D�S)NcSsg|]}|�d�s|�qS)�#r[)r]r�r.r.r/r�or`zAConfigOptionsHandler._parse_requirements_list.<locals>.<listcomp>)r�r�rj)rqrVrHrXr.r.r/�_parse_requirements_listisz-ConfigOptionsHandler._parse_requirements_listcCsT|j}|j}|j}|j}|||||||�|d�t|jd�|j|j|j|j	|t
|d�S)ryzeThe namespace_packages parameter is deprecated, consider using implicit namespaces instead (PEP 420).�install_requires)Zzip_safeZinclude_package_datarNZscriptsZeager_resourcesZdependency_linksZnamespace_packagesr�Zsetup_requiresZ
tests_requireZpackages�entry_pointsZ
py_modulesZpython_requires�cmdclass)r�r�r��_parse_cmdclassr�rr�r��_parse_packagesr�r)rqr�Z
parse_boolr�Zparse_cmdclassr.r.r/r~qs2���zConfigOptionsHandler.parserscCs|jj}t�|�|�||j�Srl)rSrNrr�r�r�)rqrHrNr.r.r/r��sz$ConfigOptionsHandler._parse_cmdclasscCsbddg}|��}||vr"|�|�S|�|j�di��}|j||dk|j|jd�tj	fi|��S)zTParses `packages` option value.

        :param value:
        :rtype: list
        zfind:zfind_namespace:z
packages.findr)Z
namespacesr�Zfill_package_dir)
r�r��parse_section_packages__findrnr�rRr�rNrZ
find_packages)rqrHZfind_directivesZ
trimmed_value�find_kwargsr.r.r/r��s
�
�z$ConfigOptionsHandler._parse_packagescsR|�||j�}gd��t�fdd�|��D��}|�d�}|durN|d|d<|S)z�Parses `packages.find` configuration file section.

        To be used in conjunction with _parse_packages().

        :param dict section_options:
        )�whereZincludeZexcludecs$g|]\}}|�vr|r||f�qSr.r.)r]�kr��Z
valid_keysr.r/r��szEConfigOptionsHandler.parse_section_packages__find.<locals>.<listcomp>r�Nr)r�r�rDrtr�)rqr�Z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��rqr�rXr.r.r/�parse_section_entry_points�sz/ConfigOptionsHandler.parse_section_entry_pointscCs|�||j�}t�|�Srl)r�r�rZcanonic_package_data)rqr��package_datar.r.r/�_parse_package_data�sz(ConfigOptionsHandler._parse_package_datacCs|�|�|d<dS)z`Parses `package_data` configuration file section.

        :param dict section_options:
        r�N�r��rqr�r.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�sz7ConfigOptionsHandler.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�r�r}r.r/r��r`zCConfigOptionsHandler.parse_section_extras_require.<locals>.<lambda>Zextras_requireNr�r�r.r}r/�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)r|r�r�rFr�r�rrLrrr�r�r�r"r�r�r~r�r�r�r�r�r�r�r�r�r�r.r.r�r/rJTs*�

 rJc@s$eZdZdZdZdZedd��ZdS)rezAmbiguous requirement marker.z�
    One of the parsed requirements in `{field}` looks like a valid environment marker:

        {req!r}

    Please make sure that the configuration file is correct.
    You can use dangling lines to avoid this problem.
    z'userguide/declarative_config.html#opt-2cKs"d|j��}|j|j|j||d�S)Nz%https://setuptools.pypa.io/en/latest/)Zsee_urlZformat_args)�	_SEE_DOCS�_format�_SUMMARY�_DETAILS)rwr�Zdocsr.r.r/rhsz_AmbiguousMarker.messageN)r|r�r�r�r�r�r�rhr.r.r.r/re�s
rec@seZdZdZdS)r�z!userguide/declarative_config.htmlN)r|r�r�r�r.r.r.r/r�sr�)FF)r.F)F)@r�r�r@r5�collectionsrrr�typingrrrr	r
rrr
rrrr�_pathr�errorsrrZextern.packaging.markersrrbZextern.packaging.requirementsrrZextern.packaging.specifiersrZextern.packaging.versionrr�warningsrr�rZdistutils.distrr'r!ZSingleCommandOptionsr�r#rDr0r1r�r(r"rCr)r<r�rjr2rIrJrer�r.r.r.r/�<module>sj8������. #M 

Youez - 2016 - github.com/yon3zu
LinuXploit