1
- from _typeshed import BytesPath , StrOrBytesPath , StrPath , Unused
2
1
from abc import abstractmethod
3
2
from collections .abc import Callable , Iterable
4
3
from typing import Any , ClassVar , Literal , TypeVar , overload
4
+
5
+ from _typeshed import BytesPath , StrOrBytesPath , StrPath , Unused
5
6
from typing_extensions import TypeVarTuple , Unpack
6
7
7
8
from .command .bdist import bdist
@@ -51,82 +52,140 @@ class Command:
51
52
def ensure_filename (self , option : str ) -> None : ...
52
53
def ensure_dirname (self , option : str ) -> None : ...
53
54
def get_command_name (self ) -> str : ...
54
- def set_undefined_options (self , src_cmd : str , * option_pairs : tuple [str , str ]) -> None : ...
55
+ def set_undefined_options (
56
+ self , src_cmd : str , * option_pairs : tuple [str , str ]
57
+ ) -> None : ...
55
58
# NOTE: This list comes directly from the distutils/command folder. Minus bdist_msi and bdist_wininst.
56
59
@overload
57
- def get_finalized_command (self , command : Literal ["bdist" ], create : bool = True ) -> bdist : ...
60
+ def get_finalized_command (
61
+ self , command : Literal ["bdist" ], create : bool = True
62
+ ) -> bdist : ...
58
63
@overload
59
- def get_finalized_command (self , command : Literal ["bdist_dumb" ], create : bool = True ) -> bdist_dumb : ...
64
+ def get_finalized_command (
65
+ self , command : Literal ["bdist_dumb" ], create : bool = True
66
+ ) -> bdist_dumb : ...
60
67
@overload
61
- def get_finalized_command (self , command : Literal ["bdist_rpm" ], create : bool = True ) -> bdist_rpm : ...
68
+ def get_finalized_command (
69
+ self , command : Literal ["bdist_rpm" ], create : bool = True
70
+ ) -> bdist_rpm : ...
62
71
@overload
63
- def get_finalized_command (self , command : Literal ["build" ], create : bool = True ) -> build : ...
72
+ def get_finalized_command (
73
+ self , command : Literal ["build" ], create : bool = True
74
+ ) -> build : ...
64
75
@overload
65
- def get_finalized_command (self , command : Literal ["build_clib" ], create : bool = True ) -> build_clib : ...
76
+ def get_finalized_command (
77
+ self , command : Literal ["build_clib" ], create : bool = True
78
+ ) -> build_clib : ...
66
79
@overload
67
- def get_finalized_command (self , command : Literal ["build_ext" ], create : bool = True ) -> build_ext : ...
80
+ def get_finalized_command (
81
+ self , command : Literal ["build_ext" ], create : bool = True
82
+ ) -> build_ext : ...
68
83
@overload
69
- def get_finalized_command (self , command : Literal ["build_py" ], create : bool = True ) -> build_py : ...
84
+ def get_finalized_command (
85
+ self , command : Literal ["build_py" ], create : bool = True
86
+ ) -> build_py : ...
70
87
@overload
71
- def get_finalized_command (self , command : Literal ["build_scripts" ], create : bool = True ) -> build_scripts : ...
88
+ def get_finalized_command (
89
+ self , command : Literal ["build_scripts" ], create : bool = True
90
+ ) -> build_scripts : ...
72
91
@overload
73
- def get_finalized_command (self , command : Literal ["check" ], create : bool = True ) -> check : ...
92
+ def get_finalized_command (
93
+ self , command : Literal ["check" ], create : bool = True
94
+ ) -> check : ...
74
95
@overload
75
- def get_finalized_command (self , command : Literal ["clean" ], create : bool = True ) -> clean : ...
96
+ def get_finalized_command (
97
+ self , command : Literal ["clean" ], create : bool = True
98
+ ) -> clean : ...
76
99
@overload
77
- def get_finalized_command (self , command : Literal ["config" ], create : bool = True ) -> config : ...
100
+ def get_finalized_command (
101
+ self , command : Literal ["config" ], create : bool = True
102
+ ) -> config : ...
78
103
@overload
79
- def get_finalized_command (self , command : Literal ["install" ], create : bool = True ) -> install : ...
104
+ def get_finalized_command (
105
+ self , command : Literal ["install" ], create : bool = True
106
+ ) -> install : ...
80
107
@overload
81
- def get_finalized_command (self , command : Literal ["install_data" ], create : bool = True ) -> install_data : ...
108
+ def get_finalized_command (
109
+ self , command : Literal ["install_data" ], create : bool = True
110
+ ) -> install_data : ...
82
111
@overload
83
112
def get_finalized_command (
84
113
self , command : Literal ["install_egg_info" ], create : bool = True
85
114
) -> install_egg_info : ...
86
115
@overload
87
- def get_finalized_command (self , command : Literal ["install_headers" ], create : bool = True ) -> install_headers : ...
116
+ def get_finalized_command (
117
+ self , command : Literal ["install_headers" ], create : bool = True
118
+ ) -> install_headers : ...
88
119
@overload
89
- def get_finalized_command (self , command : Literal ["install_lib" ], create : bool = True ) -> install_lib : ...
120
+ def get_finalized_command (
121
+ self , command : Literal ["install_lib" ], create : bool = True
122
+ ) -> install_lib : ...
90
123
@overload
91
- def get_finalized_command (self , command : Literal ["install_scripts" ], create : bool = True ) -> install_scripts : ...
124
+ def get_finalized_command (
125
+ self , command : Literal ["install_scripts" ], create : bool = True
126
+ ) -> install_scripts : ...
92
127
@overload
93
- def get_finalized_command (self , command : Literal ["register" ], create : bool = True ) -> register : ...
128
+ def get_finalized_command (
129
+ self , command : Literal ["register" ], create : bool = True
130
+ ) -> register : ...
94
131
@overload
95
- def get_finalized_command (self , command : Literal ["sdist" ], create : bool = True ) -> sdist : ...
132
+ def get_finalized_command (
133
+ self , command : Literal ["sdist" ], create : bool = True
134
+ ) -> sdist : ...
96
135
@overload
97
- def get_finalized_command (self , command : Literal ["upload" ], create : bool = True ) -> upload : ...
136
+ def get_finalized_command (
137
+ self , command : Literal ["upload" ], create : bool = True
138
+ ) -> upload : ...
98
139
@overload
99
140
def get_finalized_command (self , command : str , create : bool = True ) -> Command : ...
100
141
@overload
101
- def reinitialize_command (self , command : Literal ["bdist" ], reinit_subcommands : bool = False ) -> bdist : ...
142
+ def reinitialize_command (
143
+ self , command : Literal ["bdist" ], reinit_subcommands : bool = False
144
+ ) -> bdist : ...
102
145
@overload
103
146
def reinitialize_command (
104
147
self , command : Literal ["bdist_dumb" ], reinit_subcommands : bool = False
105
148
) -> bdist_dumb : ...
106
149
@overload
107
- def reinitialize_command (self , command : Literal ["bdist_rpm" ], reinit_subcommands : bool = False ) -> bdist_rpm : ...
150
+ def reinitialize_command (
151
+ self , command : Literal ["bdist_rpm" ], reinit_subcommands : bool = False
152
+ ) -> bdist_rpm : ...
108
153
@overload
109
- def reinitialize_command (self , command : Literal ["build" ], reinit_subcommands : bool = False ) -> build : ...
154
+ def reinitialize_command (
155
+ self , command : Literal ["build" ], reinit_subcommands : bool = False
156
+ ) -> build : ...
110
157
@overload
111
158
def reinitialize_command (
112
159
self , command : Literal ["build_clib" ], reinit_subcommands : bool = False
113
160
) -> build_clib : ...
114
161
@overload
115
- def reinitialize_command (self , command : Literal ["build_ext" ], reinit_subcommands : bool = False ) -> build_ext : ...
162
+ def reinitialize_command (
163
+ self , command : Literal ["build_ext" ], reinit_subcommands : bool = False
164
+ ) -> build_ext : ...
116
165
@overload
117
- def reinitialize_command (self , command : Literal ["build_py" ], reinit_subcommands : bool = False ) -> build_py : ...
166
+ def reinitialize_command (
167
+ self , command : Literal ["build_py" ], reinit_subcommands : bool = False
168
+ ) -> build_py : ...
118
169
@overload
119
170
def reinitialize_command (
120
171
self , command : Literal ["build_scripts" ], reinit_subcommands : bool = False
121
172
) -> build_scripts : ...
122
173
@overload
123
- def reinitialize_command (self , command : Literal ["check" ], reinit_subcommands : bool = False ) -> check : ...
174
+ def reinitialize_command (
175
+ self , command : Literal ["check" ], reinit_subcommands : bool = False
176
+ ) -> check : ...
124
177
@overload
125
- def reinitialize_command (self , command : Literal ["clean" ], reinit_subcommands : bool = False ) -> clean : ...
178
+ def reinitialize_command (
179
+ self , command : Literal ["clean" ], reinit_subcommands : bool = False
180
+ ) -> clean : ...
126
181
@overload
127
- def reinitialize_command (self , command : Literal ["config" ], reinit_subcommands : bool = False ) -> config : ...
182
+ def reinitialize_command (
183
+ self , command : Literal ["config" ], reinit_subcommands : bool = False
184
+ ) -> config : ...
128
185
@overload
129
- def reinitialize_command (self , command : Literal ["install" ], reinit_subcommands : bool = False ) -> install : ...
186
+ def reinitialize_command (
187
+ self , command : Literal ["install" ], reinit_subcommands : bool = False
188
+ ) -> install : ...
130
189
@overload
131
190
def reinitialize_command (
132
191
self , command : Literal ["install_data" ], reinit_subcommands : bool = False
@@ -148,20 +207,34 @@ class Command:
148
207
self , command : Literal ["install_scripts" ], reinit_subcommands : bool = False
149
208
) -> install_scripts : ...
150
209
@overload
151
- def reinitialize_command (self , command : Literal ["register" ], reinit_subcommands : bool = False ) -> register : ...
210
+ def reinitialize_command (
211
+ self , command : Literal ["register" ], reinit_subcommands : bool = False
212
+ ) -> register : ...
152
213
@overload
153
- def reinitialize_command (self , command : Literal ["sdist" ], reinit_subcommands : bool = False ) -> sdist : ...
214
+ def reinitialize_command (
215
+ self , command : Literal ["sdist" ], reinit_subcommands : bool = False
216
+ ) -> sdist : ...
154
217
@overload
155
- def reinitialize_command (self , command : Literal ["upload" ], reinit_subcommands : bool = False ) -> upload : ...
218
+ def reinitialize_command (
219
+ self , command : Literal ["upload" ], reinit_subcommands : bool = False
220
+ ) -> upload : ...
156
221
@overload
157
- def reinitialize_command (self , command : str , reinit_subcommands : bool = False ) -> Command : ...
222
+ def reinitialize_command (
223
+ self , command : str , reinit_subcommands : bool = False
224
+ ) -> Command : ...
158
225
@overload
159
- def reinitialize_command (self , command : _CommandT , reinit_subcommands : bool = False ) -> _CommandT : ...
226
+ def reinitialize_command (
227
+ self , command : _CommandT , reinit_subcommands : bool = False
228
+ ) -> _CommandT : ...
160
229
def run_command (self , command : str ) -> None : ...
161
230
def get_sub_commands (self ) -> list [str ]: ...
162
231
def warn (self , msg : str ) -> None : ...
163
232
def execute (
164
- self , func : Callable [[Unpack [_Ts ]], Unused ], args : tuple [Unpack [_Ts ]], msg : str | None = None , level : int = 1
233
+ self ,
234
+ func : Callable [[Unpack [_Ts ]], Unused ],
235
+ args : tuple [Unpack [_Ts ]],
236
+ msg : str | None = None ,
237
+ level : int = 1 ,
165
238
) -> None : ...
166
239
def mkpath (self , name : str , mode : int = 0o777 ) -> None : ...
167
240
@overload
@@ -194,10 +267,16 @@ class Command:
194
267
level : Unused = 1 ,
195
268
) -> list [str ]: ...
196
269
@overload
197
- def move_file (self , src : StrPath , dst : _StrPathT , level : Unused = 1 ) -> _StrPathT | str : ...
270
+ def move_file (
271
+ self , src : StrPath , dst : _StrPathT , level : Unused = 1
272
+ ) -> _StrPathT | str : ...
198
273
@overload
199
- def move_file (self , src : BytesPath , dst : _BytesPathT , level : Unused = 1 ) -> _BytesPathT | bytes : ...
200
- def spawn (self , cmd : Iterable [str ], search_path : bool = True , level : Unused = 1 ) -> None : ...
274
+ def move_file (
275
+ self , src : BytesPath , dst : _BytesPathT , level : Unused = 1
276
+ ) -> _BytesPathT | bytes : ...
277
+ def spawn (
278
+ self , cmd : Iterable [str ], search_path : bool = True , level : Unused = 1
279
+ ) -> None : ...
201
280
@overload
202
281
def make_archive (
203
282
self ,
0 commit comments