[python] executable cache in PythonSdkFlavor prevents from validating newly installed conda (PY-63084)

(cherry picked from commit 2b7e6c361fd1429f0ce94d271214c5e1f5bca23b)

IJ-MR-129618

GitOrigin-RevId: 55551e94e651a953863e0766419e881220c0a45b
This commit is contained in:
Aleksei Kniazev
2024-03-21 14:06:13 +01:00
committed by intellij-monorepo-bot
parent 8cd2f21240
commit 984183cbea
2 changed files with 6 additions and 0 deletions

View File

@@ -199,6 +199,10 @@ public abstract class PythonSdkFlavor<D extends PyFlavorData> {
}
}
public static void clearExecutablesCache() {
ourExecutableFiles.invalidateAll();
}
@NotNull
private static String getIdForCache(@NotNull String fullPath, @Nullable TargetEnvironmentConfiguration configuration) {
var builder = new StringBuilder(fullPath);

View File

@@ -42,6 +42,7 @@ import com.jetbrains.python.sdk.add.v2.PythonInterpreterSelectionMethod.SELECT_E
import com.jetbrains.python.sdk.add.v2.PythonInterpreterSelectionMode.CUSTOM
import com.jetbrains.python.sdk.add.v2.PythonSupportedEnvironmentManagers.VIRTUALENV
import com.jetbrains.python.sdk.conda.CondaInstallManager
import com.jetbrains.python.sdk.flavors.PythonSdkFlavor
import com.jetbrains.python.sdk.flavors.conda.PyCondaEnv
import com.jetbrains.python.sdk.flavors.conda.PyCondaEnvIdentity
import kotlinx.coroutines.CoroutineScope
@@ -375,6 +376,7 @@ fun Panel.executableSelector(executable: ObservableMutableProperty<String>,
internal fun createInstallCondaFix(presenter: PythonAddInterpreterPresenter): ActionLink {
return ActionLink(message("sdk.create.conda.install.fix")) {
PythonSdkFlavor.clearExecutablesCache()
CondaInstallManager.installLatest(null)
presenter.scope.launch(presenter.uiContext) {
presenter.reloadConda(presenter.projectLocationContext)