mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-09 05:24:52 +08:00
Fill out more annotations for distutils & setuptools dist (#9895)
Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com> Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com> Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
This commit is contained in:
@@ -2,10 +2,14 @@ from _typeshed import FileDescriptorOrPath, Incomplete, SupportsWrite
|
||||
from collections.abc import Iterable, Mapping
|
||||
from distutils.cmd import Command
|
||||
from re import Pattern
|
||||
from typing import IO, Any
|
||||
from typing import IO, Any, ClassVar, TypeVar, overload
|
||||
from typing_extensions import TypeAlias
|
||||
|
||||
command_re: Pattern[str]
|
||||
|
||||
_OptionsList: TypeAlias = list[tuple[str, str | None, str, int] | tuple[str, str | None, str]]
|
||||
_CommandT = TypeVar("_CommandT", bound=Command)
|
||||
|
||||
class DistributionMetadata:
|
||||
def __init__(self, path: FileDescriptorOrPath | None = None) -> None: ...
|
||||
name: str | None
|
||||
@@ -59,22 +63,22 @@ class Distribution:
|
||||
def __init__(self, attrs: Mapping[str, Any] | None = None) -> None: ...
|
||||
def get_option_dict(self, command: str) -> dict[str, tuple[str, str]]: ...
|
||||
def parse_config_files(self, filenames: Iterable[str] | None = None) -> None: ...
|
||||
def get_command_obj(self, command: str, create: bool = ...) -> Command | None: ...
|
||||
global_options: Incomplete
|
||||
common_usage: str
|
||||
display_options: Incomplete
|
||||
display_option_names: Incomplete
|
||||
negative_opt: Incomplete
|
||||
def get_command_obj(self, command: str, create: bool = True) -> Command | None: ...
|
||||
global_options: ClassVar[_OptionsList]
|
||||
common_usage: ClassVar[str]
|
||||
display_options: ClassVar[_OptionsList]
|
||||
display_option_names: ClassVar[list[str]]
|
||||
negative_opt: ClassVar[dict[str, str]]
|
||||
verbose: int
|
||||
dry_run: int
|
||||
help: int
|
||||
command_packages: Incomplete
|
||||
script_name: Incomplete
|
||||
script_args: Incomplete
|
||||
command_options: Incomplete
|
||||
dist_files: Incomplete
|
||||
command_packages: list[str] | None
|
||||
script_name: str | None
|
||||
script_args: list[str] | None
|
||||
command_options: dict[str, dict[str, tuple[str, str]]]
|
||||
dist_files: list[tuple[str, str, str]]
|
||||
packages: Incomplete
|
||||
package_data: Incomplete
|
||||
package_data: dict[str, list[str]]
|
||||
package_dir: Incomplete
|
||||
py_modules: Incomplete
|
||||
libraries: Incomplete
|
||||
@@ -101,21 +105,24 @@ class Distribution:
|
||||
def print_commands(self) -> None: ...
|
||||
def get_command_list(self): ...
|
||||
def get_command_packages(self): ...
|
||||
def get_command_class(self, command): ...
|
||||
def reinitialize_command(self, command, reinit_subcommands: int = 0): ...
|
||||
def get_command_class(self, command: str) -> type[Command]: ...
|
||||
@overload
|
||||
def reinitialize_command(self, command: str, reinit_subcommands: bool = False) -> Command: ...
|
||||
@overload
|
||||
def reinitialize_command(self, command: _CommandT, reinit_subcommands: bool = False) -> _CommandT: ...
|
||||
def announce(self, msg, level: int = ...) -> None: ...
|
||||
def run_commands(self) -> None: ...
|
||||
def run_command(self, command) -> None: ...
|
||||
def has_pure_modules(self): ...
|
||||
def has_ext_modules(self): ...
|
||||
def has_c_libraries(self): ...
|
||||
def has_modules(self): ...
|
||||
def has_headers(self): ...
|
||||
def has_scripts(self): ...
|
||||
def has_data_files(self): ...
|
||||
def is_pure(self): ...
|
||||
def run_command(self, command: str) -> None: ...
|
||||
def has_pure_modules(self) -> bool: ...
|
||||
def has_ext_modules(self) -> bool: ...
|
||||
def has_c_libraries(self) -> bool: ...
|
||||
def has_modules(self) -> bool: ...
|
||||
def has_headers(self) -> bool: ...
|
||||
def has_scripts(self) -> bool: ...
|
||||
def has_data_files(self) -> bool: ...
|
||||
def is_pure(self) -> bool: ...
|
||||
|
||||
# Autogenerated getters
|
||||
# Getter methods generated in __init__
|
||||
def get_name(self) -> str: ...
|
||||
def get_version(self) -> str: ...
|
||||
def get_fullname(self) -> str: ...
|
||||
|
||||
Reference in New Issue
Block a user