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__/pyprojecttoml.cpython-39.pyc
a

��e�C�@s|dZddlZddlZddlmZddlmZddlmZm	Z	m
Z
mZmZm
Z
ddlmZddlmZmZdd	lmZd
dlmZd
dlmZmZd
d
lmZer�ddlmZddlm Z e�!e"�Z#ee$d�dd�Z%e$ee&d�dd�Z'd-dedd�dd�Z(d.eedd�dd�Z)d/e$eee&ede$d�d d!�Z*Gd"d#�d#�Z+d$d%�Z,ee&d&�d'd(��Z-Gd)d*�d*ej.�Z/Gd+d,�d,e�Z0dS)0ac
Load setuptools configuration from ``pyproject.toml`` files.

**PRIVATE MODULE**: API reserved for setuptools internal usage only.

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 ``tomllib`` or ``tomli``.
�N)�contextmanager)�partial)�
TYPE_CHECKING�Callable�Dict�Mapping�Optional�Set�)�StrPath)�	FileError�InvalidConfigError)�SetuptoolsWarning�)�expand)�_PREVIOUSLY_DEFINED�_MissingDynamic)�apply��Distribution)�Self)�filepath�returncCsDddlm}t|d��}|�|�Wd�S1s60YdS)Nr
)�tomllib�rb)Zcompat.py310r�open�load)rr�file�r�C/usr/lib/python3.9/site-packages/setuptools/config/pyprojecttoml.py�	load_file sr )�configrrc
Cs�ddlm}|j�d�}t|d�r*|��z|�|�WS|jy�}z`d|j��}|j	�
d�dkrzt�|�t�|j
�d|j	�d	�}t|�d
|���d�WYd}~n
d}~00dS)Nr)�_validate_pyprojectztrove-classifier�_disable_downloadzconfiguration error: �`�projectzinvalid pyproject.toml config: �.�
)�r"ZFORMAT_FUNCTIONS�get�hasattrr#�validateZValidationError�summary�name�strip�_logger�debug�details�
ValueError)r!rZ	validatorZtrove_classifier�exr,�errorrrrr+'s

r+Fr)�distrrcCst|d||�}t|||�S)zeApply the configuration from a ``pyproject.toml`` file into an existing
    distribution object.
    T)�read_configuration�_apply)r5r�ignore_option_errorsr!rrr�apply_configuration<sr9T)rr5c
Cs tj�|�}tj�|�s(td|�d���t|�p2i}|�di�}|�di�}|�di�}|rd|sh|shiSd|vr|tjdd�|r�t	|d	d
�d
ur�|�
d|j�n|�
dd�||d<||d<t|��(|d|id
�}t
||�Wd
�n1s�0Y|�rtj�|�}	t||	||�S|S)a�Read given configuration file and returns options from it as a dict.

    :param str|unicode filepath: Path to configuration file in the ``pyproject.toml``
        format.

    :param bool expand: Whether to expand directives and other computed values
        (i.e. post-process the given configuration)

    :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.

    :param Distribution|None: Distribution object to which the configuration refers.
        If not given a dummy object will be created and discarded after the
        configuration is read. This is used for auto-discovery of packages and in the
        case a dynamic configuration (e.g. ``attr`` or ``cmdclass``) is expanded.
        When ``expand=False`` this object is simply ignored.

    :rtype: dict
    zConfiguration file z does not exist.r%�tool�
