use of com.jetbrains.python.sdk.flavors.JythonSdkFlavor in project intellij-community by JetBrains.
the class PythonCommandLineState method collectPythonPath.
protected static Collection<String> collectPythonPath(Project project, PythonRunParams config, boolean isDebug) {
final Module module = getModule(project, config);
final HashSet<String> pythonPath = Sets.newHashSet(collectPythonPath(module, config.shouldAddContentRoots(), config.shouldAddSourceRoots()));
if (isDebug && PythonSdkFlavor.getFlavor(config.getSdkHome()) instanceof JythonSdkFlavor) {
//that fixes Jython problem changing sys.argv on execfile, see PY-8164
pythonPath.add(PythonHelpersLocator.getHelperPath("pycharm"));
pythonPath.add(PythonHelpersLocator.getHelperPath("pydev"));
}
return pythonPath;
}
use of com.jetbrains.python.sdk.flavors.JythonSdkFlavor in project intellij-community by JetBrains.
the class PyUnitTestTask method runConfiguration.
protected void runConfiguration(ConfigurationFactory factory, String sdkHome, final Project project) throws Exception {
final RunnerAndConfigurationSettings settings = RunManager.getInstance(project).createRunConfiguration("test", factory);
AbstractPythonLegacyTestRunConfiguration config = (AbstractPythonLegacyTestRunConfiguration) settings.getConfiguration();
config.setSdkHome(sdkHome);
config.setScriptName(getScriptName());
config.setWorkingDirectory(myFixture.getTempDirPath());
PythonSdkFlavor sdk = PythonSdkFlavor.getFlavor(sdkHome);
if (sdk instanceof JythonSdkFlavor) {
config.setInterpreterOptions(JythonSdkFlavor.getPythonPathCmdLineArgument(Lists.<String>newArrayList(myFixture.getTempDirPath())));
} else {
PythonEnvUtil.addToPythonPath(config.getEnvs(), myFixture.getTempDirPath());
}
configure(config);
new WriteAction() {
@Override
protected void run(@NotNull Result result) throws Throwable {
RunManagerEx.getInstanceEx(project).addConfiguration(settings, false);
RunManagerEx.getInstanceEx(project).setSelectedConfiguration(settings);
Assert.assertSame(settings, RunManagerEx.getInstanceEx(project).getSelectedConfiguration());
}
}.execute();
runConfiguration(settings, config);
}
Aggregations