Install all required build dependencies
(self)
| 311 | self.installed_packages = {} |
| 312 | |
| 313 | def install_build_dependencies(self) -> bool: |
| 314 | """Install all required build dependencies""" |
| 315 | logger.step("Installing Build Dependencies") |
| 316 | |
| 317 | # Upgrade pip first |
| 318 | try: |
| 319 | run_command("python -m pip install --upgrade pip", timeout=120) |
| 320 | logger.success("pip upgraded successfully") |
| 321 | except BuildError as e: |
| 322 | logger.error(f"Failed to upgrade pip: {e}") |
| 323 | return False |
| 324 | |
| 325 | # Install dependencies |
| 326 | for category, deps in self.build_dependencies.items(): |
| 327 | logger.info(f"Installing {category} dependencies") |
| 328 | |
| 329 | for dep in deps: |
| 330 | try: |
| 331 | logger.info(f"Installing: {dep}") |
| 332 | run_command(f"pip install {dep}", timeout=180) |
| 333 | |
| 334 | # Verify installation |
| 335 | package_name = dep.split('>=')[0].split('==')[0] |
| 336 | result = run_command(f"pip show {package_name}", capture_output=True) |
| 337 | if result.returncode == 0: |
| 338 | for line in result.stdout.split('\n'): |
| 339 | if line.startswith('Version:'): |
| 340 | version = line.split(':', 1)[1].strip() |
| 341 | self.installed_packages[package_name] = version |
| 342 | logger.success(f"Installed {package_name} v{version}") |
| 343 | break |
| 344 | |
| 345 | except BuildError as e: |
| 346 | logger.error(f"Failed to install {dep}: {e}") |
| 347 | if category == 'core': |
| 348 | return False |
| 349 | logger.warning(f"Continuing without {dep}") |
| 350 | |
| 351 | logger.success(f"Dependencies installed: {len(self.installed_packages)} packages") |
| 352 | return True |
| 353 | |
| 354 | class PythonPackageBuilder: |
| 355 | """Professional Python package building""" |