Detect PackageException errors in PlatformIO output. Returns: Tuple of (has_error, package_url_or_name)
(output: str)
| 132 | |
| 133 | |
| 134 | def detect_package_exception_in_output(output: str) -> tuple[bool, Optional[str]]: |
| 135 | """Detect PackageException errors in PlatformIO output. |
| 136 | |
| 137 | Returns: |
| 138 | Tuple of (has_error, package_url_or_name) |
| 139 | """ |
| 140 | if "PackageException" in output and "Could not install package" in output: |
| 141 | # Try to extract the package URL or name |
| 142 | match = re.search( |
| 143 | r"Could not install package\s*['\"]?([^'\"]+)['\"]?\s*for", output |
| 144 | ) |
| 145 | if match: |
| 146 | return True, match.group(1) |
| 147 | return True, None |
| 148 | return False, None |
| 149 | |
| 150 | |
| 151 | def aggressive_clean_pio_packages(paths: "FastLEDPaths", board_name: str) -> bool: |