| 498 | } |
| 499 | |
| 500 | void 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 | |
| 533 | QStringList QmitkPipInstaller::BuildPipArgs(const QStringList& baseArgs, const mitk::PipInstallGroup& group) const |
| 534 | { |
no test coverage detected