Skip to content

Commit

Permalink
Bump setuptools to 74.0.* (#12599)
Browse files Browse the repository at this point in the history
  • Loading branch information
Avasam committed Aug 29, 2024
1 parent 1a59cc2 commit 661fe27
Show file tree
Hide file tree
Showing 13 changed files with 34 additions and 173 deletions.
2 changes: 0 additions & 2 deletions stubs/setuptools/@tests/stubtest_allowlist.txt
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,6 @@ setuptools._distutils.dir_util
setuptools._distutils.fancy_getopt
setuptools._distutils.file_util
setuptools._distutils.log
setuptools._distutils.msvc9compiler
setuptools._distutils.msvccompiler
setuptools._distutils.spawn
setuptools._distutils.text_file
setuptools._distutils.unixccompiler
Expand Down
2 changes: 1 addition & 1 deletion stubs/setuptools/METADATA.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version = "73.0.*"
version = "74.0.*"
upstream_repository = "https://github.com/pypa/setuptools"
extra_description = """\
If using `setuptools >= 71.1` *only* for `pkg_resources`,
Expand Down
5 changes: 5 additions & 0 deletions stubs/setuptools/pkg_resources/__init__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,10 @@ def fixup_namespace_packages(path_item: str, parent: str | None = None) -> None:

class WorkingSet:
entries: list[str]
entry_keys: dict[str | None, list[str]]
by_key: dict[str, Distribution]
normalized_to_canonical_keys: dict[str, str]
callbacks: list[Callable[[Distribution], object]]
def __init__(self, entries: Iterable[str] | None = None) -> None: ...
def add_entry(self, entry: str) -> None: ...
def __contains__(self, dist: Distribution) -> bool: ...
Expand Down Expand Up @@ -428,6 +432,7 @@ class Distribution(NullProvider):
def requires(self, extras: Iterable[str] = ()) -> list[Requirement]: ...
def activate(self, path: list[str] | None = None, replace: bool = False) -> None: ...
def egg_name(self) -> str: ... # type: ignore[override] # supertype's egg_name is a variable, not a method
def __getattr__(self, attr: str) -> Any: ... # Delegate all unrecognized public attributes to .metadata provider
@classmethod
def from_filename(cls, filename: StrPath, metadata: _MetadataType = None, *, precedence: int = 3) -> Distribution: ...
def as_requirement(self) -> Requirement: ...
Expand Down
8 changes: 6 additions & 2 deletions stubs/setuptools/setuptools/command/easy_install.pyi
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
from _typeshed import Incomplete
from collections.abc import Iterable, Iterator
from typing import Any, ClassVar, Literal, TypedDict, type_check_only
from collections.abc import Callable, Iterable, Iterator
from typing import Any, ClassVar, Literal, TypedDict, TypeVar, type_check_only
from typing_extensions import Self

from pkg_resources import Environment
from setuptools.package_index import PackageIndex

from .. import Command, SetuptoolsDeprecationWarning

_T = TypeVar("_T")

__all__ = ["easy_install", "PthDistributions", "extract_wininst_cfg", "get_exe_prefixes"]

class easy_install(Command):
Expand Down Expand Up @@ -112,6 +114,8 @@ class RewritePthDistributions(PthDistributions):
prelude: str
postlude: str

# Must match shutil._OnExcCallback
def auto_chmod(func: Callable[..., _T], arg: str, exc: BaseException) -> _T: ...
@type_check_only
class _SplitArgs(TypedDict, total=False):
comments: bool
Expand Down
16 changes: 5 additions & 11 deletions stubs/setuptools/setuptools/command/editable_wheel.pyi
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from _typeshed import Incomplete, StrPath
from _typeshed import Incomplete, StrPath, Unused
from collections.abc import Iterator, Mapping
from enum import Enum
from pathlib import Path
Expand Down Expand Up @@ -34,7 +34,7 @@ class editable_wheel(Command):

class EditableStrategy(Protocol):
def __call__(self, wheel: _WheelFile, files: list[str], mapping: Mapping[str, str]) -> None: ...
def __enter__(self): ...
def __enter__(self) -> Self: ...
def __exit__(
self, _exc_type: type[BaseException] | None, _exc_value: BaseException | None, _traceback: TracebackType | None
) -> None: ...
Expand All @@ -46,19 +46,15 @@ class _StaticPth:
def __init__(self, dist: Distribution, name: str, path_entries: list[Path]) -> None: ...
def __call__(self, wheel: _WheelFile, files: list[str], mapping: Mapping[str, str]): ...
def __enter__(self) -> Self: ...
def __exit__(
self, _exc_type: type[BaseException] | None, _exc_value: BaseException | None, _traceback: TracebackType | None
) -> None: ...
def __exit__(self, _exc_type: Unused, _exc_value: Unused, _traceback: Unused) -> None: ...

class _LinkTree(_StaticPth):
auxiliary_dir: Path
build_lib: Path
def __init__(self, dist: Distribution, name: str, auxiliary_dir: StrPath, build_lib: StrPath) -> None: ...
def __call__(self, wheel: _WheelFile, files: list[str], mapping: Mapping[str, str]): ...
def __enter__(self) -> Self: ...
def __exit__(
self, _exc_type: type[BaseException] | None, _exc_value: BaseException | None, _traceback: TracebackType | None
) -> None: ...
def __exit__(self, _exc_type: Unused, _exc_value: Unused, _traceback: Unused) -> None: ...

class _TopLevelFinder:
dist: Distribution
Expand All @@ -68,9 +64,7 @@ class _TopLevelFinder:
def get_implementation(self) -> Iterator[tuple[str, bytes]]: ...
def __call__(self, wheel: _WheelFile, files: list[str], mapping: Mapping[str, str]): ...
def __enter__(self) -> Self: ...
def __exit__(
self, _exc_type: type[BaseException] | None, _exc_value: BaseException | None, _traceback: TracebackType | None
) -> None: ...
def __exit__(self, _exc_type: Unused, _exc_value: Unused, _traceback: Unused) -> None: ...

class _NamespaceInstaller(namespaces.Installer):
distribution: Incomplete
Expand Down
1 change: 0 additions & 1 deletion stubs/setuptools/setuptools/command/egg_info.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ class manifest_maker(sdist):
def warn(self, msg) -> None: ...
def add_defaults(self) -> None: ...
def add_license_files(self) -> None: ...
def prune_file_list(self) -> None: ...

def write_file(filename, contents) -> None: ...
def write_pkg_info(cmd, basename, filename) -> None: ...
Expand Down
1 change: 1 addition & 0 deletions stubs/setuptools/setuptools/command/sdist.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ class sdist(orig.sdist):
def run(self) -> None: ...
def initialize_options(self) -> None: ...
def make_distribution(self) -> None: ...
def prune_file_list(self) -> None: ...
def check_readme(self) -> None: ...
def make_release_tree(self, base_dir, files) -> None: ...
def read_manifest(self) -> None: ...
2 changes: 1 addition & 1 deletion stubs/setuptools/setuptools/config/expand.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class EnsurePackagesDiscovered:
def __call__(self) -> None: ...
def __enter__(self) -> Self: ...
def __exit__(
self, _exc_type: type[BaseException] | None, _exc_value: BaseException | None, _traceback: TracebackType | None
self, exc_type: type[BaseException] | None, exc_value: BaseException | None, traceback: TracebackType | None
) -> None: ...
@property
def package_dir(self) -> Mapping[str, str]: ...
Expand Down
2 changes: 1 addition & 1 deletion stubs/setuptools/setuptools/config/pyprojecttoml.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class _EnsurePackagesDiscovered(expand.EnsurePackagesDiscovered):
def __enter__(self) -> Self: ...
def __exit__(
self, exc_type: type[BaseException] | None, exc_value: BaseException | None, traceback: TracebackType | None
): ...
) -> None: ...

class _BetaConfiguration(SetuptoolsWarning): ...
class _InvalidFile(SetuptoolsWarning): ...
13 changes: 8 additions & 5 deletions stubs/setuptools/setuptools/monkey.pyi
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
from typing import TypeVar
from types import FunctionType
from typing import TypeVar, overload

_T = TypeVar("_T")

_UnpatchT = TypeVar("_UnpatchT", type, FunctionType)
__all__: list[str] = []

def get_unpatched(item: _T) -> _T: ...
def get_unpatched_class(cls): ...
@overload
def get_unpatched(item: _UnpatchT) -> _UnpatchT: ... # type: ignore[overload-overlap]
@overload
def get_unpatched(item: object) -> None: ...
def get_unpatched_class(cls: type[_T]) -> type[_T]: ...
def patch_all() -> None: ...
def patch_func(replacement, target_mod, func_name) -> None: ...
def get_unpatched_function(candidate): ...
def patch_for_msvc_specialized_compiler(): ...
141 changes: 0 additions & 141 deletions stubs/setuptools/setuptools/msvc.pyi

This file was deleted.

9 changes: 4 additions & 5 deletions stubs/setuptools/setuptools/package_index.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ from _typeshed import Incomplete
from hashlib import _Hash
from re import Pattern
from typing import ClassVar
from typing_extensions import NamedTuple

from pkg_resources import Environment

Expand Down Expand Up @@ -83,11 +84,9 @@ class PackageIndex(Environment):
def info(self, msg, *args) -> None: ...
def warn(self, msg, *args) -> None: ...

class Credential:
username: Incomplete
password: Incomplete
def __init__(self, username, password) -> None: ...
def __iter__(self): ...
class Credential(NamedTuple):
username: str
password: str

class PyPIConfig(configparser.RawConfigParser):
def __init__(self) -> None: ...
Expand Down
5 changes: 2 additions & 3 deletions stubs/setuptools/setuptools/sandbox.pyi
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import sys
from _typeshed import Unused
from types import TracebackType
from typing import ClassVar, Literal
from typing_extensions import Self
Expand All @@ -22,9 +23,7 @@ def run_setup(setup_script, args): ...

class AbstractSandbox:
def __enter__(self) -> None: ...
def __exit__(
self, exc_type: type[BaseException] | None, exc_value: BaseException | None, traceback: TracebackType | None
) -> None: ...
def __exit__(self, exc_type: Unused, exc_value: Unused, traceback: Unused) -> None: ...
def run(self, func): ...
# Dynamically created
if sys.platform == "win32":
Expand Down

0 comments on commit 661fe27

Please sign in to comment.