setuptools�	distutilsz[tool.distutils])Zsubject�include_package_dataNzinclude-package-dataT)r%r:)�os�path�abspath�isfilerr r)�_ExperimentalConfiguration�emit�getattr�
setdefaultr=�_ignore_errorsr+�dirname�expand_configuration)
rrr8r5ZasdictZ
project_tableZ
tool_tableZsetuptools_tableZsubset�root_dirrrrr6Hs.
(r6)r!rIr8r5rcCst||||���S)a�Given a configuration with unresolved fields (e.g. dynamic, cmdclass, ...)
    find their final values.

    :param dict config: Dict containing the configuration for the distribution
    :param str root_dir: Top-level directory for the distribution/project
        (the same directory where ``pyproject.toml`` is place)
    :param bool ignore_option_errors: see :func:`read_configuration`
    :param Distribution|None: Distribution object to which the configuration refers.
        If not given a dummy object will be created and discarded after the
        configuration is read. Used in the case a dynamic configuration
        (e.g. ``attr`` or ``cmdclass``).

    :rtype: dict
    )�_ConfigExpanderr�r!rIr8r5rrrrH�srHc@s`eZdZd4eeeeedd�dd�Zdd�dd	�Zee	e
d
�dd�Zd5dd�Zdd�Z
dd�Zdd�Zee	e	fd�dd�Zdee	e	fd�dd�Zde	d�dd�Ze	ee	e	fd�d d!�Zde	ee	e	fd"�d#d$�Zdee	e	fd�d%d&�Zdeee	e	fd'�d(d)�Zdee	e	feee	efd*�d+d,�Zdd-�d.d/�Zdd-�d0d1�Zdd-�d2d3�ZdS)6rJNFrrKcCsp||_|pt��|_|�di�|_|j�dg�|_|�di��di�|_|j�di�|_||_	||_
t�|_dS)Nr%�dynamicr:r;)
r!r>�getcwdrIr)�project_cfgrL�setuptools_cfg�dynamic_cfgr8�_dist�set�_referenced_files)�selfr!rIr8r5rrr�__init__�sz_ConfigExpander.__init__�rcCs0ddlm}|j|j�dd�d�}|jp.||�S)Nrrr-)Zsrc_rootr-)�setuptools.distrrIrNr)rQ)rTr�attrsrrr�_ensure_dist�sz_ConfigExpander._ensure_dist)�	container�field�fncCsF||vrBt|j�� |||�||<Wd�n1s80YdS�N)rFr8)rTrZr[r\rrr�_process_field�sz_ConfigExpander._process_field�package-datacCs|j�|i�}t�|�Sr])rOr)�_expandZcanonic_package_data)rTr[Zpackage_datarrr�_canonic_package_data�sz%_ConfigExpander._canonic_package_datacCs�|��|��|�d�|��}t||j|j�}|�4}|j}|��|�|�|�	||�Wd�n1sp0Y|j
�|j
�|jS)Nzexclude-package-data)
�_expand_packagesrarY�_EnsurePackagesDiscoveredrNrO�package_dir�_expand_data_files�_expand_cmdclass�_expand_all_dynamicrS�updater!)rTr5�ctxZensure_discoveredrdrrrr�s

*z_ConfigExpander.expandcCs�|j�d�}|dus"t|ttf�r&dS|�d�}t|t�r�|j|d<|j�di�|d<t|j	��&t
jfi|��|jd<Wd�n1s�0YdS)N�packages�findrI�package-dirZfill_package_dir)rOr)�
isinstance�list�tuple�dictrIrErFr8r`Z
find_packages)rTrjrkrrrrb�s


