Skip to content

Commit 661fe27

Browse files
authored
Bump setuptools to 74.0.* (#12599)
1 parent 1a59cc2 commit 661fe27

File tree

13 files changed

+34
-173
lines changed

13 files changed

+34
-173
lines changed

stubs/setuptools/@tests/stubtest_allowlist.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,6 @@ setuptools._distutils.dir_util
111111
setuptools._distutils.fancy_getopt
112112
setuptools._distutils.file_util
113113
setuptools._distutils.log
114-
setuptools._distutils.msvc9compiler
115-
setuptools._distutils.msvccompiler
116114
setuptools._distutils.spawn
117115
setuptools._distutils.text_file
118116
setuptools._distutils.unixccompiler

stubs/setuptools/METADATA.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
version = "73.0.*"
1+
version = "74.0.*"
22
upstream_repository = "https://github.com/pypa/setuptools"
33
extra_description = """\
44
If using `setuptools >= 71.1` *only* for `pkg_resources`,

stubs/setuptools/pkg_resources/__init__.pyi

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,10 @@ def fixup_namespace_packages(path_item: str, parent: str | None = None) -> None:
115115

116116
class WorkingSet:
117117
entries: list[str]
118+
entry_keys: dict[str | None, list[str]]
119+
by_key: dict[str, Distribution]
120+
normalized_to_canonical_keys: dict[str, str]
121+
callbacks: list[Callable[[Distribution], object]]
118122
def __init__(self, entries: Iterable[str] | None = None) -> None: ...
119123
def add_entry(self, entry: str) -> None: ...
120124
def __contains__(self, dist: Distribution) -> bool: ...
@@ -428,6 +432,7 @@ class Distribution(NullProvider):
428432
def requires(self, extras: Iterable[str] = ()) -> list[Requirement]: ...
429433
def activate(self, path: list[str] | None = None, replace: bool = False) -> None: ...
430434
def egg_name(self) -> str: ... # type: ignore[override] # supertype's egg_name is a variable, not a method
435+
def __getattr__(self, attr: str) -> Any: ... # Delegate all unrecognized public attributes to .metadata provider
431436
@classmethod
432437
def from_filename(cls, filename: StrPath, metadata: _MetadataType = None, *, precedence: int = 3) -> Distribution: ...
433438
def as_requirement(self) -> Requirement: ...

stubs/setuptools/setuptools/command/easy_install.pyi

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
from _typeshed import Incomplete
2-
from collections.abc import Iterable, Iterator
3-
from typing import Any, ClassVar, Literal, TypedDict, type_check_only
2+
from collections.abc import Callable, Iterable, Iterator
3+
from typing import Any, ClassVar, Literal, TypedDict, TypeVar, type_check_only
44
from typing_extensions import Self
55

66
from pkg_resources import Environment
77
from setuptools.package_index import PackageIndex
88

99
from .. import Command, SetuptoolsDeprecationWarning
1010

11+
_T = TypeVar("_T")
12+
1113
__all__ = ["easy_install", "PthDistributions", "extract_wininst_cfg", "get_exe_prefixes"]
1214

1315
class easy_install(Command):
@@ -112,6 +114,8 @@ class RewritePthDistributions(PthDistributions):
112114
prelude: str
113115
postlude: str
114116

117+
# Must match shutil._OnExcCallback
118+
def auto_chmod(func: Callable[..., _T], arg: str, exc: BaseException) -> _T: ...
115119
@type_check_only
116120
class _SplitArgs(TypedDict, total=False):
117121
comments: bool

stubs/setuptools/setuptools/command/editable_wheel.pyi

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from _typeshed import Incomplete, StrPath
1+
from _typeshed import Incomplete, StrPath, Unused
22
from collections.abc import Iterator, Mapping
33
from enum import Enum
44
from pathlib import Path
@@ -34,7 +34,7 @@ class editable_wheel(Command):
3434

3535
class EditableStrategy(Protocol):
3636
def __call__(self, wheel: _WheelFile, files: list[str], mapping: Mapping[str, str]) -> None: ...
37-
def __enter__(self): ...
37+
def __enter__(self) -> Self: ...
3838
def __exit__(
3939
self, _exc_type: type[BaseException] | None, _exc_value: BaseException | None, _traceback: TracebackType | None
4040
) -> None: ...
@@ -46,19 +46,15 @@ class _StaticPth:
4646
def __init__(self, dist: Distribution, name: str, path_entries: list[Path]) -> None: ...
4747
def __call__(self, wheel: _WheelFile, files: list[str], mapping: Mapping[str, str]): ...
4848
def __enter__(self) -> Self: ...
49-
def __exit__(
50-
self, _exc_type: type[BaseException] | None, _exc_value: BaseException | None, _traceback: TracebackType | None
51-
) -> None: ...
49+
def __exit__(self, _exc_type: Unused, _exc_value: Unused, _traceback: Unused) -> None: ...
5250

5351
class _LinkTree(_StaticPth):
5452
auxiliary_dir: Path
5553
build_lib: Path
5654
def __init__(self, dist: Distribution, name: str, auxiliary_dir: StrPath, build_lib: StrPath) -> None: ...
5755
def __call__(self, wheel: _WheelFile, files: list[str], mapping: Mapping[str, str]): ...
5856
def __enter__(self) -> Self: ...
59-
def __exit__(
60-
self, _exc_type: type[BaseException] | None, _exc_value: BaseException | None, _traceback: TracebackType | None
61-
) -> None: ...
57+
def __exit__(self, _exc_type: Unused, _exc_value: Unused, _traceback: Unused) -> None: ...
6258

6359
class _TopLevelFinder:
6460
dist: Distribution
@@ -68,9 +64,7 @@ class _TopLevelFinder:
6864
def get_implementation(self) -> Iterator[tuple[str, bytes]]: ...
6965
def __call__(self, wheel: _WheelFile, files: list[str], mapping: Mapping[str, str]): ...
7066
def __enter__(self) -> Self: ...
71-
def __exit__(
72-
self, _exc_type: type[BaseException] | None, _exc_value: BaseException | None, _traceback: TracebackType | None
73-
) -> None: ...
67+
def __exit__(self, _exc_type: Unused, _exc_value: Unused, _traceback: Unused) -> None: ...
7468

7569
class _NamespaceInstaller(namespaces.Installer):
7670
distribution: Incomplete

stubs/setuptools/setuptools/command/egg_info.pyi

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@ class manifest_maker(sdist):
7070
def warn(self, msg) -> None: ...
7171
def add_defaults(self) -> None: ...
7272
def add_license_files(self) -> None: ...
73-
def prune_file_list(self) -> None: ...
7473

7574
def write_file(filename, contents) -> None: ...
7675
def write_pkg_info(cmd, basename, filename) -> None: ...

stubs/setuptools/setuptools/command/sdist.pyi

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ class sdist(orig.sdist):
1717
def run(self) -> None: ...
1818
def initialize_options(self) -> None: ...
1919
def make_distribution(self) -> None: ...
20+
def prune_file_list(self) -> None: ...
2021
def check_readme(self) -> None: ...
2122
def make_release_tree(self, base_dir, files) -> None: ...
2223
def read_manifest(self) -> None: ...

stubs/setuptools/setuptools/config/expand.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ class EnsurePackagesDiscovered:
3838
def __call__(self) -> None: ...
3939
def __enter__(self) -> Self: ...
4040
def __exit__(
41-
self, _exc_type: type[BaseException] | None, _exc_value: BaseException | None, _traceback: TracebackType | None
41+
self, exc_type: type[BaseException] | None, exc_value: BaseException | None, traceback: TracebackType | None
4242
) -> None: ...
4343
@property
4444
def package_dir(self) -> Mapping[str, str]: ...

stubs/setuptools/setuptools/config/pyprojecttoml.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ class _EnsurePackagesDiscovered(expand.EnsurePackagesDiscovered):
4444
def __enter__(self) -> Self: ...
4545
def __exit__(
4646
self, exc_type: type[BaseException] | None, exc_value: BaseException | None, traceback: TracebackType | None
47-
): ...
47+
) -> None: ...
4848

4949
class _BetaConfiguration(SetuptoolsWarning): ...
5050
class _InvalidFile(SetuptoolsWarning): ...

stubs/setuptools/setuptools/monkey.pyi

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
1-
from typing import TypeVar
1+
from types import FunctionType
2+
from typing import TypeVar, overload
23

34
_T = TypeVar("_T")
4-
5+
_UnpatchT = TypeVar("_UnpatchT", type, FunctionType)
56
__all__: list[str] = []
67

7-
def get_unpatched(item: _T) -> _T: ...
8-
def get_unpatched_class(cls): ...
8+
@overload
9+
def get_unpatched(item: _UnpatchT) -> _UnpatchT: ... # type: ignore[overload-overlap]
10+
@overload
11+
def get_unpatched(item: object) -> None: ...
12+
def get_unpatched_class(cls: type[_T]) -> type[_T]: ...
913
def patch_all() -> None: ...
1014
def patch_func(replacement, target_mod, func_name) -> None: ...
1115
def get_unpatched_function(candidate): ...
12-
def patch_for_msvc_specialized_compiler(): ...

stubs/setuptools/setuptools/msvc.pyi

Lines changed: 0 additions & 141 deletions
This file was deleted.

stubs/setuptools/setuptools/package_index.pyi

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ from _typeshed import Incomplete
44
from hashlib import _Hash
55
from re import Pattern
66
from typing import ClassVar
7+
from typing_extensions import NamedTuple
78

89
from pkg_resources import Environment
910

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

86-
class Credential:
87-
username: Incomplete
88-
password: Incomplete
89-
def __init__(self, username, password) -> None: ...
90-
def __iter__(self): ...
87+
class Credential(NamedTuple):
88+
username: str
89+
password: str
9190

9291
class PyPIConfig(configparser.RawConfigParser):
9392
def __init__(self) -> None: ...

stubs/setuptools/setuptools/sandbox.pyi

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import sys
2+
from _typeshed import Unused
23
from types import TracebackType
34
from typing import ClassVar, Literal
45
from typing_extensions import Self
@@ -22,9 +23,7 @@ def run_setup(setup_script, args): ...
2223

2324
class AbstractSandbox:
2425
def __enter__(self) -> None: ...
25-
def __exit__(
26-
self, exc_type: type[BaseException] | None, exc_value: BaseException | None, traceback: TracebackType | None
27-
) -> None: ...
26+
def __exit__(self, exc_type: Unused, exc_value: Unused, traceback: Unused) -> None: ...
2827
def run(self, func): ...
2928
# Dynamically created
3029
if sys.platform == "win32":

0 commit comments

Comments
 (0)