@@ -318,7 +318,6 @@ def _get_package_info_from_llm(self, software: str, os_info: Dict[str, str]) ->
318318
319319 try :
320320 # Create a specific prompt for package information
321- distro = os_info .get ('distro' , 'Ubuntu' )
322321 distro_id = os_info .get ('distro_id' , 'ubuntu' )
323322
324323 prompt = f"""Get { software } package information for Linux { distro_id } .
@@ -466,7 +465,6 @@ def check_software(self, software_name: str) -> PackageInfo:
466465
467466 def calculate_requirements (self , software : str ) -> None :
468467 """Calculate installation requirements based on software to install"""
469- software_lower = software .lower ()
470468
471469 # Calculate total download and disk requirements
472470 total_download = 0
@@ -526,7 +524,7 @@ def run_all_checks(self, software: str = "docker") -> PreflightReport:
526524def format_report (report : PreflightReport , software : str ) -> str :
527525 """Format the preflight report for display"""
528526 lines = []
529- lines .append (f "\n 🔍 Simulation mode: No changes will be made\n " )
527+ lines .append ("\n 🔍 Simulation mode: No changes will be made\n " )
530528
531529 # Check if using estimates
532530 using_estimates = any ('estimate' in str (pkg .get ('size_mb' , '' )) for pkg in report .packages_to_install )
@@ -541,7 +539,7 @@ def format_report(report: PreflightReport, software: str) -> str:
541539
542540 # What would be installed
543541 if report .packages_to_install :
544- lines .append (f "\n Would install:" )
542+ lines .append ("\n Would install:" )
545543 for pkg in report .packages_to_install :
546544 lines .append (f" - { pkg ['name' ]} { pkg .get ('version' , '' )} ({ pkg .get ('size_mb' , '?' )} MB)" )
547545
@@ -595,11 +593,8 @@ def export_report(report: PreflightReport, filepath: str) -> None:
595593
596594 # Convert dataclass to dict
597595 report_dict = asdict (report )
598-
599- # Convert DiskInfo, PackageInfo, ServiceInfo to dicts
600- report_dict ['disk_usage' ] = [asdict (d ) for d in report .disk_usage ]
601- report_dict ['package_status' ] = [asdict (p ) for p in report .package_status ]
602- report_dict ['service_status' ] = [asdict (s ) for s in report .service_status ]
603-
596+
597+ # `asdict` already converts nested dataclasses recursively, so we can
598+ # directly write the result to JSON.
604599 with open (filepath , 'w' ) as f :
605600 json .dump (report_dict , f , indent = 2 )
0 commit comments