diff --git a/python/setup-test-environment/conda/src/com/intellij/python/community/testFramework/testEnv/conda/TypeConda.kt b/python/setup-test-environment/conda/src/com/intellij/python/community/testFramework/testEnv/conda/TypeConda.kt index f8f7db6225f2..3ee02bf7db6f 100644 --- a/python/setup-test-environment/conda/src/com/intellij/python/community/testFramework/testEnv/conda/TypeConda.kt +++ b/python/setup-test-environment/conda/src/com/intellij/python/community/testFramework/testEnv/conda/TypeConda.kt @@ -6,6 +6,7 @@ import com.intellij.openapi.diagnostic.logger import com.intellij.openapi.projectRoots.Sdk import com.intellij.python.community.testFramework.testEnv.PythonType import com.jetbrains.python.PythonBinary +import com.jetbrains.python.packaging.PyCondaPackageService import com.jetbrains.python.packaging.findCondaExecutableRelativeToEnv import com.jetbrains.python.sdk.conda.TargetEnvironmentRequestCommandExecutor import com.jetbrains.python.sdk.flavors.conda.PyCondaEnv @@ -14,6 +15,7 @@ import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.runBlocking import org.jetbrains.annotations.ApiStatus.Internal import java.nio.file.Path +import kotlin.io.path.pathString @Internal data object TypeConda : PythonType("conda") { @@ -23,6 +25,8 @@ data object TypeConda : PythonType("conda") { override suspend fun pythonPathToEnvironment(pythonBinary: PythonBinary, envDir: Path): Pair { // First, find python binary, then calculate conda from it as env stores "conda" as a regular env val condaPath = findCondaExecutableRelativeToEnv(pythonBinary) ?: error("Conda root $pythonBinary doesn't have conda binary") + // Save a path to conda because some legacy code might use it instead of a full conda path from additional data + PyCondaPackageService.onCondaEnvCreated(condaPath.pathString) // We'll remove then on close val condaEnvsBeforeTest = getCondaNames(condaPath)