Skip to content

Commit

Permalink
Update naming for Run and Test tasks
Browse files Browse the repository at this point in the history
  • Loading branch information
SmirnovOleg committed Dec 26, 2022
1 parent d63e6c6 commit 74cfdd3
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .space.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Expand Down
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
group = "io.paddle"
version = "0.4.4"
version = "0.4.5"

plugins {
kotlin("jvm") version "1.7.10" apply false
Expand Down
3 changes: 2 additions & 1 deletion cli/src/main/kotlin/io/paddle/Application.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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)
Expand Down
1 change: 1 addition & 0 deletions example/subproject/paddle.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ tasks:
run:
- entrypoint: main.py
id: main

test:
pytest:
- id: some_tests
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class RunTask(val name: String, val entrypoint: String, val arguments: List<Stri
}
}

override val id: String = "run$$name"
override val id: String = name

override val group: String = TaskDefaultGroups.RUN

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class PyTestTask(
}
}

override val id: String = "pytest$$name"
override val id: String = name

override val group: String = TaskDefaultGroups.TEST

Expand Down
2 changes: 1 addition & 1 deletion scripts/docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM ubuntu:20.04 as downloader

ARG VERSION='0.4.4'
ARG VERSION='0.4.5'

RUN apt-get update && apt-get -y install wget

Expand Down

0 comments on commit 74cfdd3

Please sign in to comment.