(
+ "Pythonid.execService.targetEnvironmentRequestHandler"
+ )
+
+ @JvmStatic
+ @ApiStatus.Internal
+ fun getHandler(request: TargetEnvironmentRequest): TargetEnvironmentRequestHandler {
+ val handler = EP_NAME.extensionList.firstOrNull { it.isApplicable(request) }
+ ?: error("No implementation of [${TargetEnvironmentRequestHandler::class.java}] is found for $request, bundle is broken?")
+ return handler
+ }
+ }
+}
diff --git a/python/src/com/jetbrains/python/run/PythonInterpreterTargetEnvironmentFactory.kt b/python/src/com/jetbrains/python/run/PythonInterpreterTargetEnvironmentFactory.kt
index 403bf993afde..cdcd989d4777 100644
--- a/python/src/com/jetbrains/python/run/PythonInterpreterTargetEnvironmentFactory.kt
+++ b/python/src/com/jetbrains/python/run/PythonInterpreterTargetEnvironmentFactory.kt
@@ -15,11 +15,12 @@ import com.intellij.openapi.project.Project
import com.intellij.openapi.projectRoots.Sdk
import com.intellij.ui.dsl.builder.Panel
import com.jetbrains.python.remote.PyRemoteSdkAdditionalDataBase
+import com.jetbrains.python.run.PythonInterpreterTargetEnvironmentFactory.Companion.isPackageManagementSupported
import com.jetbrains.python.run.target.HelpersAwareLocalTargetEnvironmentRequest
import com.jetbrains.python.run.target.HelpersAwareTargetEnvironmentRequest
-import com.jetbrains.python.target.ui.TargetPanelExtension
import com.jetbrains.python.target.PyTargetAwareAdditionalData
import com.jetbrains.python.target.targetWithVfs.TargetWithMappedLocalVfs
+import com.jetbrains.python.target.ui.TargetPanelExtension
import org.jetbrains.annotations.ApiStatus
@ApiStatus.Internal
@@ -33,6 +34,8 @@ interface PythonInterpreterTargetEnvironmentFactory : PluginAware {
fun getPythonTargetInterpreter(sdk: Sdk, project: Project): HelpersAwareTargetEnvironmentRequest?
+ fun getPythonTargetInterpreter(sdkAdditionalData: PyTargetAwareAdditionalData, project: Project?): HelpersAwareTargetEnvironmentRequest? = null
+
fun getTargetType(): TargetEnvironmentType<*>
/**
@@ -108,6 +111,11 @@ interface PythonInterpreterTargetEnvironmentFactory : PluginAware {
else -> null
} ?: HelpersAwareLocalTargetEnvironmentRequest()
+ @JvmStatic
+ fun findPythonTargetInterpreter(sdkAdditionalData: PyTargetAwareAdditionalData, project: Project?): HelpersAwareTargetEnvironmentRequest? =
+ EP_NAME.extensionList.firstNotNullOfOrNull { it.getPythonTargetInterpreter(sdkAdditionalData, project) }
+
+
@JvmStatic
fun findDefaultSdkName(project: Project?, data: PyTargetAwareAdditionalData, version: String?): String =
EP_NAME.extensionList.firstNotNullOfOrNull { it.getDefaultSdkName(project, data, version) } ?: getFallbackSdkName(data, version)
diff --git a/python/src/com/jetbrains/python/sdk/add/v2/FileSystem.kt b/python/src/com/jetbrains/python/sdk/add/v2/FileSystem.kt
index 1e5f59871430..723d27574bb1 100644
--- a/python/src/com/jetbrains/python/sdk/add/v2/FileSystem.kt
+++ b/python/src/com/jetbrains/python/sdk/add/v2/FileSystem.kt
@@ -9,10 +9,7 @@ import com.intellij.openapi.projectRoots.Sdk
import com.intellij.openapi.util.io.FileUtil
import com.intellij.platform.eel.EelApi
import com.intellij.platform.eel.provider.localEel
-import com.intellij.python.community.execService.BinOnEel
-import com.intellij.python.community.execService.BinOnTarget
-import com.intellij.python.community.execService.BinaryToExec
-import com.intellij.python.community.execService.ExecService
+import com.intellij.python.community.execService.*
import com.intellij.python.community.execService.python.validatePythonAndGetVersion
import com.intellij.python.community.services.internal.impl.VanillaPythonWithLanguageLevelImpl
import com.intellij.python.community.services.shared.VanillaPythonWithLanguageLevel
diff --git a/python/src/com/jetbrains/python/sdk/add/v2/venv/helper.kt b/python/src/com/jetbrains/python/sdk/add/v2/venv/helper.kt
index 2e5851afbcfe..42fd0c9cf097 100644
--- a/python/src/com/jetbrains/python/sdk/add/v2/venv/helper.kt
+++ b/python/src/com/jetbrains/python/sdk/add/v2/venv/helper.kt
@@ -50,7 +50,6 @@ private suspend fun PythonAddInterpreterModel
.createSdkFromB
existingSdks: List,
): PyResult> {
val basePython = fileSystem.getBinaryToExec(pathToBasePython)
-
createVenv(basePython, pathToVenvHome.toString(), inheritSitePackages).getOr(message("project.error.cant.venv")) { return it }
val pythonBinaryPath = fileSystem.resolvePythonBinary(pathToVenvHome)