MCPcopy Create free account
hub / github.com/MITK/MITK / StartResolveGroup

Method StartResolveGroup

Modules/PythonInstaller/src/QmitkPipInstaller.cpp:456–498  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

454}
455
456void QmitkPipInstaller::StartResolveGroup()
457{
458 const auto python = this->RequirePythonExecutable();
459
460 if (python.isEmpty())
461 return;
462
463 if (m_CurrentGroup >= static_cast<int>(m_Groups.size()))
464 {
465 this->BeginPostInstallPhase();
466 return;
467 }
468
469 m_GroupStartIndex = static_cast<int>(m_ResolvedPackages.size());
470 const auto& group = m_Groups[m_CurrentGroup];
471
472 // m_ReportFile is reused across groups: the underlying temp file path is
473 // stable for the lifetime of this QmitkPipInstaller, but we close the Qt
474 // handle each time so pip can write to the path freely. The file is deleted
475 // when the QTemporaryFile object is destroyed.
476 m_ReportFile.close();
477
478 if (!m_ReportFile.open())
479 {
480 m_State = State::Failed;
481 emit ErrorOccurred("Could not create temporary file for pip report.");
482 emit InstallFinished(false);
483 return;
484 }
485
486 const auto reportPath = m_ReportFile.fileName();
487 m_ReportFile.close();
488
489 QStringList args = { "-m", "pip", "install", "--dry-run", "--report", reportPath };
490 args = this->BuildPipArgs(args, group);
491
492 for (const auto& req : group.requirements)
493 args.append(QString::fromStdString(req));
494
495 m_State = State::Resolving;
496 MITK_INFO << FormatCommand(python, args).toStdString();
497 m_Process->start(python, args);
498}
499
500void QmitkPipInstaller::StartInstallPackage()
501{

Callers 3

OnProcessFinishedMethod · 0.95
BeginVirtualEnvPhaseMethod · 0.95
AdvanceToNextGroupMethod · 0.95

Calls 8

BeginPostInstallPhaseMethod · 0.95
BuildPipArgsMethod · 0.95
FormatCommandFunction · 0.85
closeMethod · 0.80
sizeMethod · 0.45
openMethod · 0.45
startMethod · 0.45

Tested by

no test coverage detected