13 #ifndef QmitkPipInstaller_h
14 #define QmitkPipInstaller_h
20 #include <QTemporaryFile>
174 void OnStandardOutputReady();
175 void OnStandardErrorReady();
176 void OnProcessFinished(
int exitCode, QProcess::ExitStatus exitStatus);
192 void BeginVirtualEnvPhase();
193 void StartPipUpgrade();
194 void StartResolveGroup();
195 void StartInstallPackage();
196 void BeginPostInstallPhase();
197 void StartPostInstallStep();
199 void AdvanceToNextGroup();
200 bool ParseResolveReport(
const QString& reportPath,
int groupIndex);
201 QString PythonExecutable()
const;
202 QString RequirePythonExecutable();
203 void FinalizeCancel();
204 void RemoveCreatedVirtualEnv();
212 std::vector<mitk::PipInstallGroup> m_Groups;
213 std::vector<mitk::PipPackageInfo> m_ResolvedPackages;
215 QProcess* m_Process =
nullptr;
216 State m_State = State::Idle;
217 bool m_AnyFailed =
false;
218 bool m_CreatedVirtualEnv =
false;
220 int m_CurrentGroup = 0;
221 int m_CurrentPackage = 0;
222 int m_GroupStartIndex = 0;
223 int m_CurrentPostInstallStep = 0;
225 QTemporaryFile m_ReportFile;
#define MITKPYTHONINSTALLER_EXPORT
Headless pip installer with structured progress reporting.
void PackageStatusChanged(int index, const QString &name, mitk::PackageStatus status)
Emitted when a package's installation status changes.
void OutputReceived(const QString &text, bool isError)
Raw process output for display in a details view.
void ProgressChanged(int current, int total)
Per-package progress during the install phase only.
void AbandonInstall()
Tear down anything this installer created during a failed install.
void SetInstallSpec(const mitk::PipInstallSpec &spec)
Set the installation specification.
void ErrorOccurred(const QString &message)
Emitted on fatal errors (e.g. Python executable not found).
void PostInstallStepStarted(const QString &displayName)
Emitted when a post-install step starts.
void StartInstall()
Start the installation.
bool IsRunning() const
Whether an operation is currently running.
void Cancel()
Cancel the current operation.
void VirtualEnvCreationStarted()
Emitted when virtual environment creation starts.
const std::vector< mitk::PipPackageInfo > & GetResolvedPackages() const
The full list of resolved packages across all groups.
void ResolveStarted()
Emitted when resolution of a group starts.
void PipUpgradeStarted()
Emitted when the pip upgrade step starts.
~QmitkPipInstaller() override
void InstallFinished(bool success)
Emitted when the installation terminates.
QmitkPipInstaller(QObject *parent=nullptr)
PackageStatus
Status of a single package during installation.
A set of packages that share the same pip options.
Full specification for a pip installation run.