Skip to content

Commit 5243d30

Browse files
authored
Bump setuptools to 75.3.* (#12928)
1 parent 84dfa4a commit 5243d30

14 files changed

+43
-30
lines changed

stubs/setuptools/METADATA.toml

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

stubs/setuptools/setuptools/__init__.pyi

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ from .dist import Distribution as Distribution
3131
from .extension import Extension as Extension
3232
from .warnings import SetuptoolsDeprecationWarning as SetuptoolsDeprecationWarning
3333

34-
_CommandT = TypeVar("_CommandT", bound=Command)
34+
_CommandT = TypeVar("_CommandT", bound=_Command)
3535

3636
__all__ = [
3737
"setup",

stubs/setuptools/setuptools/build_meta.pyi

+4-2
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class _BuildMetaBackend:
3232
def run_setup(self, setup_script: str = "setup.py") -> None: ...
3333
def get_requires_for_build_wheel(self, config_settings: _ConfigSettings = None) -> list[str]: ...
3434
def get_requires_for_build_sdist(self, config_settings: _ConfigSettings = None) -> list[str]: ...
35-
def prepare_metadata_for_build_wheel(self, metadata_directory: str, config_settings: _ConfigSettings = None) -> str: ...
35+
def prepare_metadata_for_build_wheel(self, metadata_directory: StrPath, config_settings: _ConfigSettings = None) -> str: ...
3636
def build_wheel(
3737
self, wheel_directory: StrPath, config_settings: _ConfigSettings = None, metadata_directory: StrPath | None = None
3838
) -> str: ...
@@ -41,7 +41,9 @@ class _BuildMetaBackend:
4141
self, wheel_directory: StrPath, config_settings: _ConfigSettings = None, metadata_directory: StrPath | None = None
4242
) -> str: ...
4343
def get_requires_for_build_editable(self, config_settings: _ConfigSettings = None) -> list[str]: ...
44-
def prepare_metadata_for_build_editable(self, metadata_directory: str, config_settings: _ConfigSettings = None) -> str: ...
44+
def prepare_metadata_for_build_editable(
45+
self, metadata_directory: StrPath, config_settings: _ConfigSettings = None
46+
) -> str: ...
4547

4648
class _BuildMetaLegacyBackend(_BuildMetaBackend):
4749
def run_setup(self, setup_script: str = "setup.py") -> None: ...

stubs/setuptools/setuptools/command/bdist_egg.pyi

+12-4
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
1-
from _typeshed import Incomplete
1+
from _typeshed import Incomplete, StrPath
22
from collections.abc import Generator
3-
from typing import ClassVar, Final
3+
from typing import ClassVar, Final, TypeVar
4+
from zipfile import _ZipFileMode
45

56
from .. import Command
67

8+
_StrPathT = TypeVar("_StrPathT", bound=StrPath)
9+
710
def strip_module(filename): ...
811
def sorted_walk(dir) -> Generator[Incomplete, None, None]: ...
912
def write_stub(resource, pyfile) -> None: ...
@@ -48,5 +51,10 @@ def can_scan(): ...
4851
INSTALL_DIRECTORY_ATTRS: Final[list[str]]
4952

5053
def make_zipfile(
51-
zip_filename, base_dir, verbose: bool = False, dry_run: bool = False, compress: bool = True, mode: str = "w"
52-
): ...
54+
zip_filename: _StrPathT,
55+
base_dir,
56+
verbose: bool = False,
57+
dry_run: bool = False,
58+
compress: bool = True,
59+
mode: _ZipFileMode = "w",
60+
) -> _StrPathT: ...

stubs/setuptools/setuptools/command/bdist_wheel.pyi

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ class bdist_wheel(Command):
4040
owner: Incomplete | None
4141
group: Incomplete | None
4242
universal: bool
43-
compression: int | str
43+
compression: str | int
4444
python_tag: str
4545
build_number: str | None
4646
py_limited_api: str | Literal[False]

stubs/setuptools/setuptools/command/build_py.pyi

+2-2
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 typing import ClassVar
33

