Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions stubs/setuptools/setuptools/_distutils/cmd.pyi
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from _typeshed import BytesPath, StrOrBytesPath, StrPath, Unused
from abc import abstractmethod
from collections.abc import Callable, MutableSequence
from typing import Any, ClassVar, TypeVar, overload
from collections.abc import Callable, MutableSequence, Sequence
from typing import Any, ClassVar, Literal, TypeVar, overload
from typing_extensions import TypeVarTuple, Unpack

from .dist import Distribution
Expand Down Expand Up @@ -84,7 +84,10 @@ class Command:
def move_file(self, src: StrPath, dst: _StrPathT, level: Unused = 1) -> _StrPathT | str: ...
@overload
def move_file(self, src: BytesPath, dst: _BytesPathT, level: Unused = 1) -> _BytesPathT | bytes: ...
def spawn(self, cmd: MutableSequence[str], search_path: bool = True, level: Unused = 1) -> None: ...
@overload
def spawn(self, cmd: Sequence[StrOrBytesPath], search_path: Literal[False], level: Unused = 1) -> None: ...
@overload
def spawn(self, cmd: MutableSequence[bytes | StrPath], search_path: Literal[True] = True, level: Unused = 1) -> None: ...
@overload
def make_archive(
self,
Expand Down
10 changes: 8 additions & 2 deletions stubs/setuptools/setuptools/_distutils/compilers/C/base.pyi
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from _typeshed import BytesPath, Incomplete, StrPath, Unused
from _typeshed import BytesPath, Incomplete, StrOrBytesPath, StrPath, Unused
from collections.abc import Callable, Iterable, MutableSequence, Sequence
from subprocess import _ENV
from typing import ClassVar, Final, Literal, TypeVar, overload
from typing_extensions import TypeAlias, TypeVarTuple, Unpack

Expand Down Expand Up @@ -172,7 +173,12 @@ class Compiler:
def execute(
self, func: Callable[[Unpack[_Ts]], Unused], args: tuple[Unpack[_Ts]], msg: str | None = None, level: int = 1
) -> None: ...
def spawn(self, cmd: MutableSequence[bytes | StrPath]) -> None: ...
@overload
def spawn(self, cmd: Sequence[StrOrBytesPath], *, search_path: Literal[False], env: _ENV | None = None) -> None: ...
@overload
def spawn(
self, cmd: MutableSequence[bytes | StrPath], *, search_path: Literal[True] = True, env: _ENV | None = None
) -> None: ...
def mkpath(self, name: str, mode: int = 0o777) -> None: ...
@overload
def move_file(self, src: StrPath, dst: _StrPathT) -> _StrPathT | str: ...
Expand Down
3 changes: 3 additions & 0 deletions stubs/setuptools/setuptools/_distutils/compilers/C/msvc.pyi
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from _typeshed import StrPath
from collections.abc import Sequence
from typing import ClassVar, Final

from . import base
Expand All @@ -17,3 +19,4 @@ class Compiler(base.Compiler):
def initialize(self, plat_name: str | None = None) -> None: ...
@property
def out_extensions(self) -> dict[str, str]: ...
def spawn(self, cmd: Sequence[bytes | StrPath]): ... # type: ignore[override] # Less params
18 changes: 14 additions & 4 deletions stubs/setuptools/setuptools/_distutils/spawn.pyi
Original file line number Diff line number Diff line change
@@ -1,11 +1,21 @@
from _typeshed import StrPath
from collections.abc import MutableSequence
from _typeshed import StrOrBytesPath, StrPath, Unused
from collections.abc import MutableSequence, Sequence
from subprocess import _ENV
from typing import Literal, overload

@overload
def spawn(
cmd: Sequence[StrOrBytesPath],
search_path: Literal[False],
verbose: Unused = False,
dry_run: bool = False,
env: _ENV | None = None,
) -> None: ...
@overload
def spawn(
cmd: MutableSequence[bytes | StrPath],
search_path: bool = True,
verbose: bool = False,
search_path: Literal[True] = True,
verbose: Unused = False,
dry_run: bool = False,
env: _ENV | None = None,
) -> None: ...
Expand Down