DS-3992: Activate local conda as virtual env (as we're done before).

This is a quick-and-dirty for terminals. Regular conda execution shouldn't be affected since we store python path in ``homePath`` now.

With this change, ``activate.bat`` read by IJ and vars (including ``PATH``) are passed to the terminal

GitOrigin-RevId: 711e5ea84519894ad3779626d4411196abb5a6b6
This commit is contained in:
Ilya.Kazakevich
2022-11-03 20:15:11 +01:00
committed by intellij-monorepo-bot
parent 7aaceb5026
commit f0ae385d6b
4 changed files with 9 additions and 26 deletions

View File

@@ -4,6 +4,7 @@ package com.jetbrains.python.sdk
import com.intellij.openapi.components.PersistentStateComponent
import com.intellij.openapi.components.State
import com.intellij.openapi.components.Storage
import com.intellij.openapi.diagnostic.Logger
import com.intellij.openapi.diagnostic.logger
import com.intellij.openapi.options.UnnamedConfigurable
import com.intellij.openapi.project.Project
@@ -97,7 +98,11 @@ class PyVirtualEnvTerminalCustomizer : LocalTerminalCustomizer() {
}
else {
//for other shells we read envs from activate script by the default shell and pass them to the process
envs.putAll(PySdkUtil.activateVirtualEnv(sdk))
val envVars = PySdkUtil.activateVirtualEnv(sdk)
if (envVars.isEmpty()) {
Logger.getInstance(PyVirtualEnvTerminalCustomizer::class.java).warn("No vars found to activate in ${sdk.homePath}")
}
envs.putAll(envVars)
}
}
}