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

Method StartInstallPackage

Modules/PythonInstaller/src/QmitkPipInstaller.cpp:500–531  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

498}
499
500void QmitkPipInstaller::StartInstallPackage()
501{
502 const auto python = this->RequirePythonExecutable();
503
504 if (python.isEmpty())
505 return;
506
507 if (m_CurrentPackage >= static_cast<int>(m_ResolvedPackages.size()))
508 {
509 this->BeginPostInstallPhase();
510 return;
511 }
512
513 const auto& pkg = m_ResolvedPackages[m_CurrentPackage];
514 emit PackageStatusChanged(m_CurrentPackage, QString::fromStdString(pkg.name), mitk::PackageStatus::Installing);
515
516 const auto& group = m_Groups[pkg.group];
517
518 // Direct references (VCS URLs, PEP 508 "name @ url") must be passed as-is
519 // so pip fetches from the URL instead of searching PyPI for name==version.
520 QString installArg;
521 if (!pkg.specifier.empty() && IsDirectReference(pkg.specifier))
522 installArg = QString::fromStdString(pkg.specifier);
523 else
524 installArg = QString::fromStdString(pkg.name) + "==" + QString::fromStdString(pkg.version);
525
526 QStringList args = { "-m", "pip", "install", "--no-deps", installArg };
527 args = this->BuildPipArgs(args, group);
528
529 MITK_INFO << FormatCommand(python, args).toStdString();
530 m_Process->start(python, args);
531}
532
533QStringList QmitkPipInstaller::BuildPipArgs(const QStringList& baseArgs, const mitk::PipInstallGroup& group) const
534{

Callers 1

OnProcessFinishedMethod · 0.95

Calls 8

BeginPostInstallPhaseMethod · 0.95
BuildPipArgsMethod · 0.95
IsDirectReferenceFunction · 0.85
FormatCommandFunction · 0.85
sizeMethod · 0.45
emptyMethod · 0.45
startMethod · 0.45

Tested by

no test coverage detected