PY-85162 Pre-select tool based on existing envs and other markers

GitOrigin-RevId: 3047ea7b0c18bfd591e7551a90c027d543aa5c30
This commit is contained in:
Alexey Katsman
2025-11-24 19:21:50 +00:00
committed by intellij-monorepo-bot
parent a8e98b3613
commit 5fa4f67865
11 changed files with 109 additions and 16 deletions
@@ -63,7 +63,7 @@ import kotlin.io.path.name
@ApiStatus.Internal
class PyEnvironmentYmlSdkConfiguration : PyProjectSdkConfigurationExtension {
override val toolId: ToolId = ToolId("Conda")
override val toolId: ToolId = CONDA_TOOL_ID
override suspend fun checkEnvironmentAndPrepareSdkCreator(module: Module): CreateSdkInfo? = prepareSdkCreator(
{ checkManageableEnv(module, it) }
@@ -52,7 +52,7 @@ private val LOGGER = Logger.getInstance(PyPipfileSdkConfiguration::class.java)
@ApiStatus.Internal
class PyPipfileSdkConfiguration : PyProjectSdkConfigurationExtension {
override val toolId: ToolId = ToolId("pipenv")
override val toolId: ToolId = PIPENV_TOOL_ID
override suspend fun checkEnvironmentAndPrepareSdkCreator(module: Module): CreateSdkInfo? = prepareSdkCreator(
{ checkManageableEnv(module, it) }
@@ -26,7 +26,7 @@ class PyVenvSdkConfiguration : PyProjectSdkConfigurationExtension {
private val existingSdks by lazy { PythonSdkUtil.getAllSdks() }
private val context = UserDataHolderBase()
override val toolId: ToolId = ToolId("Venv")
override val toolId: ToolId = VENV_TOOL_ID
override suspend fun checkEnvironmentAndPrepareSdkCreator(module: Module): CreateSdkInfo? = prepareSdkCreator(
{ checkManageableEnv(module) }