mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-22 20:01:29 +08:00
setuptools & distutils: more accurate spawn method (#13036)
This commit is contained in:
@@ -165,7 +165,7 @@ class CCompiler:
|
||||
def execute(
|
||||
self, func: Callable[[Unpack[_Ts]], Unused], args: tuple[Unpack[_Ts]], msg: str | None = None, level: int = 1
|
||||
) -> None: ...
|
||||
def spawn(self, cmd: list[str]) -> None: ...
|
||||
def spawn(self, cmd: Iterable[str]) -> None: ...
|
||||
def mkpath(self, name: str, mode: int = 0o777) -> None: ...
|
||||
@overload
|
||||
def move_file(self, src: StrPath, dst: _StrPathT) -> _StrPathT | str: ...
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
from collections.abc import Iterable
|
||||
from typing import Literal
|
||||
|
||||
def spawn(
|
||||
cmd: list[str], search_path: bool | Literal[0, 1] = 1, verbose: bool | Literal[0, 1] = 0, dry_run: bool | Literal[0, 1] = 0
|
||||
cmd: Iterable[str],
|
||||
search_path: bool | Literal[0, 1] = 1,
|
||||
verbose: bool | Literal[0, 1] = 0,
|
||||
dry_run: bool | Literal[0, 1] = 0,
|
||||
) -> None: ...
|
||||
def find_executable(executable: str, path: str | None = None) -> str | None: ...
|
||||
|
||||
@@ -98,7 +98,6 @@ setuptools._distutils.dir_util
|
||||
setuptools._distutils.fancy_getopt
|
||||
setuptools._distutils.file_util
|
||||
setuptools._distutils.log
|
||||
setuptools._distutils.spawn
|
||||
setuptools._distutils.text_file
|
||||
setuptools._distutils.unixccompiler
|
||||
setuptools._distutils.version
|
||||
|
||||
1
stubs/setuptools/distutils/spawn.pyi
Normal file
1
stubs/setuptools/distutils/spawn.pyi
Normal file
@@ -0,0 +1 @@
|
||||
from setuptools._distutils.spawn import *
|
||||
@@ -1,5 +1,5 @@
|
||||
from _typeshed import BytesPath, StrPath, Unused
|
||||
from collections.abc import Callable, Iterable, Sequence
|
||||
from collections.abc import Callable, Iterable, MutableSequence, Sequence
|
||||
from typing import ClassVar, Literal, TypeVar, overload
|
||||
from typing_extensions import TypeAlias, TypeVarTuple, Unpack
|
||||
|
||||
@@ -169,7 +169,7 @@ class CCompiler:
|
||||
def execute(
|
||||
self, func: Callable[[Unpack[_Ts]], Unused], args: tuple[Unpack[_Ts]], msg: str | None = None, level: int = 1
|
||||
) -> None: ...
|
||||
def spawn(self, cmd: list[str]) -> None: ...
|
||||
def spawn(self, cmd: MutableSequence[str]) -> None: ...
|
||||
def mkpath(self, name: str, mode: int = 0o777) -> None: ...
|
||||
@overload
|
||||
def move_file(self, src: StrPath, dst: _StrPathT) -> _StrPathT | str: ...
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
from _typeshed import BytesPath, StrOrBytesPath, StrPath, Unused
|
||||
from abc import abstractmethod
|
||||
from collections.abc import Callable, Iterable
|
||||
from collections.abc import Callable, MutableSequence
|
||||
from typing import Any, ClassVar, TypeVar, overload
|
||||
from typing_extensions import TypeVarTuple, Unpack
|
||||
|
||||
@@ -79,7 +79,7 @@ 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: Iterable[str], search_path: bool = True, level: Unused = 1) -> None: ...
|
||||
def spawn(self, cmd: MutableSequence[str], search_path: bool = True, level: Unused = 1) -> None: ...
|
||||
@overload
|
||||
def make_archive(
|
||||
self,
|
||||
|
||||
7
stubs/setuptools/setuptools/_distutils/spawn.pyi
Normal file
7
stubs/setuptools/setuptools/_distutils/spawn.pyi
Normal file
@@ -0,0 +1,7 @@
|
||||
from collections.abc import MutableSequence
|
||||
from subprocess import _ENV
|
||||
|
||||
def spawn(
|
||||
cmd: MutableSequence[str], search_path: bool = True, verbose: bool = False, dry_run: bool = False, env: _ENV | None = None
|
||||
) -> None: ...
|
||||
def find_executable(executable: str, path: str | None = None) -> str | None: ...
|
||||
Reference in New Issue
Block a user