diff --git a/stubs/setuptools/@tests/stubtest_allowlist.txt b/stubs/setuptools/@tests/stubtest_allowlist.txt index edbcec809..5c04ce29b 100644 --- a/stubs/setuptools/@tests/stubtest_allowlist.txt +++ b/stubs/setuptools/@tests/stubtest_allowlist.txt @@ -3,6 +3,10 @@ pkg_resources.PathMetadata.egg_info pkg_resources.EggMetadata.loader pkg_resources.ZipProvider.loader +# Is a functools.partial, so stubtest says "is not a function" +setuptools.modified.newer_pairwise_group +setuptools._distutils._modified.newer_pairwise_group + # Dynamically created in __init__ setuptools._distutils.dist.Distribution.get_name setuptools._distutils.dist.Distribution.get_version @@ -117,18 +121,10 @@ setuptools._distutils.zosccompiler # Reexported from setuptools._distutils; problems should be fixed there distutils\..+ -# Is a functools.partial, so stubtest says "is not a function" -setuptools.dep_util.newer_pairwise_group -setuptools.modified.newer_pairwise_group -setuptools._distutils._modified.newer_pairwise_group - -# Private modules +# Private APIs setuptools.config._validate_pyproject.* setuptools.command.build_py.build_py.existing_egg_info_dir -# Loop variable leak -setuptools.sandbox.AbstractSandbox.name - # Other vendored code setuptools._vendor.* pkg_resources._vendor.* diff --git a/stubs/setuptools/METADATA.toml b/stubs/setuptools/METADATA.toml index e43d1d0f0..6d7b157b2 100644 --- a/stubs/setuptools/METADATA.toml +++ b/stubs/setuptools/METADATA.toml @@ -1,4 +1,4 @@ -version = "69.5.*" +version = "70.0.*" upstream_repository = "https://github.com/pypa/setuptools" [tool.stubtest] diff --git a/stubs/setuptools/pkg_resources/__init__.pyi b/stubs/setuptools/pkg_resources/__init__.pyi index 3e5ee9657..3e224ef60 100644 --- a/stubs/setuptools/pkg_resources/__init__.pyi +++ b/stubs/setuptools/pkg_resources/__init__.pyi @@ -1,3 +1,4 @@ +import sys import types import zipimport from _typeshed import BytesPath, Incomplete, StrOrBytesPath, StrPath, Unused @@ -174,13 +175,6 @@ class WorkingSet: def require(self, *requirements: _NestedStr) -> Sequence[Distribution]: ... def subscribe(self, callback: Callable[[Distribution], object], existing: bool = True) -> None: ... -working_set: WorkingSet -require = working_set.require -iter_entry_points = working_set.iter_entry_points -add_activation_listener = working_set.subscribe -run_script = working_set.run_script -run_main = run_script - class Environment: def __init__( self, search_path: Iterable[str] | None = None, platform: str | None = ..., python: str | None = ... @@ -289,16 +283,6 @@ class ResourceManager: def set_extraction_path(self, path: str) -> None: ... def cleanup_resources(self, force: bool = False) -> list[str]: ... -__resource_manager: ResourceManager # Doesn't exist at runtime -resource_exists = __resource_manager.resource_exists -resource_isdir = __resource_manager.resource_isdir -resource_filename = __resource_manager.resource_filename -resource_stream = __resource_manager.resource_stream -resource_string = __resource_manager.resource_string -resource_listdir = __resource_manager.resource_listdir -set_extraction_path = __resource_manager.set_extraction_path -cleanup_resources = __resource_manager.cleanup_resources - @overload def get_provider(moduleOrReq: str) -> IResourceProvider: ... @overload @@ -498,3 +482,25 @@ def normalize_path(filename: StrPath) -> str: ... def normalize_path(filename: BytesPath) -> bytes: ... class PkgResourcesDeprecationWarning(Warning): ... + +__resource_manager: ResourceManager # Doesn't exist at runtime +resource_exists = __resource_manager.resource_exists +resource_isdir = __resource_manager.resource_isdir +resource_filename = __resource_manager.resource_filename +resource_stream = __resource_manager.resource_stream +resource_string = __resource_manager.resource_string +resource_listdir = __resource_manager.resource_listdir +set_extraction_path = __resource_manager.set_extraction_path +cleanup_resources = __resource_manager.cleanup_resources + +working_set: WorkingSet +require = working_set.require +iter_entry_points = working_set.iter_entry_points +add_activation_listener = working_set.subscribe +run_script = working_set.run_script +run_main = run_script + +if sys.version_info >= (3, 10): + LOCALE_ENCODING: Final = "locale" +else: + LOCALE_ENCODING: Final = None diff --git a/stubs/setuptools/setuptools/command/build.pyi b/stubs/setuptools/setuptools/command/build.pyi index 6319600c1..a7e6dd804 100644 --- a/stubs/setuptools/setuptools/command/build.pyi +++ b/stubs/setuptools/setuptools/command/build.pyi @@ -2,8 +2,7 @@ from typing import Protocol from .._distutils.command.build import build as _build -class build(_build): - def get_sub_commands(self): ... +class build(_build): ... class SubCommand(Protocol): editable_mode: bool diff --git a/stubs/setuptools/setuptools/command/editable_wheel.pyi b/stubs/setuptools/setuptools/command/editable_wheel.pyi index c46064339..18d5bec23 100644 --- a/stubs/setuptools/setuptools/command/editable_wheel.pyi +++ b/stubs/setuptools/setuptools/command/editable_wheel.pyi @@ -1,4 +1,5 @@ from _typeshed import Incomplete, StrPath +from collections.abc import Iterator from enum import Enum from pathlib import Path from types import TracebackType @@ -63,6 +64,8 @@ class _TopLevelFinder: dist: Incomplete name: Incomplete def __init__(self, dist: Distribution, name: str) -> None: ... + def template_vars(self) -> tuple[str, str, dict[str, str], dict[str, list[str]]]: ... + def get_implementation(self) -> Iterator[tuple[str, bytes]]: ... def __call__(self, wheel: _WheelFile, files: list[str], mapping: dict[str, str]): ... def __enter__(self) -> Self: ... def __exit__( diff --git a/stubs/setuptools/setuptools/dep_util.pyi b/stubs/setuptools/setuptools/dep_util.pyi deleted file mode 100644 index 0891d9775..000000000 --- a/stubs/setuptools/setuptools/dep_util.pyi +++ /dev/null @@ -1 +0,0 @@ -from ._distutils._modified import newer_group as newer_group, newer_pairwise_group as newer_pairwise_group