@@ -2,10 +2,14 @@ from _typeshed import FileDescriptorOrPath, Incomplete, SupportsWrite
22from collections .abc import Iterable , Mapping
33from distutils .cmd import Command
44from re import Pattern
5- from typing import IO , Any
5+ from typing import IO , Any , ClassVar , TypeVar , overload
6+ from typing_extensions import TypeAlias
67
78command_re : Pattern [str ]
89
10+ _OptionsList : TypeAlias = list [tuple [str , str | None , str , int ] | tuple [str , str | None , str ]]
11+ _CommandT = TypeVar ("_CommandT" , bound = Command )
12+
913class DistributionMetadata :
1014 def __init__ (self , path : FileDescriptorOrPath | None = None ) -> None : ...
1115 name : str | None
@@ -59,22 +63,22 @@ class Distribution:
5963 def __init__ (self , attrs : Mapping [str , Any ] | None = None ) -> None : ...
6064 def get_option_dict (self , command : str ) -> dict [str , tuple [str , str ]]: ...
6165 def parse_config_files (self , filenames : Iterable [str ] | None = None ) -> None : ...
62- def get_command_obj (self , command : str , create : bool = ... ) -> Command | None : ...
63- global_options : Incomplete
64- common_usage : str
65- display_options : Incomplete
66- display_option_names : Incomplete
67- negative_opt : Incomplete
66+ def get_command_obj (self , command : str , create : bool = True ) -> Command | None : ...
67+ global_options : ClassVar [ _OptionsList ]
68+ common_usage : ClassVar [ str ]
69+ display_options : ClassVar [ _OptionsList ]
70+ display_option_names : ClassVar [ list [ str ]]
71+ negative_opt : ClassVar [ dict [ str , str ]]
6872 verbose : int
6973 dry_run : int
7074 help : int
71- command_packages : Incomplete
72- script_name : Incomplete
73- script_args : Incomplete
74- command_options : Incomplete
75- dist_files : Incomplete
75+ command_packages : list [ str ] | None
76+ script_name : str | None
77+ script_args : list [ str ] | None
78+ command_options : dict [ str , dict [ str , tuple [ str , str ]]]
79+ dist_files : list [ tuple [ str , str , str ]]
7680 packages : Incomplete
77- package_data : Incomplete
81+ package_data : dict [ str , list [ str ]]
7882 package_dir : Incomplete
7983 py_modules : Incomplete
8084 libraries : Incomplete
@@ -101,21 +105,24 @@ class Distribution:
101105 def print_commands (self ) -> None : ...
102106 def get_command_list (self ): ...
103107 def get_command_packages (self ): ...
104- def get_command_class (self , command ): ...
105- def reinitialize_command (self , command , reinit_subcommands : int = 0 ): ...
108+ def get_command_class (self , command : str ) -> type [Command ]: ...
109+ @overload
110+ def reinitialize_command (self , command : str , reinit_subcommands : bool = False ) -> Command : ...
111+ @overload
112+ def reinitialize_command (self , command : _CommandT , reinit_subcommands : bool = False ) -> _CommandT : ...
106113 def announce (self , msg , level : int = ...) -> None : ...
107114 def run_commands (self ) -> None : ...
108- def run_command (self , command ) -> None : ...
109- def has_pure_modules (self ): ...
110- def has_ext_modules (self ): ...
111- def has_c_libraries (self ): ...
112- def has_modules (self ): ...
113- def has_headers (self ): ...
114- def has_scripts (self ): ...
115- def has_data_files (self ): ...
116- def is_pure (self ): ...
115+ def run_command (self , command : str ) -> None : ...
116+ def has_pure_modules (self ) -> bool : ...
117+ def has_ext_modules (self ) -> bool : ...
118+ def has_c_libraries (self ) -> bool : ...
119+ def has_modules (self ) -> bool : ...
120+ def has_headers (self ) -> bool : ...
121+ def has_scripts (self ) -> bool : ...
122+ def has_data_files (self ) -> bool : ...
123+ def is_pure (self ) -> bool : ...
117124
118- # Autogenerated getters
125+ # Getter methods generated in __init__
119126 def get_name (self ) -> str : ...
120127 def get_version (self ) -> str : ...
121128 def get_fullname (self ) -> str : ...
0 commit comments