44
from setuptools.dist import Distribution
@@ -21,7 +21,7 @@ class build_py(orig.build_py):
2121
preserve_mode: bool = True,
2222
preserve_times: bool = True,
2323
link: str | None = None,
24-
level: int = 1,
24+
level: Unused = 1,
2525
) -> tuple[_StrPathT | str, bool]: ...
2626
def run(self) -> None: ...
2727
data_files: list[tuple[Incomplete, Incomplete, Incomplete, list[Incomplete]]]

stubs/setuptools/setuptools/command/editable_wheel.pyi

+2-2
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,11 @@ class editable_wheel(Command):
3333
def run(self) -> None: ...
3434

3535
class EditableStrategy(Protocol):
36-
def __call__(self, wheel: _WheelFile, files: list[str], mapping: Mapping[str, str]) -> None: ...
36+
def __call__(self, wheel: _WheelFile, files: list[str], mapping: Mapping[str, str]) -> Unused: ...
3737
def __enter__(self) -> Self: ...
3838
def __exit__(
3939
self, _exc_type: type[BaseException] | None, _exc_value: BaseException | None, _traceback: TracebackType | None
40-
) -> None: ...
40+
) -> Unused: ...
4141

4242
class _StaticPth:
4343
dist: Distribution

stubs/setuptools/setuptools/command/install.pyi

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ class install(orig.install):
1111
user_options: ClassVar[list[tuple[str, str | None, str]]]
1212
boolean_options: ClassVar[list[str]]
1313
# Any to work around variance issues
14-
new_commands: list[tuple[str, Callable[[Any], bool]] | None]
14+
new_commands: ClassVar[list[tuple[str, Callable[[Any], bool]] | None]]
1515
old_and_unmanageable: Incomplete
1616
single_version_externally_managed: bool | None
1717
def initialize_options(self) -> None: ...

stubs/setuptools/setuptools/config/expand.pyi

+5-5
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ from typing_extensions import Self
88
from ..dist import Distribution
99

1010
_K = TypeVar("_K")
11-
_VCo = TypeVar("_VCo", covariant=True)
11+
_V_co = TypeVar("_V_co", covariant=True)
1212

