diff --git a/clients/client-python/build.gradle.kts b/clients/client-python/build.gradle.kts index 121077d30b8..f17bdfdcdea 100644 --- a/clients/client-python/build.gradle.kts +++ b/clients/client-python/build.gradle.kts @@ -39,12 +39,13 @@ tasks { } val black by registering(VenvTask::class) { - mustRunAfter(pipInstall) + dependsOn(pipInstall) venvExec = "black" args = listOf("./gravitino", "./tests") } val pylint by registering(VenvTask::class) { + dependsOn(pipInstall) mustRunAfter(black) venvExec = "pylint" args = listOf("./gravitino", "./tests") @@ -57,7 +58,6 @@ tasks { gravitinoServer("start") } - dependsOn(pipInstall, black, pylint) venvExec = "python" args = listOf("-m", "unittest") workingDir = projectDir.resolve(".") @@ -74,7 +74,6 @@ tasks { } val build by registering(VenvTask::class) { - dependsOn(pipInstall, black, pylint) } val clean by registering(Delete::class) { @@ -86,4 +85,11 @@ tasks { deleteCacheDir("__pycache__") } } + + matching { + it.name.endsWith("envSetup") + }.all { + // add install package and code formatting before any tasks + finalizedBy(pipInstall, black, pylint) + } }