Python: install lsp into tempdir for remote interpreters

Change-Id: I4b0b1a47c73742cc14f68d80b9116fcd51224bd1
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
David Schulz
2023-12-13 08:06:41 +01:00
parent 7a0cae607e
commit 4f857711c2
2 changed files with 22 additions and 17 deletions

View File

@@ -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);