@@ -286,18 +286,18 @@ def _get_installed_uv_packages():
286
286
for p in packages :
287
287
result [p ["name" ].lower ()] = pepver_to_semver (p ["version" ])
288
288
else :
289
- print (f"Warning : uv pip list failed with exit code { result_obj .returncode } " )
289
+ print (f"Error : uv pip list failed with exit code { result_obj .returncode } " )
290
290
if result_obj .stderr :
291
291
print (f"Error output: { result_obj .stderr .strip ()} " )
292
292
293
293
except subprocess .TimeoutExpired :
294
- print ("Warning : uv pip list command timed out" )
294
+ print ("Error : uv pip list command timed out" )
295
295
except (json .JSONDecodeError , KeyError ) as e :
296
- print (f"Warning : Could not parse package list: { e } " )
296
+ print (f"Error : Could not parse package list: { e } " )
297
297
except FileNotFoundError :
298
- print ("Warning : uv command not found" )
298
+ print ("Error : uv command not found" )
299
299
except Exception as e :
300
- print (f"Warning ! Couldn't extract the list of installed Python packages: { e } " )
300
+ print (f"Error ! Couldn't extract the list of installed Python packages: { e } " )
301
301
302
302
return result
303
303
@@ -306,39 +306,39 @@ def _get_installed_uv_packages():
306
306
307
307
if packages_to_install :
308
308
packages_list = []
309
+ package_map = {}
309
310
for p in packages_to_install :
310
311
spec = python_deps [p ]
311
312
if spec .startswith (('http://' , 'https://' , 'git+' , 'file://' )):
312
313
packages_list .append (spec )
314
+ package_map [spec ] = p
313
315
else :
314
- packages_list .append (f"{ p } { spec } " )
315
-
316
- cmd = [
317
- penv_uv_executable , "pip" , "install" ,
318
- f"--python={ python_exe } " ,
319
- "--quiet" , "--upgrade"
320
- ] + packages_list
316
+ full_spec = f"{ p } { spec } "
317
+ packages_list .append (full_spec )
318
+ package_map [full_spec ] = p
321
319
322
- try :
323
- subprocess .check_call (
324
- cmd ,
325
- stdout = subprocess .DEVNULL ,
326
- stderr = subprocess .STDOUT ,
327
- timeout = 300
328
- )
329
-
330
- except subprocess .CalledProcessError as e :
331
- print (f"Error: Failed to install Python dependencies (exit code: { e .returncode } )" )
332
- return False
333
- except subprocess .TimeoutExpired :
334
- print ("Error: Python dependencies installation timed out" )
335
- return False
336
- except FileNotFoundError :
337
- print ("Error: uv command not found" )
338
- return False
339
- except Exception as e :
340
- print (f"Error installing Python dependencies: { e } " )
341
- return False
320
+ for package_spec in packages_list :
321
+ cmd = [
322
+ penv_uv_executable , "pip" , "install" ,
323
+ f"--python={ python_exe } " ,
324
+ "--quiet" , "--upgrade" ,
325
+ package_spec
326
+ ]
327
+ try :
328
+ subprocess .check_call (
329
+ cmd ,
330
+ stdout = subprocess .DEVNULL ,
331
+ stderr = subprocess .STDOUT ,
332
+ timeout = 300
333
+ )
334
+ except subprocess .CalledProcessError as e :
335
+ print (f"Error: Installing package '{ package_map .get (package_spec , package_spec )} ' failed (exit code { e .returncode } )." )
336
+ except subprocess .TimeoutExpired :
337
+ print (f"Error: Installing package '{ package_map .get (package_spec , package_spec )} ' timed out." )
338
+ except FileNotFoundError :
339
+ print ("Error: uv command not found" )
340
+ except Exception as e :
341
+ print (f"Error: Installing package '{ package_map .get (package_spec , package_spec )} ': { e } ." )
342
342
343
343
return True
344
344
0 commit comments