forked from qt-creator/qt-creator
Python: show warnings if pip or venv is missing
Change-Id: Ib38c1eb3b0f31d6988d3a5f084ac6eda08ec0619 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -192,4 +192,20 @@ bool isVenvPython(const Utils::FilePath &python)
|
||||
return python.parentDir().parentDir().contains("pyvenv.cfg");
|
||||
}
|
||||
|
||||
bool venvIsUsable(const Utils::FilePath &python)
|
||||
{
|
||||
Process process;
|
||||
process.setCommand({python, QStringList{"-m", "venv", "-h"}});
|
||||
process.runBlocking();
|
||||
return process.result() == ProcessResult::FinishedWithSuccess;
|
||||
}
|
||||
|
||||
bool pipIsUsable(const Utils::FilePath &python)
|
||||
{
|
||||
Process process;
|
||||
process.setCommand({python, QStringList{"-m", "pip", "-V"}});
|
||||
process.runBlocking();
|
||||
return process.result() == ProcessResult::FinishedWithSuccess;
|
||||
}
|
||||
|
||||
} // Python::Internal
|
||||
|
||||
Reference in New Issue
Block a user