1313
class StaticModule:
1414
def __init__(self, name: str, spec: ModuleSpec) -> None: ...
@@ -31,7 +31,7 @@ def canonic_package_data(package_data: dict[Incomplete, Incomplete]) -> dict[Inc
3131
def canonic_data_files(
3232
data_files: list[Incomplete] | dict[Incomplete, Incomplete], root_dir: StrPath | None = None
3333
) -> list[tuple[str, list[str]]]: ...
34-
def entry_points(text: str, text_source: str = "entry-points") -> dict[str, dict[Incomplete, Incomplete]]: ...
34+
def entry_points(text: str, text_source: str = "entry-points") -> dict[str, dict[str, str]]: ...
3535

3636
class EnsurePackagesDiscovered:
3737
def __init__(self, distribution: Distribution) -> None: ...
@@ -43,8 +43,8 @@ class EnsurePackagesDiscovered:
4343
@property
4444
def package_dir(self) -> Mapping[str, str]: ...
4545

46-
class LazyMappingProxy(Mapping[_K, _VCo]):
47-
def __init__(self, obtain_mapping_value: Callable[[], Mapping[_K, _VCo]]) -> None: ...
48-
def __getitem__(self, key: _K) -> _VCo: ...
46+
class LazyMappingProxy(Mapping[_K, _V_co]):
47+
def __init__(self, obtain_mapping_value: Callable[[], Mapping[_K, _V_co]]) -> None: ...
48+
def __getitem__(self, key: _K) -> _V_co: ...
4949
def __len__(self) -> int: ...
5050
def __iter__(self) -> Iterator[_K]: ...

stubs/setuptools/setuptools/config/setupcfg.pyi

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
from _typeshed import Incomplete, StrPath
2+
from collections.abc import Iterable
23
from typing import Any, ClassVar, Generic, TypeVar
34
from typing_extensions import TypeAlias
45

@@ -8,14 +9,14 @@ from . import expand
89

910
SingleCommandOptions: TypeAlias = dict[str, tuple[str, Any]]
1011
AllCommandOptions: TypeAlias = dict[str, SingleCommandOptions]
11-
Target = TypeVar("Target", bound=Distribution | DistributionMetadata) # noqa: Y001 # Exists at runtime
12+
Target = TypeVar("Target", Distribution, DistributionMetadata) # noqa: Y001 # Exists at runtime
1213

1314
def read_configuration(
1415
filepath: StrPath, find_others: bool = False, ignore_option_errors: bool = False
1516
) -> dict[Incomplete, Incomplete]: ...
1617
def apply_configuration(dist: Distribution, filepath: StrPath) -> Distribution: ...
1718
def configuration_to_dict(
18-
handlers: tuple[ConfigHandler[Distribution | DistributionMetadata], ...]
19+
handlers: Iterable[ConfigHandler[Distribution] | ConfigHandler[DistributionMetadata]],
1920
) -> dict[Incomplete, Incomplete]: ...
2021
def parse_configuration(
2122
distribution: Distribution, command_options: AllCommandOptions, ignore_option_errors: bool = False
@@ -47,15 +48,15 @@ class ConfigMetadataHandler(ConfigHandler[DistributionMetadata]):
4748
aliases: ClassVar[dict[str, str]]
4849
strict_mode: bool
4950
package_dir: dict[Incomplete, Incomplete] | None
50-
root_dir: StrPath
51+
root_dir: StrPath | None
5152
def __init__(
5253
self,
5354
target_obj: DistributionMetadata,
5455
options: AllCommandOptions,
5556
ignore_option_errors: bool,
5657
ensure_discovered: expand.EnsurePackagesDiscovered,
5758
package_dir: dict[Incomplete, Incomplete] | None = None,
58-
root_dir: StrPath = ".",
59+
root_dir: StrPath | None = ".",
5960
) -> None: ...
6061
@property
6162
def parsers(self): ...

stubs/setuptools/setuptools/discovery.pyi

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
import itertools
22
from _typeshed import Incomplete, StrPath
3-
from collections.abc import Iterable, Iterator, Mapping
3+
from collections.abc import Iterable, Mapping
44
from typing import ClassVar
5-
from typing_extensions import TypeAlias
65

76
from . import Distribution
87

9-
StrIter: TypeAlias = Iterator[str]
108
chain_iter = itertools.chain.from_iterable
119

1210
class _Filter:

stubs/setuptools/setuptools/dist.pyi

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ from collections.abc import Iterable, Iterator, MutableMapping
33
from typing import Literal, TypeVar, overload
44

55
from . import Command, SetuptoolsDeprecationWarning
6+
from ._distutils.cmd import Command as _Command
67
from ._distutils.dist import Distribution as _Distribution
78
from .command.alias import alias
89
from .command.bdist_egg import bdist_egg
@@ -26,7 +27,7 @@ from .command.saveopts import saveopts
2627
from .command.sdist import sdist
2728
from .command.setopt import setopt
2829

29-
_CommandT = TypeVar("_CommandT", bound=Command)
30+
_CommandT = TypeVar("_CommandT", bound=_Command)
3031

3132
__all__ = ["Distribution"]
3233

stubs/setuptools/setuptools/extension.pyi

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
from _typeshed import StrPath
2+
13
from ._distutils.extension import Extension as _Extension
24

35
def have_pyrex() -> bool: ...
@@ -7,7 +9,7 @@ class Extension(_Extension):
79
def __init__(
810
self,
911
name: str,
10-
sources: list[str],
12+
sources: list[StrPath],
1113
include_dirs: list[str] | None = None,
1214
define_macros: list[tuple[str, str | None]] | None = None,
1315
undef_macros: list[str] | None = None,

stubs/setuptools/setuptools/sandbox.pyi

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import sys
2-
from _typeshed import Unused
32
from types import TracebackType
43
from typing import ClassVar, Literal
54
from typing_extensions import Self
@@ -23,7 +22,9 @@ def run_setup(setup_script, args): ...
2322

2423
class AbstractSandbox:
2524
def __enter__(self) -> None: ...
26-
def __exit__(self, exc_type: Unused, exc_value: Unused, traceback: Unused) -> None: ...
25+
def __exit__(
26+
self, exc_type: type[BaseException] | None, exc_value: BaseException | None, traceback: TracebackType | None
27+
) -> None: ...
2728
def run(self, func): ...
2829
# Dynamically created
2930
if sys.platform == "win32":

0 commit comments

Comments
 (0)