From 74cfdd3ac77e17023e41621d99d997ea56e662b0 Mon Sep 17 00:00:00 2001 From: Oleg Smirnov Date: Mon, 26 Dec 2022 15:56:56 +0100 Subject: [PATCH] Update naming for Run and Test tasks --- .space.kts | 2 +- build.gradle.kts | 2 +- cli/src/main/kotlin/io/paddle/Application.kt | 3 ++- example/subproject/paddle.yaml | 1 + .../paddle/idea/execution/PaddleRunConfigurationProducer.kt | 6 +++--- .../kotlin/io/paddle/plugin/python/tasks/run/RunTask.kt | 2 +- .../kotlin/io/paddle/plugin/python/tasks/test/PyTestTask.kt | 2 +- scripts/docker/Dockerfile | 2 +- 8 files changed, 11 insertions(+), 9 deletions(-) diff --git a/.space.kts b/.space.kts index 36f0375b..dcb33ee5 100644 --- a/.space.kts +++ b/.space.kts @@ -28,7 +28,7 @@ job("Paddle / Release / Docker") { } } - val version = "0.4.4" + val version = "0.4.5" val types = listOf("2.7", "3.7", "3.8", "3.9", "3.10").map { "paddle-py-${it.replace(".", "-")}" } + listOf("paddle") diff --git a/build.gradle.kts b/build.gradle.kts index cbef2a33..91d1aee1 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,5 +1,5 @@ group = "io.paddle" -version = "0.4.4" +version = "0.4.5" plugins { kotlin("jvm") version "1.7.10" apply false diff --git a/cli/src/main/kotlin/io/paddle/Application.kt b/cli/src/main/kotlin/io/paddle/Application.kt index 75ee9f2d..077feef1 100644 --- a/cli/src/main/kotlin/io/paddle/Application.kt +++ b/cli/src/main/kotlin/io/paddle/Application.kt @@ -6,6 +6,7 @@ import com.github.ajalt.clikt.parameters.arguments.optional import com.github.ajalt.clikt.parameters.options.flag import com.github.ajalt.clikt.parameters.options.option import io.paddle.project.PaddleProjectProvider +import io.paddle.project.extensions.descriptor import io.paddle.tasks.Task import java.io.File @@ -29,7 +30,7 @@ class Paddle : CliktCommand() { var current = project for (name in names.dropLast(1)) { - current = current.subprojects.getByName(name) ?: error("Could not find project :$name") + current = current.subprojects.getByName(name) ?: error("Could not find project :$name among subprojects of the current project :${current.descriptor.name}") } current.execute(taskId) diff --git a/example/subproject/paddle.yaml b/example/subproject/paddle.yaml index 647c44a3..6e095098 100644 --- a/example/subproject/paddle.yaml +++ b/example/subproject/paddle.yaml @@ -24,6 +24,7 @@ tasks: run: - entrypoint: main.py id: main + test: pytest: - id: some_tests diff --git a/idea/src/main/kotlin/io/paddle/idea/execution/PaddleRunConfigurationProducer.kt b/idea/src/main/kotlin/io/paddle/idea/execution/PaddleRunConfigurationProducer.kt index 54c40c7d..9f613c28 100644 --- a/idea/src/main/kotlin/io/paddle/idea/execution/PaddleRunConfigurationProducer.kt +++ b/idea/src/main/kotlin/io/paddle/idea/execution/PaddleRunConfigurationProducer.kt @@ -34,8 +34,8 @@ class PaddleRunConfigurationProducer : AbstractExternalSystemRunConfigurationPro configuration.settings.taskNames = listOf( when { - element.getSuperParent(5)?.text?.startsWith("pytest") ?: false -> "pytest$$taskId" - element.getSuperParent(5)?.text?.startsWith("run") ?: false -> "run$$taskId" + element.getSuperParent(5)?.text?.startsWith("pytest") ?: false -> taskId + element.getSuperParent(5)?.text?.startsWith("run") ?: false -> taskId element.text.startsWith("twine") -> "twine" element.text.startsWith("requirements") -> "install" else -> return false @@ -61,7 +61,7 @@ class PaddleRunConfigurationProducer : AbstractExternalSystemRunConfigurationPro val taskNames = configuration.settings.taskNames.takeIf { it.isNotEmpty() } ?: return false return when (taskNames.first()) { - "run$$taskId", "pytest$$taskId" -> true + taskId, taskId -> true "twine" -> context.location?.psiElement?.text?.startsWith("twine") ?: false "install" -> context.location?.psiElement?.text?.startsWith("requirements") ?: false else -> false diff --git a/plugins/python/src/main/kotlin/io/paddle/plugin/python/tasks/run/RunTask.kt b/plugins/python/src/main/kotlin/io/paddle/plugin/python/tasks/run/RunTask.kt index 696d997e..237e5058 100644 --- a/plugins/python/src/main/kotlin/io/paddle/plugin/python/tasks/run/RunTask.kt +++ b/plugins/python/src/main/kotlin/io/paddle/plugin/python/tasks/run/RunTask.kt @@ -36,7 +36,7 @@ class RunTask(val name: String, val entrypoint: String, val arguments: List