From 657e98fbf65fff6c676d9e74b65a649bc817aba2 Mon Sep 17 00:00:00 2001 From: Koudai Aono Date: Tue, 9 Feb 2021 22:26:59 +0900 Subject: [PATCH 1/4] Support PyCharm EAP 211.* --- build.gradle | 2 +- resources/META-INF/plugin.xml | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/build.gradle b/build.gradle index 2b6d092..1670677 100644 --- a/build.gradle +++ b/build.gradle @@ -27,7 +27,7 @@ intellij { patchPluginXml { sinceBuild "203.7148" - untilBuild "203.*" + untilBuild "211.*" } allprojects { diff --git a/resources/META-INF/plugin.xml b/resources/META-INF/plugin.xml index 4228884..ed7a92d 100644 --- a/resources/META-INF/plugin.xml +++ b/resources/META-INF/plugin.xml @@ -1,10 +1,15 @@ com.koxudaxi.poetry Poetry - 1.0.6 + 1.0.8 Koudai Aono @koxudaxi version 1.0.6 +

version 1.0.8

+

Features

+
    +
  • Support PyCharm EAP 211.* [#181]
  • +
+

version 1.0.7

Bug fixes

  • Change command timeout to 30 sec [#177]
  • From dd6e97c99d7ed3296cb6f9115e9890a53b8d0bbf Mon Sep 17 00:00:00 2001 From: Koudai Aono Date: Tue, 9 Feb 2021 23:40:19 +0900 Subject: [PATCH 2/4] Remove deleted methods Change sinceBuild to 211.5538.22 --- build.gradle | 4 ++-- src/com/koxudaxi/poetry/PoetrySdkProvider.kt | 15 --------------- 2 files changed, 2 insertions(+), 17 deletions(-) diff --git a/build.gradle b/build.gradle index 1670677..6df6ba6 100644 --- a/build.gradle +++ b/build.gradle @@ -18,7 +18,7 @@ plugins { intellij { pluginName project.name - version "2020.3.3" + version "211.5538.22-EAP-SNAPSHOT" type "PC" updateSinceUntilBuild false downloadSources true @@ -26,7 +26,7 @@ intellij { } patchPluginXml { - sinceBuild "203.7148" + sinceBuild "211.5538.22" untilBuild "211.*" } diff --git a/src/com/koxudaxi/poetry/PoetrySdkProvider.kt b/src/com/koxudaxi/poetry/PoetrySdkProvider.kt index 405a553..e342516 100644 --- a/src/com/koxudaxi/poetry/PoetrySdkProvider.kt +++ b/src/com/koxudaxi/poetry/PoetrySdkProvider.kt @@ -7,7 +7,6 @@ import com.intellij.openapi.projectRoots.Sdk import com.intellij.openapi.projectRoots.SdkAdditionalData import com.intellij.openapi.util.UserDataHolder import com.jetbrains.python.packaging.ui.PyPackageManagementService -import com.jetbrains.python.psi.PyFile import com.jetbrains.python.sdk.PyInterpreterInspectionQuickFixData import com.jetbrains.python.sdk.PySdkProvider import com.jetbrains.python.sdk.PythonSdkUtil @@ -16,13 +15,6 @@ import org.jdom.Element import javax.swing.Icon class PoetrySdkProvider : PySdkProvider { - override val configureSdkProgressText: String - get() = "Looking for a pyproject.toml" - - override fun configureSdk(project: Project, module: Module, existingSdks: List): Sdk? { - return detectAndSetupPoetry(project, module, existingSdks) - } - override fun createEnvironmentAssociationFix(module: Module, sdk: Sdk, isPyCharm: Boolean, associatedModulePath: String?): PyInterpreterInspectionQuickFixData? { if (sdk.isPoetry) { val message = when { @@ -45,13 +37,6 @@ class PoetrySdkProvider : PySdkProvider { return if (sdk.isPoetry) PoetryInstallQuickFix() else null } - override fun createMissingSdkFix(module: Module, file: PyFile): PyInterpreterInspectionQuickFixData? { - return when { - UsePoetryQuickFix.isApplicable(module) -> PyInterpreterInspectionQuickFixData(UsePoetryQuickFix(null, module), "No Python interpreter configured for the project") - else -> null - } - } - override fun createNewEnvironmentPanel(project: Project?, module: Module?, existingSdks: List, newProjectPath: String?, context: UserDataHolder): PyAddNewEnvPanel { return PyAddNewPoetryPanel(null, null, existingSdks, newProjectPath, context) } From 051104f5a57a63ca0f866b6c4603df0d3f07df19 Mon Sep 17 00:00:00 2001 From: Koudai Aono Date: Tue, 9 Feb 2021 23:58:13 +0900 Subject: [PATCH 3/4] Change PyPoetrySdkConfiguration methods for https://github.com/JetBrains/intellij-community/commit/fb7e5d64147e83e5c7dbf8c50f474f16860b9e1f --- src/com/koxudaxi/poetry/PyPoetrySdkConfiguration.kt | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/com/koxudaxi/poetry/PyPoetrySdkConfiguration.kt b/src/com/koxudaxi/poetry/PyPoetrySdkConfiguration.kt index ff9aebb..a357d48 100644 --- a/src/com/koxudaxi/poetry/PyPoetrySdkConfiguration.kt +++ b/src/com/koxudaxi/poetry/PyPoetrySdkConfiguration.kt @@ -1,5 +1,6 @@ package com.koxudaxi.poetry +import com.intellij.codeInspection.util.IntentionName import com.jetbrains.python.sdk.configuration.PyProjectSdkConfigurationExtension import com.intellij.execution.ExecutionException import com.intellij.ide.util.PropertiesComponent @@ -28,13 +29,10 @@ class PyPoetrySdkConfiguration : PyProjectSdkConfigurationExtension { private val LOGGER = Logger.getInstance(PyPoetrySdkConfiguration::class.java) - override fun isApplicable(module: Module): Boolean = module.pyProjectToml != null - override fun createAndAddSdkForConfigurator(module: Module): Sdk? = createAndAddSDk(module, false) - override fun getIntentionName(module: Module): String { - return "Create a poetry environment using ${module.pyProjectToml?.name}" - } + override fun getIntention(module: Module): @IntentionName String? = + module.pyProjectToml?.let { "Create a poetry environment using ${it.name}" } override fun createAndAddSdkForInspection(module: Module): Sdk? = createAndAddSDk(module, true) From cbab31c11eb6cbde2e9f35480081151c8e770634 Mon Sep 17 00:00:00 2001 From: Koudai Aono Date: Thu, 11 Feb 2021 22:36:43 +0900 Subject: [PATCH 4/4] Update version --- resources/META-INF/plugin.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/resources/META-INF/plugin.xml b/resources/META-INF/plugin.xml index 9bb893e..02eab43 100644 --- a/resources/META-INF/plugin.xml +++ b/resources/META-INF/plugin.xml @@ -1,10 +1,10 @@ com.koxudaxi.poetry Poetry - 1.0.8 + 1.1.0 Koudai Aono @koxudaxi version 1.0.8 +

    version 1.1.0

    Features

    • Support PyCharm EAP 211.* [#181]