_iC d Z ddlZddlZddlmZ ddlmZ ddlmZm Z m Z mZmZm Z mZ ddlmZmZ ddlmZ d d lmZ d dlmZmZ d dlmZ erdd lmZ eeej> f Z ejB e" Z#de de$fdZ%de$de de&fdZ' d"ddde ddfdZ( d#de ded fdZ) d$de$dee de&ded de$f dZ* G d d Z+d Z,ede&fd Z- G d dej\ Z/ G d d!e Z0y)%ac 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_CHECKINGCallableDictMappingOptionalSetUnion ) FileErrorInvalidConfigError)SetuptoolsWarning )expand)_PREVIOUSLY_DEFINED_MissingDynamic)applyDistributionfilepathreturnc t ddl m} t | d 5 }|j | cd d d S # 1 sw Y y xY w)Nr )tomlirb)setuptools.externr openload)r r files /builddir/build/BUILDROOT/alt-python312-setuptools-69.0.2-3.el8.x86_64/opt/alt/python312/lib/python3.12/site-packages/setuptools/config/pyprojecttoml.py load_filer! s) ' h zz$ s .7configc ddl m} |j j d }t |d r|j |j | S # |j $ r}d|j }|j j d dk7 r4t j | t j |j d|j d }t | d | d d }~ww xY w)Nr )_validate_pyprojectztrove-classifier_disable_downloadzconfiguration error: `projectzinvalid pyproject.toml config: . ) r$ FORMAT_FUNCTIONSgethasattrr% validateValidationErrorsummarynamestrip_loggerdebugdetails ValueError)r" r validatortrove_classifierexr0 errors r r. r. % s 2 11556HI!45**, :!!&))$$ :)"**6 77==*MM'"MM"**%1"''!<E7"WI./T9:s A C&BC!!C&distr c 8 t |d|| }t | || S )zeApply the configuration from a ``pyproject.toml`` file into an existing distribution object. T)read_configuration_apply)r; r ignore_option_errorsr" s r apply_configurationr@ : s$ $0Dd KF$)) c t j j | } t j j | st d| d t | xs i }|j di }|j di }|j di }|r|s|si S d|v rt j d |r*t |d d |j d|j n|j dd ||d<