mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-04-18 20:41:22 +07:00
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:
committed by
intellij-monorepo-bot
parent
7aaceb5026
commit
f0ae385d6b
@@ -35,7 +35,6 @@ import javax.swing.*;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.io.OutputStream;
|
||||
import java.nio.charset.Charset;
|
||||
import java.nio.file.Path;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
@@ -219,12 +218,9 @@ public final class PySdkUtil {
|
||||
if (additionalData == null) {
|
||||
return Collections.emptyMap();
|
||||
}
|
||||
if (additionalData.getFlavorAndData().getFlavor().supportsVirtualEnvActivation()) {
|
||||
final Map<String, String> environment = activateVirtualEnv(sdkHome);
|
||||
sdk.putUserData(ENVIRONMENT_KEY, environment);
|
||||
return environment;
|
||||
}
|
||||
return Collections.emptyMap();
|
||||
final Map<String, String> environment = activateVirtualEnv(sdkHome);
|
||||
sdk.putUserData(ENVIRONMENT_KEY, environment);
|
||||
return environment;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -73,16 +73,6 @@ public abstract class PythonSdkFlavor<D extends PyFlavorData> {
|
||||
return (Class<D>)PyFlavorData.Empty.class;
|
||||
}
|
||||
|
||||
/**
|
||||
* Some flavours support virtual env activation: Intellij searches for activate(.bat) script and reads
|
||||
* envs from it. This is harmless and sometimes useful for virtualenvs, but severe for conda.
|
||||
* See inheritors docs.
|
||||
*/
|
||||
public boolean supportsVirtualEnvActivation() {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* On local targets some flavours could be detected. It returns path to python interpreters for such cases.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user