Edit File: expand.cpython-311.pyc
� u�d@ � �, � d Z ddlZddlZddlZddlZddlZddlZddlmZ ddl m Z ddlmZ ddl mZ ddlmZmZmZmZmZmZmZmZmZmZmZmZ ddlmZ dd lmZ dd lm Z ddl!m"Z# dd l$m%Z% erddl&m'Z' ddl(m)Z) ddl*m+Z+ ej, Z-ee.ej/ f Z0 ed� � Z1 edd�� � Z2 G d� d� � Z3 dAdee. dee0 dee. fd�Z4dAdee.e5ee0 f de.fd�Z6dee0 dee0 fd�Z7dee5e0f de.fd�Z8de0de.fd �Z9 dBd!e.d"eee.e.f dee0 fd#�Z:d$e.d%ee0 defd&�Z;d'ed$e.defd(�Z<d$e.d"eee.e.f de0dee0ee. e.f fd)�Z= dBd*e.d"eee.e.f dee0 defd+�Z> dBd,ee.e.f d"eee.e.f dee0 dee.ef fd-�Z?dddd.�d/eee.e.f dee0 dee. fd0�Z@d1e0d2e0de.fd3�ZAd4eeeee.eBf e.f de.fd5�ZCd6eDdeDfd7�ZE dAd8eeFeDf dee0 deee.ee. f fd9�ZGdCd;e.dee.eDf fd<�ZH G d=� d>� � ZI G d?� d@ee1e2f � � ZJdS )Dai Utility functions to expand configuration directives or special values (such glob patterns). We can split the process of interpreting configuration files into 2 steps: 1. The parsing the file contents from strings to value objects that can be understand by Python (for example a string with a comma separated list of keywords into an actual Python list of strings). 2. The expansion (or post-processing) of these values according to the semantics ``setuptools`` assign to them (for example a configuration field with the ``file:`` directive should be expanded from a list of file paths to a single string with the contents of those files concatenated) This module focus on the second step, and therefore allow sharing the expansion functions among several configuration file formats. **PRIVATE MODULE**: API reserved for setuptools internal usage only. � N)�iglob)�ConfigParser)� ModuleSpec)�chain)� TYPE_CHECKING�Callable�Dict�Iterable�Iterator�List�Mapping�Optional�Tuple�TypeVar�Union�cast)�Path)� ModuleType)�DistutilsOptionError� )� same_path)�SetuptoolsWarning)�Distribution)�ConfigDiscovery)�DistributionMetadata�_K�_VT)� covariantc �d � e Zd ZdZdedefd�Zdeee j e j f fd�Zd� ZdS ) �StaticModulez>Proxy to a module object that avoids executing arbitrary code.�name�specc �� � t j t j |j � � � � � � � }t | � � � t � � � � | ` d S �N) �ast�parse�pathlibr �origin� read_bytes�vars�update�locals�self)r- r! r"