MCPcopy Create free account
hub / github.com/FastLED/FastLED / process_package_request

Function process_package_request

ci/util/pio_package_daemon.py:571–713  ·  view source on GitHub ↗

Execute package installation request. Args: request: PackageRequest object with project_dir and optional environment Returns: True if installation successful, False otherwise

(request: PackageRequest)

Source from the content-addressed store, hash-verified

569
570
571def process_package_request(request: PackageRequest) -> bool:
572 """Execute package installation request.
573
574 Args:
575 request: PackageRequest object with project_dir and optional environment
576
577 Returns:
578 True if installation successful, False otherwise
579 """
580 project_dir = request.project_dir
581 environment = request.environment
582 caller_pid = request.caller_pid
583 caller_cwd = request.caller_cwd
584
585 # If no environment specified, use default_envs from platformio.ini
586 # This prevents PlatformIO from installing packages for ALL environments
587 if not environment:
588 environment = get_default_environment(project_dir)
589 if environment:
590 logging.info(
591 f"Using default environment from platformio.ini: {environment}"
592 )
593 else:
594 logging.warning(
595 "No default_envs found in platformio.ini, will install for all environments"
596 )
597
598 env_desc = environment if environment else "all environments"
599 logging.info(f"Processing package install request: {env_desc} in {project_dir}")
600
601 # Check disk space before installation
602 pio_packages_dir = Path.home() / ".platformio"
603 has_space, error_msg = check_disk_space(pio_packages_dir, required_mb=1000)
604 if not has_space:
605 logging.error(f"Disk space check failed: {error_msg}")
606 update_status(DaemonState.FAILED, error_msg)
607 return False
608
609 update_status(
610 DaemonState.INSTALLING,
611 f"Installing packages for {env_desc}",
612 environment=environment,
613 project_dir=project_dir,
614 request_started_at=time.time(),
615 caller_pid=caller_pid,
616 caller_cwd=caller_cwd,
617 )
618
619 # Build command - omit --environment if None to use PlatformIO default
620 cmd = [
621 "pio",
622 "pkg",
623 "install",
624 "--project-dir",
625 project_dir,
626 ]
627
628 if environment:

Callers 1

run_daemon_loopFunction · 0.85

Calls 11

check_all_packagesFunction · 0.90
get_default_environmentFunction · 0.85
check_disk_spaceFunction · 0.85
update_statusFunction · 0.85
is_network_errorFunction · 0.85
warningMethod · 0.80
timeMethod · 0.80
infoMethod · 0.45
errorMethod · 0.45

Tested by

no test coverage detected