@@ -234,11 +234,12 @@ def Sync(
234
234
@staticmethod
235
235
def Download (
236
236
cwd : PathLike ,
237
- reqFile : list [PathLike ],
238
237
executable : PathLike = sys .executable ,
239
238
extraUrl : Optional [str ] = None ,
240
239
noDeps : bool = False ,
241
240
out : Optional [PathLike ] = None ,
241
+ reqs : Optional [list [str ]] = None ,
242
+ reqFile : Optional [list [PathLike ]] = None ,
242
243
) -> subprocess .CompletedProcess [Any ]:
243
244
"""For now, the `download` cmd has no uv support, so use pip"""
244
245
cmd = [
@@ -248,12 +249,6 @@ def Download(
248
249
"download" ,
249
250
]
250
251
251
- if isinstance (reqFile , (str , Path )):
252
- cmd .extend (["-r" , str (reqFile )])
253
- elif isinstance (reqFile , list ):
254
- for rf in reqFile :
255
- cmd .extend (["-r" , str (rf )])
256
-
257
252
if extraUrl is not None :
258
253
cmd .extend (["--extra-index-url" , extraUrl ])
259
254
@@ -263,25 +258,32 @@ def Download(
263
258
if out is not None :
264
259
cmd .extend (["-d" , str (out )])
265
260
261
+ if reqs is not None :
262
+ cmd .extend (reqs )
263
+
264
+ if reqFile is not None :
265
+ for rf in reqFile :
266
+ cmd .extend (["--requirement" , rf ])
267
+
266
268
return _check_call (cmd , cwd )
267
269
268
270
@staticmethod
269
271
def Wheel (
270
272
cwd : PathLike ,
271
- reqFile : list [PathLike ],
272
273
executable : PathLike = sys .executable ,
273
274
extraUrl : Optional [str ] = None ,
274
275
noDeps : bool = False ,
275
276
out : Optional [PathLike ] = None ,
277
+ reqs : Optional [list [str ]] = None ,
278
+ reqFile : Optional [list [PathLike ]] = None ,
276
279
) -> subprocess .CompletedProcess [Any ]:
277
280
"""For now, the `wheel` cmd has no uv support, so use pip"""
278
- cmd = [str (executable ), "-m" , "pip" , "wheel" ]
279
-
280
- if isinstance (reqFile , (str , Path )):
281
- cmd .extend (["-r" , str (reqFile )])
282
- elif isinstance (reqFile , list ):
283
- for rf in reqFile :
284
- cmd .extend (["-r" , str (rf )])
281
+ cmd = [
282
+ str (executable ),
283
+ "-m" ,
284
+ "pip" ,
285
+ "wheel" ,
286
+ ]
285
287
286
288
if extraUrl is not None :
287
289
cmd .extend (["--extra-index-url" , extraUrl ])
@@ -292,6 +294,13 @@ def Wheel(
292
294
if out is not None :
293
295
cmd .extend (["-w" , str (out )])
294
296
297
+ if reqs is not None :
298
+ cmd .extend (reqs )
299
+
300
+ if reqFile is not None :
301
+ for rf in reqFile :
302
+ cmd .extend (["--requirement" , rf ])
303
+
295
304
return _check_call (cmd , cwd )
296
305
297
306
@staticmethod
0 commit comments