Skip to content

Commit

Permalink
Bump setuptools to 75.3.* (#12928)
Browse files Browse the repository at this point in the history
  • Loading branch information
Avasam authored Nov 4, 2024
1 parent 84dfa4a commit 5243d30
Show file tree
Hide file tree
Showing 14 changed files with 43 additions and 30 deletions.
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 = "75.2.*"
version = "75.3.*"
upstream_repository = "https://github.com/pypa/setuptools"
extra_description = """\
If using `setuptools >= 71.1` *only* for `pkg_resources`,
Expand Down
2 changes: 1 addition & 1 deletion stubs/setuptools/setuptools/__init__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ from .dist import Distribution as Distribution
from .extension import Extension as Extension
from .warnings import SetuptoolsDeprecationWarning as SetuptoolsDeprecationWarning

_CommandT = TypeVar("_CommandT", bound=Command)
_CommandT = TypeVar("_CommandT", bound=_Command)

__all__ = [
"setup",
Expand Down
6 changes: 4 additions & 2 deletions stubs/setuptools/setuptools/build_meta.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class _BuildMetaBackend:
def run_setup(self, setup_script: str = "setup.py") -> None: ...
def get_requires_for_build_wheel(self, config_settings: _ConfigSettings = None) -> list[str]: ...
def get_requires_for_build_sdist(self, config_settings: _ConfigSettings = None) -> list[str]: ...
def prepare_metadata_for_build_wheel(self, metadata_directory: str, config_settings: _ConfigSettings = None) -> str: ...
def prepare_metadata_for_build_wheel(self, metadata_directory: StrPath, config_settings: _ConfigSettings = None) -> str: ...
def build_wheel(
self, wheel_directory: StrPath, config_settings: _ConfigSettings = None, metadata_directory: StrPath | None = None
) -> str: ...
Expand All @@ -41,7 +41,9 @@ class _BuildMetaBackend:
self, wheel_directory: StrPath, config_settings: _ConfigSettings = None, metadata_directory: StrPath | None = None
) -> str: ...
def get_requires_for_build_editable(self, config_settings: _ConfigSettings = None) -> list[str]: ...
def prepare_metadata_for_build_editable(self, metadata_directory: str, config_settings: _ConfigSettings = None) -> str: ...
def prepare_metadata_for_build_editable(
self, metadata_directory: StrPath, config_settings: _ConfigSettings = None
) -> str: ...

class _BuildMetaLegacyBackend(_BuildMetaBackend):
def run_setup(self, setup_script: str = "setup.py") -> None: ...
Expand Down
16 changes: 12 additions & 4 deletions stubs/setuptools/setuptools/command/bdist_egg.pyi
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
from _typeshed import Incomplete
from _typeshed import Incomplete, StrPath
from collections.abc import Generator
from typing import ClassVar, Final
from typing import ClassVar, Final, TypeVar
from zipfile import _ZipFileMode

from .. import Command

_StrPathT = TypeVar("_StrPathT", bound=StrPath)

def strip_module(filename): ...
def sorted_walk(dir) -> Generator[Incomplete, None, None]: ...
def write_stub(resource, pyfile) -> None: ...
Expand Down Expand Up @@ -48,5 +51,10 @@ def can_scan(): ...
INSTALL_DIRECTORY_ATTRS: Final[list[str]]

def make_zipfile(
zip_filename, base_dir, verbose: bool = False, dry_run: bool = False, compress: bool = True, mode: str = "w"
): ...
zip_filename: _StrPathT,
base_dir,
verbose: bool = False,
dry_run: bool = False,
compress: bool = True,
mode: _ZipFileMode = "w",
) -> _StrPathT: ...
2 changes: 1 addition & 1 deletion stubs/setuptools/setuptools/command/bdist_wheel.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class bdist_wheel(Command):
owner: Incomplete | None
group: Incomplete | None
universal: bool
compression: int | str
compression: str | int
python_tag: str
build_number: str | None
py_limited_api: str | Literal[False]
Expand Down
4 changes: 2 additions & 2 deletions stubs/setuptools/setuptools/command/build_py.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 typing import ClassVar

from setuptools.dist import Distribution
Expand All @@ -21,7 +21,7 @@ class build_py(orig.build_py):
preserve_mode: bool = True,
preserve_times: bool = True,
link: str | None = None,
level: int = 1,
level: Unused = 1,
) -> tuple[_StrPathT | str, bool]: ...
def run(self) -> None: ...
data_files: list[tuple[Incomplete, Incomplete, Incomplete, list[Incomplete]]]
Expand Down
4 changes: 2 additions & 2 deletions stubs/setuptools/setuptools/command/editable_wheel.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@ class editable_wheel(Command):
def run(self) -> None: ...

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

class _StaticPth:
dist: Distribution
Expand Down
2 changes: 1 addition & 1 deletion stubs/setuptools/setuptools/command/install.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class install(orig.install):
user_options: ClassVar[list[tuple[str, str | None, str]]]
boolean_options: ClassVar[list[str]]
# Any to work around variance issues
new_commands: list[tuple[str, Callable[[Any], bool]] | None]
new_commands: ClassVar[list[tuple[str, Callable[[Any], bool]] | None]]
old_and_unmanageable: Incomplete
single_version_externally_managed: bool | None
def initialize_options(self) -> None: ...
Expand Down
10 changes: 5 additions & 5 deletions stubs/setuptools/setuptools/config/expand.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ from typing_extensions import Self
from ..dist import Distribution

_K = TypeVar("_K")
_VCo = TypeVar("_VCo", covariant=True)
_V_co = TypeVar("_V_co", covariant=True)

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

class EnsurePackagesDiscovered:
def __init__(self, distribution: Distribution) -> None: ...
Expand All @@ -43,8 +43,8 @@ class EnsurePackagesDiscovered:
@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: ...
class LazyMappingProxy(Mapping[_K, _V_co]):
def __init__(self, obtain_mapping_value: Callable[[], Mapping[_K, _V_co]]) -> None: ...
def __getitem__(self, key: _K) -> _V_co: ...
def __len__(self) -> int: ...
def __iter__(self) -> Iterator[_K]: ...
9 changes: 5 additions & 4 deletions stubs/setuptools/setuptools/config/setupcfg.pyi
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from _typeshed import Incomplete, StrPath
from collections.abc import Iterable
from typing import Any, ClassVar, Generic, TypeVar
from typing_extensions import TypeAlias

Expand All @@ -8,14 +9,14 @@ from . import expand

SingleCommandOptions: TypeAlias = dict[str, tuple[str, Any]]
AllCommandOptions: TypeAlias = dict[str, SingleCommandOptions]
Target = TypeVar("Target", bound=Distribution | DistributionMetadata) # noqa: Y001 # Exists at runtime
Target = TypeVar("Target", Distribution, DistributionMetadata) # noqa: Y001 # Exists at runtime

def read_configuration(
filepath: StrPath, find_others: bool = False, ignore_option_errors: bool = False
) -> dict[Incomplete, Incomplete]: ...
def apply_configuration(dist: Distribution, filepath: StrPath) -> Distribution: ...
def configuration_to_dict(
handlers: tuple[ConfigHandler[Distribution | DistributionMetadata], ...]
handlers: Iterable[ConfigHandler[Distribution] | ConfigHandler[DistributionMetadata]],
) -> dict[Incomplete, Incomplete]: ...
def parse_configuration(
distribution: Distribution, command_options: AllCommandOptions, ignore_option_errors: bool = False
Expand Down Expand Up @@ -47,15 +48,15 @@ class ConfigMetadataHandler(ConfigHandler[DistributionMetadata]):
aliases: ClassVar[dict[str, str]]
strict_mode: bool
package_dir: dict[Incomplete, Incomplete] | None
root_dir: StrPath
root_dir: StrPath | None
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: StrPath = ".",
root_dir: StrPath | None = ".",
) -> None: ...
@property
def parsers(self): ...
Expand Down
4 changes: 1 addition & 3 deletions stubs/setuptools/setuptools/discovery.pyi
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
import itertools
from _typeshed import Incomplete, StrPath
from collections.abc import Iterable, Iterator, Mapping
from collections.abc import Iterable, Mapping
from typing import ClassVar
from typing_extensions import TypeAlias

from . import Distribution

StrIter: TypeAlias = Iterator[str]
chain_iter = itertools.chain.from_iterable

class _Filter:
Expand Down
3 changes: 2 additions & 1 deletion stubs/setuptools/setuptools/dist.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ from collections.abc import Iterable, Iterator, MutableMapping
from typing import Literal, TypeVar, overload

from . import Command, SetuptoolsDeprecationWarning
from ._distutils.cmd import Command as _Command
from ._distutils.dist import Distribution as _Distribution
from .command.alias import alias
from .command.bdist_egg import bdist_egg
Expand All @@ -26,7 +27,7 @@ from .command.saveopts import saveopts
from .command.sdist import sdist
from .command.setopt import setopt

_CommandT = TypeVar("_CommandT", bound=Command)
_CommandT = TypeVar("_CommandT", bound=_Command)

__all__ = ["Distribution"]

Expand Down
4 changes: 3 additions & 1 deletion stubs/setuptools/setuptools/extension.pyi
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from _typeshed import StrPath

from ._distutils.extension import Extension as _Extension

def have_pyrex() -> bool: ...
Expand All @@ -7,7 +9,7 @@ class Extension(_Extension):
def __init__(
self,
name: str,
sources: list[str],
sources: list[StrPath],
include_dirs: list[str] | None = None,
define_macros: list[tuple[str, str | None]] | None = None,
undef_macros: list[str] | None = None,
Expand Down
5 changes: 3 additions & 2 deletions stubs/setuptools/setuptools/sandbox.pyi
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import sys
from _typeshed import Unused
from types import TracebackType
from typing import ClassVar, Literal
from typing_extensions import Self
Expand All @@ -23,7 +22,9 @@ def run_setup(setup_script, args): ...

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

0 comments on commit 5243d30

Please sign in to comment.