diff --git a/python/pluginCore/resources/META-INF/plugin.xml b/python/pluginCore/resources/META-INF/plugin.xml index 9fa6d77b9b4c..6cab36e08014 100644 --- a/python/pluginCore/resources/META-INF/plugin.xml +++ b/python/pluginCore/resources/META-INF/plugin.xml @@ -60,8 +60,13 @@ The Python plug-in provides smart editing for Python scripts. The feature set of messages.PyBundle - - + + - @@ -419,7 +425,7 @@ The Python plug-in provides smart editing for Python scripts. The feature set of serviceImplementation="com.jetbrains.python.codeInsight.PyCustomMemberProviderImpl"/> + serviceImplementation="com.jetbrains.python.packaging.management.PythonPackageManagerServiceImpl"/> @@ -480,12 +486,16 @@ The Python plug-in provides smart editing for Python scripts. The feature set of + + - + @@ -524,8 +534,10 @@ The Python plug-in provides smart editing for Python scripts. The feature set of - - + + diff --git a/python/src/com/jetbrains/python/sdk/poetry/PoetryCommandExecutor.kt b/python/src/com/jetbrains/python/sdk/poetry/PoetryCommandExecutor.kt index f2ba93e87f4f..d0d59c3a7362 100644 --- a/python/src/com/jetbrains/python/sdk/poetry/PoetryCommandExecutor.kt +++ b/python/src/com/jetbrains/python/sdk/poetry/PoetryCommandExecutor.kt @@ -12,6 +12,7 @@ import com.intellij.openapi.ui.ValidationInfo import com.intellij.openapi.util.NlsSafe import com.intellij.openapi.util.SystemInfo import com.intellij.openapi.util.io.FileUtil +import com.intellij.openapi.util.registry.Registry import com.intellij.platform.ide.progress.withBackgroundProgress import com.intellij.platform.util.progress.reportSequentialProgress import com.intellij.python.community.impl.poetry.poetryPath @@ -29,10 +30,10 @@ import com.jetbrains.python.pathValidation.ValidationRequest import com.jetbrains.python.pathValidation.validateExecutableFile import com.jetbrains.python.sdk.* import com.jetbrains.python.venvReader.VirtualEnvReader +import io.github.z4kn4fein.semver.Version import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch import kotlinx.coroutines.withContext -import io.github.z4kn4fein.semver.Version import io.github.z4kn4fein.semver.toVersion import org.jetbrains.annotations.ApiStatus.Internal import org.jetbrains.annotations.NonNls @@ -93,7 +94,8 @@ suspend fun validatePoetryExecutable(poetryExecutable: Path?): ValidationInfo? = * 1. `poetry env use [sdk]` * 2. `poetry [args]` */ -internal suspend fun runPoetryWithSdk(sdk: Sdk, vararg args: String): Result { +@Internal +suspend fun runPoetryWithSdk(sdk: Sdk, vararg args: String): Result { val projectPath = sdk.associatedModulePath?.let { Path.of(it) } ?: return Result.failure(poetryNotFoundException) // Choose a correct sdk return reportSequentialProgress(2) { reporter -> reporter.itemStep { @@ -219,7 +221,7 @@ suspend fun poetryListPackages(sdk: Sdk): Result, List { @Internal fun parsePoetryInstallDryRun(input: String): Pair, List> { - val installedLines = listOf("Already installed", "Skipping", "Updating") + val installedLines = listOf("Already installed", "Skipping", "Updating", "Downgrading") fun getNameAndVersion(line: String): Triple { return line.split(" ").let {