Don't ignore missing stubs in setuptools (#10058)

This commit is contained in:
Avasam
2023-05-19 02:03:34 -04:00
committed by GitHub
parent 274f449edc
commit b5c9d8d677
41 changed files with 765 additions and 97 deletions

View File

@@ -2,24 +2,31 @@ from abc import abstractmethod
from collections.abc import Iterable, Mapping, Sequence
from typing import Any
from setuptools.depends import Require as Require
from setuptools.dist import Distribution as Distribution
from setuptools.extension import Extension as Extension
from setuptools.warnings import SetuptoolsDeprecationWarning as SetuptoolsDeprecationWarning
from ._distutils.cmd import Command as _Command
from .depends import Require as Require
from .discovery import _Path
from .dist import Distribution as Distribution
from .extension import Extension as Extension
from .warnings import SetuptoolsDeprecationWarning as SetuptoolsDeprecationWarning
__all__ = [
"setup",
"Distribution",
"Command",
"Extension",
"Require",
"SetuptoolsDeprecationWarning",
"find_packages",
"find_namespace_packages",
]
__version__: str
class PackageFinder:
@classmethod
def find(cls, where: str = ".", exclude: Iterable[str] = (), include: Iterable[str] = ("*",)) -> list[str]: ...
class PEP420PackageFinder(PackageFinder): ...
find_packages = PackageFinder.find
find_namespace_packages = PEP420PackageFinder.find
# Pytype fails with the following:
# find_packages = PackageFinder.find
# find_namespace_packages = PEP420PackageFinder.find
def find_packages(where: _Path = ".", exclude: Iterable[str] = (), include: Iterable[str] = ("*",)) -> list[str]: ...
def find_namespace_packages(where: _Path = ".", exclude: Iterable[str] = (), include: Iterable[str] = ("*",)) -> list[str]: ...
def setup(
*,
name: str = ...,

View File

@@ -0,0 +1,52 @@
from _typeshed import Incomplete
from ..cmd import Command
class bdist_rpm(Command):
description: str
user_options: Incomplete
boolean_options: Incomplete
negative_opt: Incomplete
bdist_base: Incomplete
rpm_base: Incomplete
dist_dir: Incomplete
python: Incomplete
fix_python: Incomplete
spec_only: Incomplete
binary_only: Incomplete
source_only: Incomplete
use_bzip2: Incomplete
distribution_name: Incomplete
group: Incomplete
release: Incomplete
serial: Incomplete
vendor: Incomplete
packager: Incomplete
doc_files: Incomplete
changelog: Incomplete
icon: Incomplete
prep_script: Incomplete
build_script: Incomplete
install_script: Incomplete
clean_script: Incomplete
verify_script: Incomplete
pre_install: Incomplete
post_install: Incomplete
pre_uninstall: Incomplete
post_uninstall: Incomplete
prep: Incomplete
provides: Incomplete
requires: Incomplete
conflicts: Incomplete
build_requires: Incomplete
obsoletes: Incomplete
keep_temp: int
use_rpm_opt_flags: int
rpm3_mode: int
no_autoreq: int
force_arch: Incomplete
quiet: int
def initialize_options(self) -> None: ...
def finalize_options(self) -> None: ...
def finalize_package_data(self) -> None: ...
def run(self) -> None: ...

View File

@@ -0,0 +1,30 @@
from _typeshed import Incomplete
from ..cmd import Command
def show_compilers() -> None: ...
class build(Command):
description: str
user_options: Incomplete
boolean_options: Incomplete
help_options: Incomplete
build_base: str
build_purelib: Incomplete
build_platlib: Incomplete
build_lib: Incomplete
build_temp: Incomplete
build_scripts: Incomplete
compiler: Incomplete
plat_name: Incomplete
debug: Incomplete
force: int
executable: Incomplete
parallel: Incomplete
def initialize_options(self) -> None: ...
def finalize_options(self) -> None: ...
def run(self) -> None: ...
def has_pure_modules(self): ...
def has_c_libraries(self): ...
def has_ext_modules(self): ...
def has_scripts(self): ...

View File

@@ -3,6 +3,16 @@ from typing import Any
from ._distutils.errors import DistutilsError
__all__ = [
"unpack_archive",
"unpack_zipfile",
"unpack_tarfile",
"default_filter",
"UnrecognizedFormat",
"extraction_drivers",
"unpack_directory",
]
class UnrecognizedFormat(DistutilsError): ...
def default_filter(src, dst): ...

View File

@@ -1,7 +1,20 @@
from collections.abc import Mapping
from typing import Any
from setuptools import dist
from . import dist
__all__ = [
"get_requires_for_build_sdist",
"get_requires_for_build_wheel",
"prepare_metadata_for_build_wheel",
"build_wheel",
"build_sdist",
"get_requires_for_build_editable",
"prepare_metadata_for_build_editable",
"build_editable",
"__legacy__",
"SetupRequirementsError",
]
class SetupRequirementsError(BaseException):
specifiers: Any
@@ -41,4 +54,8 @@ prepare_metadata_for_build_wheel = _BACKEND.prepare_metadata_for_build_wheel
build_wheel = _BACKEND.build_wheel
build_sdist = _BACKEND.build_sdist
get_requires_for_build_editable = _BACKEND.get_requires_for_build_editable
prepare_metadata_for_build_editable = _BACKEND.prepare_metadata_for_build_editable
build_editable = _BACKEND.build_editable
__legacy__: _BuildMetaLegacyBackend

View File

@@ -1,6 +1,6 @@
from typing import Any
from setuptools.command.setopt import option_base
from .setopt import option_base
def shquote(arg): ...

View File

@@ -0,0 +1,49 @@
from _typeshed import Incomplete
from collections.abc import Generator
from .. import Command
def strip_module(filename): ...
def sorted_walk(dir) -> Generator[Incomplete, None, None]: ...
def write_stub(resource, pyfile) -> None: ...
class bdist_egg(Command):
description: str
user_options: Incomplete
boolean_options: Incomplete
bdist_dir: Incomplete
plat_name: Incomplete
keep_temp: int
dist_dir: Incomplete
skip_build: int
egg_output: Incomplete
exclude_source_files: Incomplete
def initialize_options(self) -> None: ...
egg_info: Incomplete
def finalize_options(self) -> None: ...
def do_install_data(self) -> None: ...
def get_outputs(self): ...
def call_command(self, cmdname, **kw): ...
stubs: Incomplete
def run(self) -> None: ...
def zap_pyfiles(self) -> None: ...
def zip_safe(self): ...
def gen_header(self): ...
def copy_metadata_to(self, target_dir) -> None: ...
def get_ext_outputs(self): ...
NATIVE_EXTENSIONS: Incomplete
def walk_egg(egg_dir) -> Generator[Incomplete, None, None]: ...
def analyze_egg(egg_dir, stubs): ...
def write_safety_flag(egg_dir, safe) -> None: ...
safety_flags: Incomplete
def scan_module(egg_dir, base, name, stubs): ...
def iter_symbols(code) -> Generator[Incomplete, None, None]: ...
def can_scan(): ...
INSTALL_DIRECTORY_ATTRS: Incomplete
def make_zipfile(zip_filename, base_dir, verbose: int = 0, dry_run: int = 0, compress: bool = True, mode: str = "w"): ...

View File

@@ -0,0 +1,4 @@
from .._distutils.command import bdist_rpm as orig
class bdist_rpm(orig.bdist_rpm):
def run(self) -> None: ...

View File

@@ -0,0 +1,16 @@
from typing import Protocol
from .._distutils.command.build import build as _build
class build(_build):
def get_sub_commands(self): ...
class SubCommand(Protocol):
editable_mode: bool
build_lib: str
def initialize_options(self) -> None: ...
def finalize_options(self) -> None: ...
def run(self) -> None: ...
def get_source_files(self) -> list[str]: ...
def get_outputs(self) -> list[str]: ...
def get_output_mapping(self) -> dict[str, str]: ...

View File

@@ -1,5 +1,5 @@
from _typeshed import Incomplete
from typing import Any
from typing import Any, ClassVar
from .._distutils.command.build_ext import build_ext as _build_ext
@@ -11,6 +11,7 @@ def if_dl(s): ...
def get_abi3_suffix(): ...
class build_ext(_build_ext):
editable_mode: ClassVar[bool]
inplace: Any
def run(self) -> None: ...
def copy_extensions_to_source(self) -> None: ...
@@ -27,6 +28,7 @@ class build_ext(_build_ext):
def build_extension(self, ext) -> None: ...
def links_to_dynamic(self, ext): ...
def get_outputs(self): ...
def get_output_mapping(self) -> dict[str, str]: ...
def write_stub(self, output_dir, ext, compile: bool = False) -> None: ...
def link_shared_object(

View File

@@ -1,10 +1,12 @@
from typing import Any
from _typeshed import Incomplete
from typing import Any, ClassVar
from .._distutils.command import build_py as orig
def make_writable(target) -> None: ...
class build_py(orig.build_py):
editable_mode: ClassVar[bool]
package_data: Any
exclude_package_data: Any
def finalize_options(self) -> None: ...
@@ -12,9 +14,11 @@ class build_py(orig.build_py):
data_files: Any
def __getattr__(self, attr: str): ...
def build_module(self, module, module_file, package): ...
def get_data_files_without_manifest(self) -> list[tuple[Incomplete, Incomplete, Incomplete, list[Incomplete]]]: ...
def find_data_files(self, package, src_dir): ...
def build_package_data(self) -> None: ...
manifest_files: Any
def get_output_mapping(self) -> dict[str, str]: ...
def analyze_manifest(self) -> None: ...
def get_data_files(self) -> None: ...
def check_package(self, package, package_dir): ...

View File

@@ -1,7 +1,7 @@
from typing import Any
from setuptools import namespaces
from setuptools.command.easy_install import easy_install
from .. import namespaces
from .easy_install import easy_install
class develop(namespaces.DevelopInstaller, easy_install):
description: str

View File

@@ -1,10 +1,12 @@
from typing import Any
from typing import Any, ClassVar
from .._distutils.cmd import Command
class dist_info(Command):
description: str
user_options: Any
boolean_options: ClassVar[list[str]]
negative_opt: ClassVar[dict[str, str]]
egg_base: Any
def initialize_options(self) -> None: ...
def finalize_options(self) -> None: ...

View File

@@ -3,7 +3,10 @@ from collections.abc import Iterator
from typing import Any
from pkg_resources import Environment
from setuptools import Command, SetuptoolsDeprecationWarning
from .. import Command, SetuptoolsDeprecationWarning
__all__ = ["easy_install", "PthDistributions", "extract_wininst_cfg", "get_exe_prefixes"]
class easy_install(Command):
description: str

View File

@@ -0,0 +1,84 @@
from _typeshed import Incomplete
from enum import Enum
from pathlib import Path
from types import TracebackType
from typing import Protocol
from typing_extensions import Self, TypeAlias
from .. import Command, errors, namespaces
from ..dist import Distribution
from ..warnings import SetuptoolsWarning
# Actually from wheel.wheelfile import WheelFile
_WheelFile: TypeAlias = Incomplete
_Path: TypeAlias = str | Path
class _EditableMode(Enum):
STRICT: str
LENIENT: str
COMPAT: str
@classmethod
def convert(cls, mode: str | None) -> _EditableMode: ...
class editable_wheel(Command):
description: str
user_options: Incomplete
dist_dir: Incomplete
dist_info_dir: Incomplete
project_dir: Incomplete
mode: Incomplete
def initialize_options(self) -> None: ...
package_dir: Incomplete
def finalize_options(self) -> None: ...
def run(self) -> None: ...
class EditableStrategy(Protocol):
def __call__(self, wheel: _WheelFile, files: list[str], mapping: dict[str, str]) -> None: ...
def __enter__(self): ...
def __exit__(
self, _exc_type: type[BaseException] | None, _exc_value: BaseException | None, _traceback: TracebackType | None
) -> None: ...
class _StaticPth:
dist: Incomplete
name: Incomplete
path_entries: Incomplete
def __init__(self, dist: Distribution, name: str, path_entries: list[Path]) -> None: ...
def __call__(self, wheel: _WheelFile, files: list[str], mapping: dict[str, str]): ...
def __enter__(self) -> Self: ...
def __exit__(
self, _exc_type: type[BaseException] | None, _exc_value: BaseException | None, _traceback: TracebackType | None
) -> None: ...
class _LinkTree(_StaticPth):
auxiliary_dir: Incomplete
build_lib: Incomplete
def __init__(self, dist: Distribution, name: str, auxiliary_dir: _Path, build_lib: _Path) -> None: ...
def __call__(self, wheel: _WheelFile, files: list[str], mapping: dict[str, str]): ...
def __enter__(self) -> Self: ...
def __exit__(
self, _exc_type: type[BaseException] | None, _exc_value: BaseException | None, _traceback: TracebackType | None
) -> None: ...
class _TopLevelFinder:
dist: Incomplete
name: Incomplete
def __init__(self, dist: Distribution, name: str) -> None: ...
def __call__(self, wheel: _WheelFile, files: list[str], mapping: dict[str, str]): ...
def __enter__(self) -> Self: ...
def __exit__(
self, _exc_type: type[BaseException] | None, _exc_value: BaseException | None, _traceback: TracebackType | None
) -> None: ...
class _NamespaceInstaller(namespaces.Installer):
distribution: Incomplete
src_root: Incomplete
installation_dir: Incomplete
editable_name: Incomplete
outputs: Incomplete
dry_run: bool
def __init__(self, distribution, installation_dir, editable_name, src_root) -> None: ...
class InformationOnly(SetuptoolsWarning): ...
class LinksNotSupported(errors.FileError): ...
class _DebuggingTips(SetuptoolsWarning): ...

View File

@@ -1,9 +1,11 @@
from typing import Any
from typing_extensions import Final
from setuptools import Command, SetuptoolsDeprecationWarning
from setuptools.command.sdist import sdist
from .. import Command, SetuptoolsDeprecationWarning
from .._distutils.filelist import FileList as _FileList
from .sdist import sdist
PY_MAJOR: Final[str]
def translate_pattern(glob): ...

View File

@@ -1,6 +1,6 @@
from typing import Any
from setuptools import Command, namespaces
from .. import Command, namespaces
class install_egg_info(namespaces.Installer, Command):
description: str

View File

@@ -1,6 +1,6 @@
from typing import Any
from setuptools import Command
from .. import Command
class rotate(Command):
description: str

View File

@@ -1,4 +1,4 @@
from setuptools.command.setopt import option_base
from .setopt import option_base
class saveopts(option_base):
description: str

View File

@@ -1,7 +1,9 @@
from abc import abstractmethod
from typing import Any
from setuptools import Command
from .. import Command
__all__ = ["config_file", "edit_config", "option_base", "setopt"]
def config_file(kind: str = "local"): ...
def edit_config(filename, settings, dry_run: bool = False) -> None: ...

View File

@@ -5,7 +5,7 @@ from typing import Any, Generic, TypeVar, overload
from typing_extensions import Self
from unittest import TestLoader, TestSuite
from setuptools import Command
from .. import Command
_T = TypeVar("_T")

View File

@@ -1,2 +0,0 @@
def read_configuration(filepath, find_others: bool = False, ignore_option_errors: bool = False): ...
def parse_configuration(distribution, command_options, ignore_option_errors: bool = False): ...

View File

@@ -0,0 +1,9 @@
from _typeshed import Incomplete
from collections.abc import Callable
from typing import TypeVar
Fn = TypeVar("Fn", bound=Callable[..., Incomplete]) # noqa: Y001 # Exists at runtime
__all__ = ("parse_configuration", "read_configuration")
def read_configuration(filepath, find_others: bool = False, ignore_option_errors: bool = False): ...
def parse_configuration(distribution, command_options, ignore_option_errors: bool = False): ...

View File

@@ -0,0 +1,53 @@
import os
from _typeshed import Incomplete
from collections.abc import Callable, Iterable, Iterator, Mapping
from importlib.machinery import ModuleSpec
from types import TracebackType
from typing import TypeVar
from typing_extensions import Self, TypeAlias
from ..dist import Distribution
chain_iter: Incomplete
_Path: TypeAlias = str | os.PathLike[Incomplete]
_K = TypeVar("_K")
_VCo = TypeVar("_VCo", covariant=True)
class StaticModule:
def __init__(self, name: str, spec: ModuleSpec) -> None: ...
def __getattr__(self, attr): ...
def glob_relative(patterns: Iterable[str], root_dir: _Path | None = None) -> list[str]: ...
def read_files(filepaths: str | bytes | Iterable[_Path], root_dir: Incomplete | None = None) -> str: ...
def read_attr(attr_desc: str, package_dir: Mapping[str, str] | None = None, root_dir: _Path | None = None): ...
def resolve_class(
qualified_class_name: str, package_dir: Mapping[str, str] | None = None, root_dir: _Path | None = None
) -> Callable[..., Incomplete]: ...
def cmdclass(
values: dict[str, str], package_dir: Mapping[str, str] | None = None, root_dir: _Path | None = None
) -> dict[str, Callable[..., Incomplete]]: ...
def find_packages(
*, namespaces: bool = True, fill_package_dir: dict[str, str] | None = None, root_dir: _Path | None = None, **kwargs
) -> list[str]: ...
def version(value: Callable[..., Incomplete] | Iterable[str | int] | str) -> str: ...
def canonic_package_data(package_data: dict[Incomplete, Incomplete]) -> dict[Incomplete, Incomplete]: ...
def canonic_data_files(
data_files: list[Incomplete] | dict[Incomplete, Incomplete], root_dir: _Path | None = None
) -> list[tuple[str, list[str]]]: ...
def entry_points(text: str, text_source: str = "entry-points") -> dict[str, dict[Incomplete, Incomplete]]: ...
class EnsurePackagesDiscovered:
def __init__(self, distribution: Distribution) -> None: ...
def __call__(self) -> None: ...
def __enter__(self) -> Self: ...
def __exit__(
self, _exc_type: type[BaseException] | None, _exc_value: BaseException | None, _traceback: TracebackType | None
) -> None: ...
@property
def package_dir(self) -> Mapping[str, str]: ...
class LazyMappingProxy(Mapping[_K, _VCo]):
def __init__(self, obtain_mapping_value: Callable[[], Mapping[_K, _VCo]]) -> None: ...
def __getitem__(self, key: _K) -> _VCo: ...
def __len__(self) -> int: ...
def __iter__(self) -> Iterator[_K]: ...

View File

@@ -0,0 +1,52 @@
import os
from _typeshed import Incomplete
from types import TracebackType
from typing_extensions import Self, TypeAlias
from ..dist import Distribution
from ..warnings import SetuptoolsWarning
from . import expand
_Path: TypeAlias = str | os.PathLike[Incomplete]
def load_file(filepath: _Path) -> dict[Incomplete, Incomplete]: ...
def validate(config: dict[Incomplete, Incomplete], filepath: _Path) -> bool: ...
def apply_configuration(dist: Distribution, filepath: _Path, ignore_option_errors: bool = False) -> Distribution: ...
def read_configuration(
filepath: _Path, expand: bool = True, ignore_option_errors: bool = False, dist: Distribution | None = None
): ...
def expand_configuration(
config: dict[Incomplete, Incomplete],
root_dir: _Path | None = None,
ignore_option_errors: bool = False,
dist: Distribution | None = None,
) -> dict[Incomplete, Incomplete]: ...
class _ConfigExpander:
config: Incomplete
root_dir: Incomplete
project_cfg: Incomplete
dynamic: Incomplete
setuptools_cfg: Incomplete
dynamic_cfg: Incomplete
ignore_option_errors: Incomplete
def __init__(
self,
config: dict[Incomplete, Incomplete],
root_dir: _Path | None = None,
ignore_option_errors: bool = False,
dist: Distribution | None = None,
) -> None: ...
def expand(self): ...
class _EnsurePackagesDiscovered(expand.EnsurePackagesDiscovered):
def __init__(
self, distribution: Distribution, project_cfg: dict[Incomplete, Incomplete], setuptools_cfg: dict[Incomplete, Incomplete]
) -> None: ...
def __enter__(self) -> Self: ...
def __exit__(
self, exc_type: type[BaseException] | None, exc_value: BaseException | None, traceback: TracebackType | None
): ...
class _BetaConfiguration(SetuptoolsWarning): ...
class _InvalidFile(SetuptoolsWarning): ...

View File

@@ -0,0 +1,83 @@
import os
from _typeshed import Incomplete
from typing import Generic, TypeVar
from typing_extensions import TypeAlias
from .._distutils.dist import DistributionMetadata
from ..dist import Distribution
from . import expand
_Path: TypeAlias = str | os.PathLike[Incomplete]
SingleCommandOptions: Incomplete
AllCommandOptions: Incomplete
Target = TypeVar("Target", bound=Distribution | DistributionMetadata) # noqa: Y001 # Exists at runtime
def read_configuration(
filepath: _Path, find_others: bool = False, ignore_option_errors: bool = False
) -> dict[Incomplete, Incomplete]: ...
def apply_configuration(dist: Distribution, filepath: _Path) -> Distribution: ...
def configuration_to_dict(
handlers: tuple[ConfigHandler[Distribution | DistributionMetadata], ...]
) -> dict[Incomplete, Incomplete]: ...
def parse_configuration(
distribution: Distribution, command_options: AllCommandOptions, ignore_option_errors: bool = False
) -> tuple[ConfigMetadataHandler, ConfigOptionsHandler]: ...
class ConfigHandler(Generic[Target]):
section_prefix: str
aliases: dict[str, str]
ignore_option_errors: Incomplete
target_obj: Incomplete
sections: Incomplete
set_options: Incomplete
ensure_discovered: Incomplete
def __init__(
self,
target_obj: Target,
options: AllCommandOptions,
ignore_option_errors,
ensure_discovered: expand.EnsurePackagesDiscovered,
) -> None: ...
@property
def parsers(self) -> None: ...
def __setitem__(self, option_name, value): ...
def parse_section(self, section_options) -> None: ...
def parse(self) -> None: ...
class ConfigMetadataHandler(ConfigHandler[DistributionMetadata]):
section_prefix: str
aliases: Incomplete
strict_mode: bool
package_dir: Incomplete
root_dir: Incomplete
def __init__(
self,
target_obj: DistributionMetadata,
options: AllCommandOptions,
ignore_option_errors: bool,
ensure_discovered: expand.EnsurePackagesDiscovered,
package_dir: dict[Incomplete, Incomplete] | None = None,
root_dir: _Path = ".",
) -> None: ...
@property
def parsers(self): ...
class ConfigOptionsHandler(ConfigHandler[Distribution]):
section_prefix: str
root_dir: Incomplete
package_dir: Incomplete
def __init__(
self,
target_obj: Distribution,
options: AllCommandOptions,
ignore_option_errors: bool,
ensure_discovered: expand.EnsurePackagesDiscovered,
) -> None: ...
@property
def parsers(self): ...
def parse_section_packages__find(self, section_options): ...
def parse_section_entry_points(self, section_options) -> None: ...
def parse_section_package_data(self, section_options) -> None: ...
def parse_section_exclude_package_data(self, section_options) -> None: ...
def parse_section_extras_require(self, section_options): ...
def parse_section_data_files(self, section_options) -> None: ...

View File

@@ -1,4 +1,12 @@
from _typeshed import Incomplete
from typing import IO, Any
from typing_extensions import Literal
__all__ = ["Require", "find_module", "get_module_constant", "extract_constant"]
def find_module(
module, paths=None
) -> tuple[IO[Any], str | None, tuple[str, Literal["", "r", "rb"], Literal[7, 6, 1, 2, 3, -1]]]: ...
class Require:
def __init__(

View File

@@ -0,0 +1,45 @@
import os
from _typeshed import Incomplete
from collections.abc import Iterable, Iterator, Mapping
from typing_extensions import TypeAlias
from . import Distribution
_Path: TypeAlias = str | os.PathLike[Incomplete]
StrIter: TypeAlias = Iterator[str]
chain_iter: Incomplete
class _Filter:
def __init__(self, *patterns: str) -> None: ...
def __call__(self, item: str) -> bool: ...
def __contains__(self, item: str) -> bool: ...
class _Finder:
ALWAYS_EXCLUDE: tuple[str, ...]
DEFAULT_EXCLUDE: tuple[str, ...]
@classmethod
def find(cls, where: _Path = ".", exclude: Iterable[str] = (), include: Iterable[str] = ("*",)) -> list[str]: ...
class PackageFinder(_Finder):
ALWAYS_EXCLUDE: Incomplete
class PEP420PackageFinder(PackageFinder): ...
class ModuleFinder(_Finder): ...
class FlatLayoutPackageFinder(PEP420PackageFinder):
DEFAULT_EXCLUDE: Incomplete
class FlatLayoutModuleFinder(ModuleFinder):
DEFAULT_EXCLUDE: Incomplete
class ConfigDiscovery:
dist: Incomplete
def __init__(self, distribution: Distribution) -> None: ...
def __call__(self, force: bool = False, name: bool = True, ignore_ext_modules: bool = False) -> None: ...
def analyse_name(self) -> None: ...
def remove_nested_packages(packages: list[str]) -> list[str]: ...
def remove_stubs(packages: list[str]) -> list[str]: ...
def find_parent_package(packages: list[str], package_dir: Mapping[str, str], root_dir: _Path) -> str | None: ...
def find_package_path(name: str, package_dir: Mapping[str, str], root_dir: _Path) -> str: ...
def construct_package_dir(packages: list[str], package_path: _Path) -> dict[str, str]: ...

View File

@@ -1,10 +1,11 @@
from collections.abc import Iterable, Iterator, Mapping, MutableMapping
from typing import Any
from setuptools import Command, SetuptoolsDeprecationWarning
from . import Command, SetuptoolsDeprecationWarning
from ._distutils.dist import Distribution as _Distribution
__all__ = ["Distribution"]
class Distribution(_Distribution):
def patch_missing_pkg_info(self, attrs: Mapping[str, Any]) -> None: ...
src_root: str | None

View File

@@ -1,3 +1,5 @@
__all__ = ["glob", "iglob", "escape"]
def glob(pathname, recursive: bool = False): ...
def iglob(pathname, recursive: bool = False): ...
def escape(pathname): ...

View File

@@ -0,0 +1,2 @@
def configure() -> None: ...
def set_threshold(level): ...

View File

@@ -4,6 +4,8 @@ from typing import Any
from pkg_resources import Environment
__all__ = ["PackageIndex", "distros_for_url", "parse_bdist_wininst", "interpret_distro_name"]
def parse_bdist_wininst(name): ...
def distros_for_url(url, metadata: Incomplete | None = None) -> None: ...
def interpret_distro_name(

View File

@@ -0,0 +1,3 @@
from _typeshed import Incomplete, StrOrBytesPath
def shutil_rmtree(path: StrOrBytesPath, ignore_errors: bool = False, onexc: Incomplete | None = None) -> None: ...

View File

@@ -1,15 +1,18 @@
import sys
from types import TracebackType
from typing import Any
from typing_extensions import Literal
from typing_extensions import Literal, Self
from ._distutils.errors import DistutilsError
__all__ = ["AbstractSandbox", "DirectorySandbox", "SandboxViolation", "run_setup"]
class UnpickleableException(Exception):
@staticmethod
def dump(type, exc): ...
class ExceptionSaver:
def __enter__(self): ...
def __enter__(self) -> Self: ...
def __exit__(
self, type: type[BaseException] | None, exc: BaseException | None, tb: TracebackType | None
) -> Literal[True] | None: ...
@@ -23,12 +26,40 @@ class AbstractSandbox:
self, exc_type: type[BaseException] | None, exc_value: BaseException | None, traceback: TracebackType | None
) -> None: ...
def run(self, func): ...
# Dynamically created
if sys.platform == "win32":
def startfile(self, path, *args, **kw): ...
else:
def chown(self, path, *args, **kw): ...
def chroot(self, path, *args, **kw): ...
def lchown(self, path, *args, **kw): ...
def mkfifo(self, path, *args, **kw): ...
def mknod(self, path, *args, **kw): ...
def pathconf(self, path, *args, **kw): ...
def access(self, path, *args, **kw): ...
def chdir(self, path, *args, **kw): ...
def chmod(self, path, *args, **kw): ...
def getcwd(self, *args, **kw): ...
def link(self, src, dst, *args, **kw): ...
def listdir(self, path, *args, **kw): ...
def lstat(self, path, *args, **kw): ...
def mkdir(self, path, *args, **kw): ...
def open(self, path, *args, **kw): ...
def readlink(self, path, *args, **kw): ...
def remove(self, path, *args, **kw): ...
def rename(self, src, dst, *args, **kw): ...
def rmdir(self, path, *args, **kw): ...
def stat(self, path, *args, **kw): ...
def symlink(self, src, dst, *args, **kw): ...
def unlink(self, path, *args, **kw): ...
def utime(self, path, *args, **kw): ...
class DirectorySandbox(AbstractSandbox):
write_ops: Any
def __init__(self, sandbox, exceptions=...) -> None: ...
def tmpnam(self) -> None: ...
def open(self, file, flags, mode: int = 511, *args, **kw): ...
def open(self, file, flags, mode: int = 511, *args, **kw): ... # type:ignore[override]
class SandboxViolation(DistutilsError):
tmpl: Any

View File

@@ -1,9 +1,11 @@
from collections.abc import Generator
from typing import Any
WHEEL_NAME: Any
NAMESPACE_PACKAGE_INIT: str
def unpack(src_dir, dst_dir) -> None: ...
def disable_info_traces() -> Generator[None, None, None]: ...
class Wheel:
filename: Any