forked from qt-creator/qt-creator
Python: install lsp into tempdir for remote interpreters
Change-Id: I4b0b1a47c73742cc14f68d80b9116fcd51224bd1 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
|
||||
#include "pythonplugin.h"
|
||||
#include "pythontr.h"
|
||||
#include "pythonutils.h"
|
||||
|
||||
#include <coreplugin/messagemanager.h>
|
||||
#include <coreplugin/progressmanager/progressmanager.h>
|
||||
@@ -80,10 +81,12 @@ void PipInstallTask::run()
|
||||
}
|
||||
}
|
||||
|
||||
if (!m_targetPath.isEmpty())
|
||||
arguments << "-t" << m_targetPath.toString();
|
||||
else if (!QDir(m_python.parentDir().toString()).exists("activate"))
|
||||
if (!m_targetPath.isEmpty()) {
|
||||
QTC_ASSERT(m_targetPath.isSameDevice(m_python), emit finished(false); return);
|
||||
arguments << "-t" << m_targetPath.path();
|
||||
} else if (!isVenvPython(m_python)) {
|
||||
arguments << "--user"; // add --user to global pythons, but skip it for venv pythons
|
||||
}
|
||||
|
||||
m_process.setCommand({m_python, arguments});
|
||||
m_process.setTerminalMode(TerminalMode::Run);
|
||||
|
||||
Reference in New Issue
Block a user