File: //usr/local/lib/python3.7/site-packages/setuptools/config/__pycache__/setupcfg.cpython-37.pyc
B
N��gHf � @ s$ d Z ddlZddlZddlZddlmZ ddlmZ ddlmZ ddlm Z m
Z
mZmZm
Z
mZmZmZmZmZmZmZ ddlmZmZ dd lmZ dd
lmZmZ ddlmZ ddl m!Z!m"Z" dd
l#m$Z$ ddl%m&Z& e r�ddl'm(Z( ddl)m*Z* ee+ej,f Z-ededef f Z.ede.f Z/eded d�Z0d;e-e1d�dd�Z2de-dd�dd�Z3d<de-ee- e4ed d �d!d"�Z5e0e+d#�d$d%�Z6ed e1d&�d'd(�Z7d=de/ed) d*�d+d,�Z8e+e+e9d-�d.d/�Z:G d0d1� d1e
e0 �Z;G d2d3� d3e;d4 �Z<G d5d6� d6e;d �Z=G d7d8� d8e$�Z>G d9d:� 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� )� FileError�OptionError)�default_environment)�InvalidRequirement�Requirement)�SpecifierSet)�InvalidVersion�Version)�SetuptoolsDeprecationWarning� )�expand)�DistributionMetadata)�Distribution�str�Target)r r )�boundF)�filepath�returnc C s8 ddl m} |� }|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
r )r )�setuptools.distr �find_config_files�_apply�configuration_to_dict)r"