in src/main/groovy/com/jetbrains/python/envs/PythonEnvsPlugin.groovy [51:83]
private static File getExecutable(String executable, Python env = null, File dir = null, EnvType type = null) {
String pathString
switch (type ?: env.type) {
case [EnvType.PYTHON, EnvType.CONDA]:
if (executable in ["pip", "virtualenv", "conda"]) {
pathString = isWindows ? "Scripts/${executable}.exe" : "bin/${executable}"
} else if (executable.startsWith("python")) {
pathString = isWindows ? "${executable}.exe" : "bin/${executable}"
} else {
throw new RuntimeException("$executable is not supported for $env.type yet")
}
break
case [EnvType.JYTHON, EnvType.PYPY]:
if (env.type == EnvType.JYTHON && executable == "python") executable = "jython"
pathString = "bin/${executable}${isWindows ? '.exe' : ''}"
break
case EnvType.IRONPYTHON:
if (executable in ["ipy", "python"] ) {
pathString = "net45/${env.is64 ? "ipy.exe" : "ipy32.exe"}"
} else {
pathString = "Scripts/${executable}.exe"
}
break
case EnvType.VIRTUALENV:
pathString = isWindows ? "Scripts/${executable}.exe" : "bin/${executable}"
break
default:
throw new RuntimeException("$env.type env type is not supported yet")
}
return new File(dir ?: env.envDir, pathString)
}