�
�S�g
S � �� � d Z ddlmZ ddlZddlZddlmZmZmZ ddl m
Z
ddlmZ ddlm
Z
ddlmZmZ ddlZd d
lmZ ddlmZ ddlmZ erdd
lmZ ej6 j8 Zd%d�Z G d� d� Z G d� d� Z G d� de � Z! G d� de!� Z" G d� de � Z# G d� de"� Z$ G d� de#� Z%d&d�Z& G d� d� Z'd'd �Z(d'd!�Z) d(d"�Z* d)d#�Z+d*d$�Z,y)+u_ Automatic discovery of Python modules and packages (for inclusion in the
distribution) and other config values.
For the purposes of this module, the following nomenclature is used:
- "src-layout": a directory representing a Python project that contains a "src"
folder. Everything under the "src" folder is meant to be included in the
distribution when packaging the project. Example::
.
├── tox.ini
├── pyproject.toml
└── src/
└── mypkg/
├── __init__.py
├── mymodule.py
└── my_data_file.txt
- "flat-layout": a Python project that does not use "src-layout" but instead
have a directory under the project root for each package::
.
├── tox.ini
├── pyproject.toml
└── mypkg/
├── __init__.py
├── mymodule.py
└── my_data_file.txt
- "single-module": a project that contains a single Python script direct under
the project root (no directory used)::
.
├── tox.ini
├── pyproject.toml
└── mymodule.py
� )�annotationsN)�Iterable�Iterator�Mapping��fnmatchcase)�glob)�Path)�
TYPE_CHECKING�ClassVar� )�StrPath)�log)�convert_path)�Distributionc �\ � t j j | � j � S �N)�os�path�basename�isidentifier)r s ��/build/snapcraft-certbot-29b1212f749eeba2f1dece1adfe9a83a/parts/certbot/install/lib/python3.12/site-packages/setuptools/discovery.py�_valid_namer ? s � �
�7�7���D�!�.�.�0�0� c �( � e Zd ZdZdd�Zdd�Zdd�Zy)�_Filterz�
Given a list of patterns, create a callable that will be true only if
the input matches at least one of the patterns.
c �8 � t j |� | _ y r )�dict�fromkeys� _patterns)�self�patternss r �__init__z_Filter.__init__J s � ����x�0��r c �@ �� t �fd�| j D � � S )Nc 3 �6 �K � | ] }t �|� �� � y �wr r )�.0�pat�items �r � <genexpr>z#_Filter.__call__.<locals>.<genexpr>N s �� �� �D�c�;�t�S�)�D�s �)�anyr �r! r( s `r �__call__z_Filter.__call__M s �� ��D�T�^�^�D�D�Dr c � � || j v S r )r r+ s r �__contains__z_Filter.__contains__P s � ��t�~�~�%�%r N)r" |