| 501 | } |
| 502 | |
| 503 | bool PackageManager::install_async(const std::string& package, |
| 504 | UvRunner::OutputCallback on_output, |
| 505 | UvRunner::CompletionCallback on_complete) { |
| 506 | if (!ensure_venv()) |
| 507 | return false; |
| 508 | |
| 509 | if (!m_runner) { |
| 510 | m_runner = std::make_unique<UvRunner>(); |
| 511 | } |
| 512 | |
| 513 | if (m_runner->is_running()) { |
| 514 | LOG_ERROR("Another UV operation is already running"); |
| 515 | return false; |
| 516 | } |
| 517 | |
| 518 | LOG_INFO("Installing {} (async)", package); |
| 519 | |
| 520 | m_runner->set_output_callback(std::move(on_output)); |
| 521 | m_runner->set_completion_callback(std::move(on_complete)); |
| 522 | |
| 523 | return m_runner->start({"pip", "install", package, "--python", lfs::core::path_to_utf8(venv_python())}); |
| 524 | } |
| 525 | |
| 526 | bool PackageManager::uninstall_async(const std::string& package, |
| 527 | UvRunner::OutputCallback on_output, |
nothing calls this directly
no test coverage detected