From 02a8b8e3b6375e8bc64905e1ff4f71b76b57ef60 Mon Sep 17 00:00:00 2001 From: "Ilya.Kazakevich" Date: Mon, 18 Nov 2024 17:26:27 +0100 Subject: [PATCH] PY-71771: Do not validate SSH interpreters using tools for local paths. `isValidSdkHome` works for local paths only. We must use `sdkSeemsValid` instead: it is aware of remote interpreters and usually ignores them if can't validate (cherry picked from commit 31b42e14518f5a8f7a69ba35e50353f4f4894f42) IJ-CR-149658 GitOrigin-RevId: b30a6bb5d8a6b9986b0690eabbd0d39da6310f01 --- .../python/sdk/flavors/PythonSdkFlavor.java | 1 + .../run/AbstractPythonRunConfiguration.java | 3 ++- .../jetbrains/python/sdk/PythonSdkType.java | 25 ++++++++++++++++--- 3 files changed, 25 insertions(+), 4 deletions(-) diff --git a/python/python-sdk/src/com/jetbrains/python/sdk/flavors/PythonSdkFlavor.java b/python/python-sdk/src/com/jetbrains/python/sdk/flavors/PythonSdkFlavor.java index 1c0154e05450..f7c13f994a89 100644 --- a/python/python-sdk/src/com/jetbrains/python/sdk/flavors/PythonSdkFlavor.java +++ b/python/python-sdk/src/com/jetbrains/python/sdk/flavors/PythonSdkFlavor.java @@ -267,6 +267,7 @@ public abstract class PythonSdkFlavor { */ @Deprecated @Nullable + @RequiresBackgroundThread(generateAssertion = false) //No warning yet as there are usages: to be fixed public static PythonSdkFlavor getFlavor(@Nullable String sdkPath) { if (sdkPath == null || PythonSdkUtil.isCustomPythonSdkHomePath(sdkPath)) return null; return tryDetectFlavorByLocalPath(sdkPath); diff --git a/python/src/com/jetbrains/python/run/AbstractPythonRunConfiguration.java b/python/src/com/jetbrains/python/run/AbstractPythonRunConfiguration.java index 6db9065d7643..40fc072a19a0 100644 --- a/python/src/com/jetbrains/python/run/AbstractPythonRunConfiguration.java +++ b/python/src/com/jetbrains/python/run/AbstractPythonRunConfiguration.java @@ -27,6 +27,7 @@ import com.intellij.util.PlatformUtils; import com.intellij.util.xmlb.annotations.Transient; import com.jetbrains.python.PyBundle; import com.jetbrains.python.PythonModuleTypeBase; +import com.jetbrains.python.sdk.PySdkExtKt; import com.jetbrains.python.sdk.PythonEnvUtil; import com.jetbrains.python.sdk.PythonSdkType; import com.jetbrains.python.sdk.PythonSdkUtil; @@ -182,7 +183,7 @@ public abstract class AbstractPythonRunConfiguration