Python: fix pyside tool detection

pip might return an incomplete list of files on Windows for
installations. So we need to manually check the Scripts
folder for the tools we are looking for.

Change-Id: I40778607fd2f2015059744f17a539ca381b85560
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
David Schulz
2022-06-02 14:40:11 +02:00
parent 47105360fa
commit ff8495b0a2

View File

@@ -229,6 +229,19 @@ void PythonRunConfiguration::currentInterpreterChanged()
}
}
// Workaround that pip might return an incomplete file list on windows
if (HostOsInfo::isWindowsHost() && !python.needsDevice()
&& !info.location.isEmpty() && m_pySideUicPath.isEmpty()) {
const FilePath scripts = info.location.parentDir().pathAppended("Scripts");
auto userInstalledPySideTool = [&](const QString &toolName) {
const FilePath tool = scripts.pathAppended(HostOsInfo::withExecutableSuffix(toolName));
return tool.isExecutableFile() ? tool : FilePath();
};
m_pySideUicPath = userInstalledPySideTool("pyside6-uic");
if (pySideProjectPath.isEmpty())
pySideProjectPath = userInstalledPySideTool("pyside6-project");
}
updateExtraCompilers();
if (auto pySideBuildStep = buildSteps->firstOfType<PySideBuildStep>())