mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-01-10 05:22:23 +08:00
distutils & setuptools: Relax path related params (#11948)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
This commit is contained in:
@@ -1,9 +1,22 @@
|
||||
from typing import Literal
|
||||
from _typeshed import StrOrBytesPath, StrPath
|
||||
from typing import Literal, overload
|
||||
|
||||
@overload
|
||||
def make_archive(
|
||||
base_name: str,
|
||||
format: str,
|
||||
root_dir: str | None = None,
|
||||
root_dir: StrOrBytesPath | None = None,
|
||||
base_dir: str | None = None,
|
||||
verbose: bool | Literal[0, 1] = 0,
|
||||
dry_run: bool | Literal[0, 1] = 0,
|
||||
owner: str | None = None,
|
||||
group: str | None = None,
|
||||
) -> str: ...
|
||||
@overload
|
||||
def make_archive(
|
||||
base_name: StrPath,
|
||||
format: str,
|
||||
root_dir: StrOrBytesPath,
|
||||
base_dir: str | None = None,
|
||||
verbose: bool | Literal[0, 1] = 0,
|
||||
dry_run: bool | Literal[0, 1] = 0,
|
||||
@@ -12,7 +25,7 @@ def make_archive(
|
||||
) -> str: ...
|
||||
def make_tarball(
|
||||
base_name: str,
|
||||
base_dir: str,
|
||||
base_dir: StrPath,
|
||||
compress: str | None = "gzip",
|
||||
verbose: bool | Literal[0, 1] = 0,
|
||||
dry_run: bool | Literal[0, 1] = 0,
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
from collections.abc import Callable
|
||||
from typing import Any, Literal
|
||||
from _typeshed import BytesPath, StrPath
|
||||
from collections.abc import Callable, Iterable
|
||||
from distutils.file_util import _BytesPathT, _StrPathT
|
||||
from typing import Any, Literal, overload
|
||||
from typing_extensions import TypeAlias
|
||||
|
||||
_Macro: TypeAlias = tuple[str] | tuple[str, str | None]
|
||||
@@ -145,18 +147,27 @@ class CCompiler:
|
||||
extra_preargs: list[str] | None = None,
|
||||
extra_postargs: list[str] | None = None,
|
||||
) -> None: ...
|
||||
def executable_filename(self, basename: str, strip_dir: bool | Literal[0, 1] = 0, output_dir: str = "") -> str: ...
|
||||
@overload
|
||||
def executable_filename(self, basename: str, strip_dir: Literal[0, False] = 0, output_dir: StrPath = "") -> str: ...
|
||||
@overload
|
||||
def executable_filename(self, basename: StrPath, strip_dir: Literal[1, True], output_dir: StrPath = "") -> str: ...
|
||||
def library_filename(
|
||||
self, libname: str, lib_type: str = "static", strip_dir: bool | Literal[0, 1] = 0, output_dir: str = ""
|
||||
self, libname: str, lib_type: str = "static", strip_dir: bool | Literal[0, 1] = 0, output_dir: StrPath = ""
|
||||
) -> str: ...
|
||||
def object_filenames(
|
||||
self, source_filenames: list[str], strip_dir: bool | Literal[0, 1] = 0, output_dir: str = ""
|
||||
self, source_filenames: Iterable[StrPath], strip_dir: bool | Literal[0, 1] = 0, output_dir: StrPath | None = ""
|
||||
) -> list[str]: ...
|
||||
def shared_object_filename(self, basename: str, strip_dir: bool | Literal[0, 1] = 0, output_dir: str = "") -> str: ...
|
||||
@overload
|
||||
def shared_object_filename(self, basename: str, strip_dir: Literal[0, False] = 0, output_dir: StrPath = "") -> str: ...
|
||||
@overload
|
||||
def shared_object_filename(self, basename: StrPath, strip_dir: Literal[1, True], output_dir: StrPath = "") -> str: ...
|
||||
def execute(self, func: Callable[..., object], args: tuple[Any, ...], msg: str | None = None, level: int = 1) -> None: ...
|
||||
def spawn(self, cmd: list[str]) -> None: ...
|
||||
def mkpath(self, name: str, mode: int = 0o777) -> None: ...
|
||||
def move_file(self, src: str, dst: str) -> str: ...
|
||||
@overload
|
||||
def move_file(self, src: StrPath, dst: _StrPathT) -> _StrPathT | str: ...
|
||||
@overload
|
||||
def move_file(self, src: BytesPath, dst: _BytesPathT) -> _BytesPathT | bytes: ...
|
||||
def announce(self, msg: str, level: int = 1) -> None: ...
|
||||
def warn(self, msg: str) -> None: ...
|
||||
def debug_print(self, msg: str) -> None: ...
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
from _typeshed import Incomplete, Unused
|
||||
from _typeshed import BytesPath, Incomplete, StrOrBytesPath, StrPath, Unused
|
||||
from abc import abstractmethod
|
||||
from collections.abc import Callable, Iterable
|
||||
from distutils.dist import Distribution
|
||||
from typing import Any, ClassVar, Literal
|
||||
from distutils.file_util import _BytesPathT, _StrPathT
|
||||
from typing import Any, ClassVar, Literal, overload
|
||||
|
||||
class Command:
|
||||
distribution: Distribution
|
||||
@@ -30,31 +31,56 @@ class Command:
|
||||
def warn(self, msg: str) -> None: ...
|
||||
def execute(self, func: Callable[..., object], args: Iterable[Any], msg: str | None = None, level: int = 1) -> None: ...
|
||||
def mkpath(self, name: str, mode: int = 0o777) -> None: ...
|
||||
@overload
|
||||
def copy_file(
|
||||
self,
|
||||
infile: str,
|
||||
outfile: str,
|
||||
infile: StrPath,
|
||||
outfile: _StrPathT,
|
||||
preserve_mode: bool | Literal[0, 1] = 1,
|
||||
preserve_times: bool | Literal[0, 1] = 1,
|
||||
link: str | None = None,
|
||||
level: Unused = 1,
|
||||
) -> tuple[str, bool]: ...
|
||||
) -> tuple[_StrPathT | str, bool]: ...
|
||||
@overload
|
||||
def copy_file(
|
||||
self,
|
||||
infile: BytesPath,
|
||||
outfile: _BytesPathT,
|
||||
preserve_mode: bool | Literal[0, 1] = 1,
|
||||
preserve_times: bool | Literal[0, 1] = 1,
|
||||
link: str | None = None,
|
||||
level: Unused = 1,
|
||||
) -> tuple[_BytesPathT | bytes, bool]: ...
|
||||
def copy_tree(
|
||||
self,
|
||||
infile: str,
|
||||
infile: StrPath,
|
||||
outfile: str,
|
||||
preserve_mode: bool | Literal[0, 1] = 1,
|
||||
preserve_times: bool | Literal[0, 1] = 1,
|
||||
preserve_symlinks: bool | Literal[0, 1] = 0,
|
||||
level: Unused = 1,
|
||||
) -> list[str]: ...
|
||||
def move_file(self, src: str, dst: str, level: Unused = 1) -> str: ...
|
||||
@overload
|
||||
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 | Literal[0, 1] = 1, level: Unused = 1) -> None: ...
|
||||
@overload
|
||||
def make_archive(
|
||||
self,
|
||||
base_name: str,
|
||||
format: str,
|
||||
root_dir: str | None = None,
|
||||
root_dir: StrOrBytesPath | None = None,
|
||||
base_dir: str | None = None,
|
||||
owner: str | None = None,
|
||||
group: str | None = None,
|
||||
) -> str: ...
|
||||
@overload
|
||||
def make_archive(
|
||||
self,
|
||||
base_name: StrPath,
|
||||
format: str,
|
||||
root_dir: StrOrBytesPath,
|
||||
base_dir: str | None = None,
|
||||
owner: str | None = None,
|
||||
group: str | None = None,
|
||||
@@ -62,7 +88,7 @@ class Command:
|
||||
def make_file(
|
||||
self,
|
||||
infiles: str | list[str] | tuple[str, ...],
|
||||
outfile: str,
|
||||
outfile: StrOrBytesPath,
|
||||
func: Callable[..., object],
|
||||
args: list[Any],
|
||||
exec_msg: str | None = None,
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
from _typeshed import StrOrBytesPath
|
||||
from collections.abc import Sequence
|
||||
from re import Pattern
|
||||
from typing import Any, Literal
|
||||
@@ -80,4 +81,4 @@ class config(Command):
|
||||
self, header: str, include_dirs: Sequence[str] | None = None, library_dirs: Sequence[str] | None = None, lang: str = "c"
|
||||
) -> bool: ...
|
||||
|
||||
def dump_file(filename: str, head: Any | None = None) -> None: ...
|
||||
def dump_file(filename: StrOrBytesPath, head: Any | None = None) -> None: ...
|
||||
|
||||
@@ -1,3 +1,14 @@
|
||||
def newer(source: str, target: str) -> bool: ...
|
||||
def newer_pairwise(sources: list[str], targets: list[str]) -> list[tuple[str, str]]: ...
|
||||
def newer_group(sources: list[str], target: str, missing: str = "error") -> bool: ...
|
||||
from _typeshed import StrOrBytesPath, SupportsLenAndGetItem
|
||||
from collections.abc import Iterable
|
||||
from typing import Literal, TypeVar
|
||||
|
||||
_SourcesT = TypeVar("_SourcesT", bound=StrOrBytesPath)
|
||||
_TargetsT = TypeVar("_TargetsT", bound=StrOrBytesPath)
|
||||
|
||||
def newer(source: StrOrBytesPath, target: StrOrBytesPath) -> bool | Literal[1]: ...
|
||||
def newer_pairwise(
|
||||
sources: SupportsLenAndGetItem[_SourcesT], targets: SupportsLenAndGetItem[_TargetsT]
|
||||
) -> tuple[list[_SourcesT], list[_TargetsT]]: ...
|
||||
def newer_group(
|
||||
sources: Iterable[StrOrBytesPath], target: StrOrBytesPath, missing: Literal["error", "ignore", "newer"] = "error"
|
||||
) -> Literal[0, 1]: ...
|
||||
|
||||
@@ -1,11 +1,17 @@
|
||||
from _typeshed import StrOrBytesPath, StrPath
|
||||
from collections.abc import Iterable
|
||||
from typing import Literal
|
||||
|
||||
def mkpath(name: str, mode: int = 0o777, verbose: bool | Literal[0, 1] = 1, dry_run: bool | Literal[0, 1] = 0) -> list[str]: ...
|
||||
def create_tree(
|
||||
base_dir: str, files: list[str], mode: int = 0o777, verbose: bool | Literal[0, 1] = 1, dry_run: bool | Literal[0, 1] = 0
|
||||
base_dir: StrPath,
|
||||
files: Iterable[StrPath],
|
||||
mode: int = 0o777,
|
||||
verbose: bool | Literal[0, 1] = 1,
|
||||
dry_run: bool | Literal[0, 1] = 0,
|
||||
) -> None: ...
|
||||
def copy_tree(
|
||||
src: str,
|
||||
src: StrPath,
|
||||
dst: str,
|
||||
preserve_mode: bool | Literal[0, 1] = 1,
|
||||
preserve_times: bool | Literal[0, 1] = 1,
|
||||
@@ -14,4 +20,4 @@ def copy_tree(
|
||||
verbose: bool | Literal[0, 1] = 1,
|
||||
dry_run: bool | Literal[0, 1] = 0,
|
||||
) -> list[str]: ...
|
||||
def remove_tree(directory: str, verbose: bool | Literal[0, 1] = 1, dry_run: bool | Literal[0, 1] = 0) -> None: ...
|
||||
def remove_tree(directory: StrOrBytesPath, verbose: bool | Literal[0, 1] = 1, dry_run: bool | Literal[0, 1] = 0) -> None: ...
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
from _typeshed import FileDescriptorOrPath, Incomplete, SupportsWrite
|
||||
from _typeshed import Incomplete, StrOrBytesPath, StrPath, SupportsWrite
|
||||
from collections.abc import Iterable, Mapping
|
||||
from distutils.cmd import Command
|
||||
from re import Pattern
|
||||
@@ -11,7 +11,7 @@ _OptionsList: TypeAlias = list[tuple[str, str | None, str, int] | tuple[str, str
|
||||
_CommandT = TypeVar("_CommandT", bound=Command)
|
||||
|
||||
class DistributionMetadata:
|
||||
def __init__(self, path: FileDescriptorOrPath | None = None) -> None: ...
|
||||
def __init__(self, path: StrOrBytesPath | None = None) -> None: ...
|
||||
name: str | None
|
||||
version: str | None
|
||||
author: str | None
|
||||
@@ -30,7 +30,7 @@ class DistributionMetadata:
|
||||
requires: list[str] | None
|
||||
obsoletes: list[str] | None
|
||||
def read_pkg_file(self, file: IO[str]) -> None: ...
|
||||
def write_pkg_info(self, base_dir: str) -> None: ...
|
||||
def write_pkg_info(self, base_dir: StrPath) -> None: ...
|
||||
def write_pkg_file(self, file: SupportsWrite[str]) -> None: ...
|
||||
def get_name(self) -> str: ...
|
||||
def get_version(self) -> str: ...
|
||||
|
||||
@@ -1,15 +1,38 @@
|
||||
from collections.abc import Sequence
|
||||
from typing import Literal
|
||||
from _typeshed import BytesPath, StrOrBytesPath, StrPath
|
||||
from collections.abc import Iterable
|
||||
from typing import Literal, TypeVar, overload
|
||||
|
||||
_StrPathT = TypeVar("_StrPathT", bound=StrPath)
|
||||
_BytesPathT = TypeVar("_BytesPathT", bound=BytesPath)
|
||||
|
||||
@overload
|
||||
def copy_file(
|
||||
src: str,
|
||||
dst: str,
|
||||
src: StrPath,
|
||||
dst: _StrPathT,
|
||||
preserve_mode: bool | Literal[0, 1] = 1,
|
||||
preserve_times: bool | Literal[0, 1] = 1,
|
||||
update: bool | Literal[0, 1] = 0,
|
||||
link: str | None = None,
|
||||
verbose: bool | Literal[0, 1] = 1,
|
||||
dry_run: bool | Literal[0, 1] = 0,
|
||||
) -> tuple[str, str]: ...
|
||||
def move_file(src: str, dst: str, verbose: bool | Literal[0, 1] = 0, dry_run: bool | Literal[0, 1] = 0) -> str: ...
|
||||
def write_file(filename: str, contents: Sequence[str]) -> None: ...
|
||||
) -> tuple[_StrPathT | str, bool]: ...
|
||||
@overload
|
||||
def copy_file(
|
||||
src: BytesPath,
|
||||
dst: _BytesPathT,
|
||||
preserve_mode: bool | Literal[0, 1] = 1,
|
||||
preserve_times: bool | Literal[0, 1] = 1,
|
||||
update: bool | Literal[0, 1] = 0,
|
||||
link: str | None = None,
|
||||
verbose: bool | Literal[0, 1] = 1,
|
||||
dry_run: bool | Literal[0, 1] = 0,
|
||||
) -> tuple[_BytesPathT | bytes, bool]: ...
|
||||
@overload
|
||||
def move_file(
|
||||
src: StrPath, dst: _StrPathT, verbose: bool | Literal[0, 1] = 0, dry_run: bool | Literal[0, 1] = 0
|
||||
) -> _StrPathT | str: ...
|
||||
@overload
|
||||
def move_file(
|
||||
src: BytesPath, dst: _BytesPathT, verbose: bool | Literal[0, 1] = 0, dry_run: bool | Literal[0, 1] = 0
|
||||
) -> _BytesPathT | bytes: ...
|
||||
def write_file(filename: StrOrBytesPath, contents: Iterable[str]) -> None: ...
|
||||
|
||||
@@ -5,7 +5,7 @@ from typing import Any, Literal
|
||||
def get_host_platform() -> str: ...
|
||||
def get_platform() -> str: ...
|
||||
def convert_path(pathname: str) -> str: ...
|
||||
def change_root(new_root: str, pathname: str) -> str: ...
|
||||
def change_root(new_root: StrPath, pathname: StrPath) -> str: ...
|
||||
def check_environ() -> None: ...
|
||||
def subst_vars(s: str, local_vars: Mapping[str, str]) -> None: ...
|
||||
def split_quoted(s: str) -> list[str]: ...
|
||||
|
||||
@@ -119,7 +119,6 @@ distutils\..+
|
||||
|
||||
# Is a functools.partial, so stubtest says "is not a function"
|
||||
setuptools.dep_util.newer_pairwise_group
|
||||
setuptools._distutils.dep_util.newer_pairwise
|
||||
setuptools.modified.newer_pairwise_group
|
||||
setuptools._distutils._modified.newer_pairwise_group
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import types
|
||||
import zipimport
|
||||
from _typeshed import Incomplete, StrPath, Unused
|
||||
from _typeshed import BytesPath, Incomplete, StrOrBytesPath, StrPath, Unused
|
||||
from collections.abc import Callable, Generator, Iterable, Iterator, Sequence
|
||||
from io import BytesIO
|
||||
from itertools import chain
|
||||
@@ -183,11 +183,11 @@ run_main = run_script
|
||||
|
||||
class Environment:
|
||||
def __init__(
|
||||
self, search_path: Sequence[str] | None = None, platform: str | None = ..., python: str | None = ...
|
||||
self, search_path: Iterable[str] | None = None, platform: str | None = ..., python: str | None = ...
|
||||
) -> None: ...
|
||||
def can_add(self, dist: Distribution) -> bool: ...
|
||||
def remove(self, dist: Distribution) -> None: ...
|
||||
def scan(self, search_path: Sequence[str] | None = None) -> None: ...
|
||||
def scan(self, search_path: Iterable[str] | None = None) -> None: ...
|
||||
def __getitem__(self, project_name: str) -> list[Distribution]: ...
|
||||
def add(self, dist: Distribution) -> None: ...
|
||||
@overload
|
||||
@@ -284,8 +284,8 @@ class ResourceManager:
|
||||
def resource_string(self, package_or_requirement: _PkgReqType, resource_name: str) -> bytes: ...
|
||||
def resource_listdir(self, package_or_requirement: _PkgReqType, resource_name: str) -> list[str]: ...
|
||||
def extraction_error(self) -> NoReturn: ...
|
||||
def get_cache_path(self, archive_name: str, names: Iterable[str] = ()) -> str: ...
|
||||
def postprocess(self, tempname: str, filename: str) -> None: ...
|
||||
def get_cache_path(self, archive_name: str, names: Iterable[StrPath] = ()) -> str: ...
|
||||
def postprocess(self, tempname: StrOrBytesPath, filename: str) -> None: ...
|
||||
def set_extraction_path(self, path: str) -> None: ...
|
||||
def cleanup_resources(self, force: bool = False) -> list[str]: ...
|
||||
|
||||
@@ -421,7 +421,7 @@ class Distribution(NullProvider):
|
||||
def activate(self, path: list[str] | None = None, replace: bool = False) -> None: ...
|
||||
def egg_name(self) -> str: ... # type: ignore[override] # supertype's egg_name is a variable, not a method
|
||||
@classmethod
|
||||
def from_filename(cls, filename: str, metadata: _MetadataType = None, *, precedence: int = 3) -> Distribution: ...
|
||||
def from_filename(cls, filename: StrOrBytesPath, metadata: _MetadataType = None, *, precedence: int = 3) -> Distribution: ...
|
||||
def as_requirement(self) -> Requirement: ...
|
||||
def load_entry_point(self, group: str, name: str) -> _ResolvedEntryPoint: ...
|
||||
@overload
|
||||
@@ -491,7 +491,10 @@ get_platform = get_build_platform
|
||||
def get_supported_platform() -> str: ...
|
||||
def compatible_platforms(provided: str | None, required: str | None) -> bool: ...
|
||||
def get_default_cache() -> str: ...
|
||||
def ensure_directory(path: str) -> None: ...
|
||||
def normalize_path(filename: str) -> str: ...
|
||||
def ensure_directory(path: StrOrBytesPath) -> None: ...
|
||||
@overload
|
||||
def normalize_path(filename: StrPath) -> str: ...
|
||||
@overload
|
||||
def normalize_path(filename: BytesPath) -> bytes: ...
|
||||
|
||||
class PkgResourcesDeprecationWarning(Warning): ...
|
||||
|
||||
@@ -1,6 +1,17 @@
|
||||
from typing import Literal
|
||||
from _typeshed import StrOrBytesPath
|
||||
from collections.abc import Callable, Iterable
|
||||
from typing import Literal, TypeVar
|
||||
|
||||
def newer(source, target): ...
|
||||
def newer_pairwise(sources, targets, newer=...): ...
|
||||
def newer_group(sources, target, missing: Literal["error", "newer", "ignore"] = "error"): ...
|
||||
def newer_pairwise_group(sources, targets, *, newer=...): ...
|
||||
_SourcesT = TypeVar("_SourcesT", bound=StrOrBytesPath)
|
||||
_TargetsT = TypeVar("_TargetsT", bound=StrOrBytesPath)
|
||||
|
||||
def newer(source: StrOrBytesPath, target: StrOrBytesPath) -> bool: ...
|
||||
def newer_pairwise(
|
||||
sources: Iterable[_SourcesT], targets: Iterable[_TargetsT], newer: Callable[[_SourcesT, _TargetsT], bool] = ...
|
||||
) -> tuple[list[_SourcesT], list[_TargetsT]]: ...
|
||||
def newer_group(
|
||||
sources: Iterable[StrOrBytesPath], target: StrOrBytesPath, missing: Literal["error", "ignore", "newer"] = "error"
|
||||
) -> bool: ...
|
||||
def newer_pairwise_group(
|
||||
sources: Iterable[_SourcesT], targets: Iterable[_TargetsT], *, newer: Callable[[_SourcesT, _TargetsT], bool] = ...
|
||||
) -> tuple[list[_SourcesT], list[_TargetsT]]: ...
|
||||
|
||||
@@ -1,18 +1,31 @@
|
||||
from typing import Literal
|
||||
from _typeshed import StrOrBytesPath, StrPath
|
||||
from typing import Literal, overload
|
||||
|
||||
@overload
|
||||
def make_archive(
|
||||
base_name: str,
|
||||
format: str,
|
||||
root_dir: str | None = ...,
|
||||
base_dir: str | None = ...,
|
||||
root_dir: StrOrBytesPath | None = None,
|
||||
base_dir: str | None = None,
|
||||
verbose: bool | Literal[0, 1] = 0,
|
||||
dry_run: bool | Literal[0, 1] = 0,
|
||||
owner: str | None = ...,
|
||||
group: str | None = ...,
|
||||
owner: str | None = None,
|
||||
group: str | None = None,
|
||||
) -> str: ...
|
||||
@overload
|
||||
def make_archive(
|
||||
base_name: StrPath,
|
||||
format: str,
|
||||
root_dir: StrOrBytesPath,
|
||||
base_dir: str | None = None,
|
||||
verbose: bool | Literal[0, 1] = 0,
|
||||
dry_run: bool | Literal[0, 1] = 0,
|
||||
owner: str | None = None,
|
||||
group: str | None = None,
|
||||
) -> str: ...
|
||||
def make_tarball(
|
||||
base_name: str,
|
||||
base_dir: str,
|
||||
base_dir: StrPath,
|
||||
compress: str | None = ...,
|
||||
verbose: bool | Literal[0, 1] = 0,
|
||||
dry_run: bool | Literal[0, 1] = 0,
|
||||
|
||||
@@ -1,8 +1,11 @@
|
||||
from collections.abc import Callable
|
||||
from typing import Any, ClassVar, Literal
|
||||
from _typeshed import BytesPath, StrPath
|
||||
from collections.abc import Callable, Iterable
|
||||
from typing import Any, ClassVar, Literal, TypeVar, overload
|
||||
from typing_extensions import TypeAlias
|
||||
|
||||
_Macro: TypeAlias = tuple[str] | tuple[str, str | None]
|
||||
_StrPathT = TypeVar("_StrPathT", bound=StrPath)
|
||||
_BytesPathT = TypeVar("_BytesPathT", bound=BytesPath)
|
||||
|
||||
def gen_lib_options(
|
||||
compiler: CCompiler, library_dirs: list[str], runtime_library_dirs: list[str], libraries: list[str]
|
||||
@@ -154,18 +157,27 @@ class CCompiler:
|
||||
extra_preargs: list[str] | None = ...,
|
||||
extra_postargs: list[str] | None = ...,
|
||||
) -> None: ...
|
||||
def executable_filename(self, basename: str, strip_dir: bool | Literal[0, 1] = 0, output_dir: str = ...) -> str: ...
|
||||
@overload
|
||||
def executable_filename(self, basename: str, strip_dir: Literal[0, False] = 0, output_dir: StrPath = ...) -> str: ...
|
||||
@overload
|
||||
def executable_filename(self, basename: StrPath, strip_dir: Literal[1, True], output_dir: StrPath = ...) -> str: ...
|
||||
def library_filename(
|
||||
self, libname: str, lib_type: str = "static", strip_dir: bool | Literal[0, 1] = 0, output_dir: str = ""
|
||||
self, libname: str, lib_type: str = "static", strip_dir: bool | Literal[0, 1] = 0, output_dir: StrPath = ""
|
||||
) -> str: ...
|
||||
def object_filenames(
|
||||
self, source_filenames: list[str], strip_dir: bool | Literal[0, 1] = 0, output_dir: str = ...
|
||||
self, source_filenames: Iterable[StrPath], strip_dir: bool | Literal[0, 1] = 0, output_dir: StrPath | None = ...
|
||||
) -> list[str]: ...
|
||||
def shared_object_filename(self, basename: str, strip_dir: bool | Literal[0, 1] = 0, output_dir: str = ...) -> str: ...
|
||||
@overload
|
||||
def shared_object_filename(self, basename: str, strip_dir: Literal[0, False] = 0, output_dir: StrPath = ...) -> str: ...
|
||||
@overload
|
||||
def shared_object_filename(self, basename: StrPath, strip_dir: Literal[1, True], output_dir: StrPath = ...) -> str: ...
|
||||
def execute(self, func: Callable[..., object], args: tuple[Any, ...], msg: str | None = ..., level: int = ...) -> None: ...
|
||||
def spawn(self, cmd: list[str]) -> None: ...
|
||||
def mkpath(self, name: str, mode: int = ...) -> None: ...
|
||||
def move_file(self, src: str, dst: str) -> str: ...
|
||||
@overload
|
||||
def move_file(self, src: StrPath, dst: _StrPathT) -> _StrPathT | str: ...
|
||||
@overload
|
||||
def move_file(self, src: BytesPath, dst: _BytesPathT) -> _BytesPathT | bytes: ...
|
||||
def announce(self, msg: str, level: int = ...) -> None: ...
|
||||
def warn(self, msg: str) -> None: ...
|
||||
def debug_print(self, msg: str) -> None: ...
|
||||
|
||||
@@ -1,10 +1,13 @@
|
||||
from _typeshed import Incomplete, Unused
|
||||
from _typeshed import BytesPath, Incomplete, StrOrBytesPath, StrPath, Unused
|
||||
from abc import abstractmethod
|
||||
from collections.abc import Callable, Iterable
|
||||
from typing import Any, ClassVar, Literal
|
||||
from typing import Any, ClassVar, Literal, TypeVar, overload
|
||||
|
||||
from .dist import Distribution
|
||||
|
||||
_StrPathT = TypeVar("_StrPathT", bound=StrPath)
|
||||
_BytesPathT = TypeVar("_BytesPathT", bound=BytesPath)
|
||||
|
||||
class Command:
|
||||
distribution: Distribution
|
||||
# Any to work around variance issues
|
||||
@@ -34,31 +37,56 @@ class Command:
|
||||
self, func: Callable[..., object], args: Iterable[Incomplete], msg: str | None = ..., level: int = ...
|
||||
) -> None: ...
|
||||
def mkpath(self, name: str, mode: int = ...) -> None: ...
|
||||
@overload
|
||||
def copy_file(
|
||||
self,
|
||||
infile: str,
|
||||
outfile: str,
|
||||
infile: StrPath,
|
||||
outfile: _StrPathT,
|
||||
preserve_mode: bool | Literal[0, 1] = 1,
|
||||
preserve_times: bool | Literal[0, 1] = 1,
|
||||
link: str | None = None,
|
||||
level: Unused = 1,
|
||||
) -> tuple[str, bool]: ...
|
||||
) -> tuple[_StrPathT | str, bool]: ...
|
||||
@overload
|
||||
def copy_file(
|
||||
self,
|
||||
infile: BytesPath,
|
||||
outfile: _BytesPathT,
|
||||
preserve_mode: bool | Literal[0, 1] = 1,
|
||||
preserve_times: bool | Literal[0, 1] = 1,
|
||||
link: str | None = None,
|
||||
level: Unused = 1,
|
||||
) -> tuple[_BytesPathT | bytes, bool]: ...
|
||||
def copy_tree(
|
||||
self,
|
||||
infile: str,
|
||||
infile: StrPath,
|
||||
outfile: str,
|
||||
preserve_mode: bool | Literal[0, 1] = 1,
|
||||
preserve_times: bool | Literal[0, 1] = 1,
|
||||
preserve_symlinks: bool | Literal[0, 1] = 0,
|
||||
level: Unused = 1,
|
||||
) -> list[str]: ...
|
||||
def move_file(self, src: str, dst: str, level: Unused = 1) -> str: ...
|
||||
@overload
|
||||
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 | Literal[0, 1] = 1, level: Unused = 1) -> None: ...
|
||||
@overload
|
||||
def make_archive(
|
||||
self,
|
||||
base_name: str,
|
||||
format: str,
|
||||
root_dir: str | None = None,
|
||||
root_dir: StrOrBytesPath | None = None,
|
||||
base_dir: str | None = None,
|
||||
owner: str | None = None,
|
||||
group: str | None = None,
|
||||
) -> str: ...
|
||||
@overload
|
||||
def make_archive(
|
||||
self,
|
||||
base_name: StrPath,
|
||||
format: str,
|
||||
root_dir: StrOrBytesPath,
|
||||
base_dir: str | None = None,
|
||||
owner: str | None = None,
|
||||
group: str | None = None,
|
||||
@@ -66,7 +94,7 @@ class Command:
|
||||
def make_file(
|
||||
self,
|
||||
infiles: str | list[str] | tuple[str, ...],
|
||||
outfile: str,
|
||||
outfile: StrOrBytesPath,
|
||||
func: Callable[..., object],
|
||||
args: list[Incomplete],
|
||||
exec_msg: str | None = None,
|
||||
|
||||
@@ -17,7 +17,7 @@ class install_lib(Command):
|
||||
def finalize_options(self) -> None: ...
|
||||
def run(self) -> None: ...
|
||||
def build(self) -> None: ...
|
||||
def install(self): ...
|
||||
def install(self) -> list[str]: ...
|
||||
def byte_compile(self, files) -> None: ...
|
||||
def get_outputs(self): ...
|
||||
def get_inputs(self): ...
|
||||
|
||||
@@ -12,7 +12,7 @@ class install_scripts(Command):
|
||||
skip_build: Incomplete
|
||||
def initialize_options(self) -> None: ...
|
||||
def finalize_options(self) -> None: ...
|
||||
outfiles: Incomplete
|
||||
outfiles: list[str]
|
||||
def run(self) -> None: ...
|
||||
def get_inputs(self): ...
|
||||
def get_outputs(self): ...
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
from _typeshed import Incomplete
|
||||
from _typeshed import Incomplete, StrOrBytesPath
|
||||
from collections.abc import Iterable, Iterator
|
||||
from typing import AnyStr, ClassVar, TypeVar, overload
|
||||
|
||||
@@ -18,7 +18,7 @@ class upload(PyPIRCCommand):
|
||||
realm: Incomplete
|
||||
def finalize_options(self) -> None: ...
|
||||
def run(self) -> None: ...
|
||||
def upload_file(self, command: str, pyversion: str, filename: str) -> None: ...
|
||||
def upload_file(self, command: str, pyversion: str, filename: StrOrBytesPath) -> None: ...
|
||||
|
||||
@overload
|
||||
def make_iterable(values: None) -> list[None]: ...
|
||||
|
||||
@@ -1,3 +1 @@
|
||||
def newer(source: str, target: str) -> bool: ...
|
||||
def newer_pairwise(sources: list[str], targets: list[str]) -> list[tuple[str, str]]: ...
|
||||
def newer_group(sources: list[str], target: str, missing: str = ...) -> bool: ...
|
||||
from ._modified import newer as newer, newer_group as newer_group, newer_pairwise as newer_pairwise
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
from _typeshed import FileDescriptorOrPath, Incomplete, SupportsWrite
|
||||
from _typeshed import Incomplete, StrOrBytesPath, StrPath, SupportsWrite
|
||||
from collections.abc import Iterable, Mapping
|
||||
from re import Pattern
|
||||
from typing import IO, Any, ClassVar, Literal, TypeVar, overload
|
||||
@@ -12,7 +12,7 @@ _OptionsList: TypeAlias = list[tuple[str, str | None, str, int] | tuple[str, str
|
||||
_CommandT = TypeVar("_CommandT", bound=Command)
|
||||
|
||||
class DistributionMetadata:
|
||||
def __init__(self, path: FileDescriptorOrPath | None = None) -> None: ...
|
||||
def __init__(self, path: StrOrBytesPath | None = None) -> None: ...
|
||||
name: str | None
|
||||
version: str | None
|
||||
author: str | None
|
||||
@@ -31,7 +31,7 @@ class DistributionMetadata:
|
||||
requires: list[str] | None
|
||||
obsoletes: list[str] | None
|
||||
def read_pkg_file(self, file: IO[str]) -> None: ...
|
||||
def write_pkg_info(self, base_dir: str) -> None: ...
|
||||
def write_pkg_info(self, base_dir: StrPath) -> None: ...
|
||||
def write_pkg_file(self, file: SupportsWrite[str]) -> None: ...
|
||||
def get_name(self) -> str: ...
|
||||
def get_version(self) -> str: ...
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
from _typeshed import StrPath
|
||||
from collections.abc import Mapping
|
||||
from typing import Any
|
||||
|
||||
@@ -33,11 +34,11 @@ class _BuildMetaBackend:
|
||||
self, metadata_directory: str, config_settings: Mapping[str, Any] | None = None
|
||||
) -> str: ...
|
||||
def build_wheel(
|
||||
self, wheel_directory: str, config_settings: Mapping[str, Any] | None = None, metadata_directory: str | None = None
|
||||
self, wheel_directory: StrPath, config_settings: Mapping[str, Any] | None = None, metadata_directory: str | None = None
|
||||
) -> str: ...
|
||||
def build_sdist(self, sdist_directory: str, config_settings: Mapping[str, Any] | None = None) -> str: ...
|
||||
def build_sdist(self, sdist_directory: StrPath, config_settings: Mapping[str, Any] | None = None) -> str: ...
|
||||
def build_editable(
|
||||
self, wheel_directory: str, config_settings: Mapping[str, Any] | None = None, metadata_directory: str | None = None
|
||||
self, wheel_directory: StrPath, config_settings: Mapping[str, Any] | None = None, metadata_directory: str | None = None
|
||||
) -> str: ...
|
||||
def get_requires_for_build_editable(self, config_settings: Mapping[str, Any] | None = None) -> list[str]: ...
|
||||
def prepare_metadata_for_build_editable(
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
from _typeshed import Unused
|
||||
from _typeshed import StrPath, Unused
|
||||
from typing import Literal
|
||||
|
||||
from .._distutils.command import install_lib as orig
|
||||
@@ -8,8 +8,8 @@ class install_lib(orig.install_lib):
|
||||
def get_exclusions(self): ...
|
||||
def copy_tree(
|
||||
self,
|
||||
infile,
|
||||
outfile,
|
||||
infile: StrPath,
|
||||
outfile: str,
|
||||
preserve_mode: bool | Literal[0, 1] = 1,
|
||||
preserve_times: bool | Literal[0, 1] = 1,
|
||||
preserve_symlinks: bool | Literal[0, 1] = 0,
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
from typing import Any
|
||||
|
||||
from .._distutils.command import install_scripts as orig
|
||||
|
||||
class install_scripts(orig.install_scripts):
|
||||
no_ep: bool
|
||||
def initialize_options(self) -> None: ...
|
||||
outfiles: Any
|
||||
outfiles: list[str]
|
||||
def run(self) -> None: ...
|
||||
def write_script(self, script_name, contents, mode: str = "t", *ignored) -> None: ...
|
||||
|
||||
@@ -16,7 +16,7 @@ class StaticModule:
|
||||
def __getattr__(self, attr): ...
|
||||
|
||||
def glob_relative(patterns: Iterable[str], root_dir: StrPath | None = None) -> list[str]: ...
|
||||
def read_files(filepaths: str | bytes | Iterable[StrPath], root_dir: Incomplete | None = None) -> str: ...
|
||||
def read_files(filepaths: StrPath | Iterable[StrPath], root_dir: StrPath | None = None) -> str: ...
|
||||
def read_attr(attr_desc: str, package_dir: Mapping[str, str] | None = None, root_dir: StrPath | None = None): ...
|
||||
def resolve_class(
|
||||
qualified_class_name: str, package_dir: Mapping[str, str] | None = None, root_dir: StrPath | None = None
|
||||
|
||||
Reference in New Issue
Block a user