z _ConfigExpander._expand_packagescCs$ttj|jd�}|�|jd|�dS)N)rIz
data-files)rr`Zcanonic_data_filesrIr^rO)rTZ
data_filesrrrre�sz"_ConfigExpander._expand_data_files)rdcCs*|j}ttj||d�}|�|jd|�dS)N)rdrI�cmdclass)rIrr`rqr^rO)rTrdrIrqrrrrf�sz _ConfigExpander._expand_cmdclass)r5rdc	s�d�����fdd��jD�}|j�����p0i���������������������d�dd�|��D�}�j	�|�dS)N)�version�readme�entry-points�scripts�gui-scripts�classifiers�dependencies�optional-dependenciescs$i|]}|�vr|���|���qSr)�_obtain��.0r[�r5rdrTZspecialrr�
<dictcomp>�s�z7_ConfigExpander._expand_all_dynamic.<locals>.<dictcomp>)rrrsrwrxZoptional_dependenciescSsi|]\}}|dur||�qSr]r)r|�k�vrrrr~�)
rLrh�_obtain_entry_points�_obtain_version�_obtain_readme�_obtain_classifiers�_obtain_dependencies�_obtain_optional_dependencies�itemsrN)rTr5rdZobtained_dynamicZupdatesrr}rrg�s�
�
z#_ConfigExpander._expand_all_dynamic)r5r[cCs2t||�}|dur.|js.d|�d�}t|��dS)Nz#No configuration found for dynamic z�.
Some dynamic fields need to be specified via `tool.setuptools.dynamic`
others must be specified via the equivalent attribute in `setup.py`.)rr8r
)rTr5r[Zprevious�msgrrr�_ensure_previously_sets

�z&_ConfigExpander._ensure_previously_set)�	specifierrdcCs�ddlm}t|j���|j}d|vrX|j�||d��t�|d|�Wd�Sd|vr�t�	|d||�Wd�St
d|�d|����Wd�n1s�0YdS)Nr)�always_iterabler�attrz	invalid `z`: )Z setuptools.extern.more_itertoolsr�rFr8rIrSrhr`Z
read_filesZ	read_attrr2)rTr��	directiverdr�rIrrr�_expand_directives 2z!_ConfigExpander._expand_directive)r5r[rdcCs4||jvr$|�d|��|j||�S|�||�dS)Nztool.setuptools.dynamic.)rPr�r�)rTr5r[rdrrrrzs
�z_ConfigExpander._obtaincCs,d|jvr(d|jvr(t�|�|d|��SdS)Nrr)rLrPr`rrrz)rTr5rdrrrr�)sz_ConfigExpander._obtain_version)r5rcCsLd|jvrdS|j}d|vr<|�|di�|d�dd�d�S|�|d�dS)Nrs�content-typez
text/x-rst)�textr�)rLrPrzr)r�)rTr5rPrrrr�/s
�z_ConfigExpander._obtain_readme)r5rdrcszd}t�fdd�|D��sdS��|d|�}|dur8dSt�|��d�i�ttd����fdd�}|dd	�|d
d��S)N)rtrurvc3s|]}|�jvVqdSr])rLr{�rTrr�	<genexpr>Ar�z7_ConfigExpander._obtain_entry_points.<locals>.<genexpr>rt)r[�groupcs8|�vr4��|�}|�jvr,tt�||���|�|<dSr])�poprLr
rr1)r[r��value�Zexpanded�groupsrTrr�_set_scriptsKs


z:_ConfigExpander._obtain_entry_points.<locals>._set_scriptsruZconsole_scriptsrvZgui_scripts)�anyrzr`Zentry_points�str)rTr5rd�fieldsr�r�rr�rr�=s


z$_ConfigExpander._obtain_entry_points)r5cCs(d|jvr$|�|di�}|r$|��SdS)Nrw)rLrz�
splitlines�rTr5r�rrrr�Ws

z#_ConfigExpander._obtain_classifierscCs(d|jvr$|�|di�}|r$t|�SdS)Nrx)rLrz�_parse_requirements_listr�rrrr�^s

z$_ConfigExpander._obtain_dependenciescsVd�jvrdSd�jvrF�jd}t|t�s0J��fdd�|��D�S��|d�dS)Nryc	s*i|]"\}}|t��d|��|i���qS)z.tool.setuptools.dynamic.optional-dependencies.)r�r�)r|r�r�r�rrr~ks���zA_ConfigExpander._obtain_optional_dependencies.<locals>.<dictcomp>)rLrPrmrpr�r�)rTr5Zoptional_dependencies_maprr�rr�es



�
z-_ConfigExpander._obtain_optional_dependencies)NFN)r_)�__name__�
__module__�__qualname__rprr�boolrUrYr�rr^rarrbrerrfrgr�r�rzr�rr�r�r�r�r�rrrrrJ�s:��
�
�rJcCsdd�|��D�S)NcSs&g|]}|��r|���d�s|�qS)�#)r.�
startswith)r|�linerrr�
<listcomp>zs�z,_parse_requirements_list.<locals>.<listcomp>)r�)r�rrrr�ys�r�)r8c
cs\|sdVdSz
dVWn>tyV}z&t�d|jj�d|���WYd}~n
d}~00dS)Nzignored error: z - )�	Exceptionr/r0�	__class__r�)r8r3rrrrF�s
rFcsDeZdZdeed��fdd�Zdd��fdd�Z�fd	d
�Z�ZS)rcr)�distributionrNrOcst��|�||_||_dSr])�superrU�_project_cfg�_setuptools_cfg)rTr�rNrO�r�rrrU�sz"_EnsurePackagesDiscovered.__init__rrVcs�|j|j}}|�di�}|�|jp&i�||_|j��|jjdurV|j	�
d�|j_|jdurl|�
d�|_|jdur�|�
d�|_t
���S)z�When entering the context, the values of ``packages``, ``py_modules`` and
        ``package_dir`` that are missing in ``dist`` are copied from ``setuptools_cfg``.
        rlNr-�
py-modulesrj)rQr�rErhrd�set_defaultsZ_ignore_ext_modules�metadatar-r�r)�
py_modulesrjr��	__enter__)rTr5Zcfgrdr�rrr��s


z#_EnsurePackagesDiscovered.__enter__cs4|j�d|jj�|j�d|jj�t��|||�S)z�When exiting the context, if values of ``packages``, ``py_modules`` and
        ``package_dir`` are missing in ``setuptools_cfg``, copy from ``dist``.
        rjr�)r�rErQrjr�r��__exit__)rT�exc_type�	exc_value�	tracebackr�rrr��sz"_EnsurePackagesDiscovered.__exit__)r�r�r�rprUr�r��
__classcell__rrr�rrc�s�rcc@seZdZdZdS)rBz``{subject}` in `pyproject.toml` is still *experimental* and likely to change in future releases.N)r�r�r�Z_SUMMARYrrrrrB�s�rB)F)TFN)NFN)1�__doc__Zloggingr>�
contextlibr�	functoolsr�typingrrrrrr	�_pathr�errorsrr
�warningsrr(rr`Z_apply_pyprojecttomlrrrr7rWrZtyping_extensionsrZ	getLoggerr�r/rpr r�r+r9r6rHrJr�rFZEnsurePackagesDiscoveredrcrBrrrr�<module>s^ 
����D��Y(

Youez - 2016 - github.com/yon3zu
LinuXploit