Python: Fix scripts path to global/venv pyside installations

... when checking for pyside tools.

Change-Id: I1aaac9dd9da76f08ada031cc88761dba36c4e3b6
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
David Schulz
2022-06-20 13:55:25 +02:00
parent 3b0add4b16
commit ca47064020

View File

@@ -236,7 +236,12 @@ void PythonRunConfiguration::currentInterpreterChanged()
// Workaround that pip might return an incomplete file list on windows // Workaround that pip might return an incomplete file list on windows
if (HostOsInfo::isWindowsHost() && !python.needsDevice() if (HostOsInfo::isWindowsHost() && !python.needsDevice()
&& !info.location.isEmpty() && m_pySideUicPath.isEmpty()) { && !info.location.isEmpty() && m_pySideUicPath.isEmpty()) {
const FilePath scripts = info.location.parentDir().pathAppended("Scripts"); // Scripts is next to the site-packages install dir for user installations
FilePath scripts = info.location.parentDir().pathAppended("Scripts");
if (!scripts.exists()) {
// in global/venv installations Scripts is next to Lib/site-packages
scripts = info.location.parentDir().parentDir().pathAppended("Scripts");
}
auto userInstalledPySideTool = [&](const QString &toolName) { auto userInstalledPySideTool = [&](const QString &toolName) {
const FilePath tool = scripts.pathAppended(HostOsInfo::withExecutableSuffix(toolName)); const FilePath tool = scripts.pathAppended(HostOsInfo::withExecutableSuffix(toolName));
return tool.isExecutableFile() ? tool : FilePath(); return tool.isExecutableFile() ? tool : FilePath();