| 433 | |
| 434 | |
| 435 | def collect_executable_summary( |
| 436 | *, |
| 437 | executables: Iterable[ExecutableSpec | str] | None = None, |
| 438 | include_paths: bool = True, |
| 439 | ) -> dict[str, str]: |
| 440 | specs = _normalize_executable_specs(executables) |
| 441 | summary: dict[str, str] = {} |
| 442 | |
| 443 | for spec in specs: |
| 444 | key = spec.key |
| 445 | command = spec.resolved_command() |
| 446 | summary[key] = _command_version(command, spec.version_args) |
| 447 | if include_paths: |
| 448 | summary[f"{key}_path"] = _safe_tail(_which(command)) |
| 449 | |
| 450 | return summary |
| 451 | |
| 452 | |
| 453 | # -------------------------- |