File: //opt/saltstack/salt/lib/python3.10/site-packages/setuptools/__pycache__/discovery.cpython-310.pyc
o
�N�g�R � @ s� d Z ddlZddlZddlmZ ddlmZ ddlmZ ddlm Z m
Z
mZmZm
Z
mZmZmZmZ ddlZddlmZ ddlmZ eeejf Zee ZejjZe rYdd lm Z d
ede!fdd
�Z"G dd� d�Z#G dd� d�Z$G dd� de$�Z%G dd� de%�Z&G dd� de$�Z'G dd� de&�Z(G dd� de'�Z)dedede
e fdd�Z*G d d!� d!�Z+d"e
e de
e fd#d$�Z,d"e
e de
e fd%d&�Z-d"e
e d'eeef d(edee fd)d*�Z.d+ed'eeef d(edefd,d-�Z/d"e
e d.ede
eef fd/d0�Z0dS )1u_ 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
� N��fnmatchcase)�glob)�Path) �
TYPE_CHECKING�Dict�Iterable�Iterator�List�Mapping�Optional�Tuple�Union)�log)�convert_path)�Distribution�path�returnc C s t j�| ��� S �N)�osr �basename�isidentifier)r � r �H/opt/saltstack/salt/lib/python3.10/site-packages/setuptools/discovery.py�_valid_nameG s r c @ sB e Zd ZdZdefdd�Zdedefdd�Zdedefd d
�ZdS )�_Filterz�
Given a list of patterns, create a callable that will be true only if
the input matches at least one of the patterns.
�patternsc G s t �|�| _d S r )�dict�fromkeys� _patterns)�selfr r r r �__init__R s z_Filter.__init__�itemr c s t � fdd�| jD ��S )Nc 3 s � | ]}t � |�V qd S r r )�.0�pat�r"