Closed noidname01 closed 1 week ago
@noidname01 what is the relationship between pylint and black? How do we trigger this in gradle?
@jerryshao Currently the black
(formatter) will run before pylint
(linter), this is enforced by the mustRunAfter
function in Gradle.
This pipeline was manually defined to run before test
and build
tasks by using dependsOn(pipInstall, black, pylint)
.
I've seen your reply and I will modify the Gradle script to trigger this pipeline automatically before doing any task in client-python
project.
black is integrated into spotless, can we use spotless one?
I had just survey the spotless Python solution and I found it need to manually install black
to local environment, not a virtual environment, the automatic way is still a TODO.
IMO, I think it's better to leave all python dependencies in virtual environments.
I had just survey the spotless Python solution and I found it need to manually install
black
to local environment, not a virtual environment, the automatic way is still a TODO. IMO, I think it's better to leave all python dependencies in virtual environments.
I see, thanks for the explain.
@jerryshao Currently the
black
(formatter) will run beforepylint
(linter), this is enforced by themustRunAfter
function in Gradle.This pipeline was manually defined to run before
test
andbuild
tasks by usingdependsOn(pipInstall, black, pylint)
. I've seen your reply and I will modify the Gradle script to trigger this pipeline automatically before doing any task inclient-python
project.
I've add finalizedBy
in envSetup
task(a task brought by VenvTask
) to force every task run pip install
and code formatting pipeline before their own tasks.
But I found client-python
was not even included in compileDistribution
task, so I think it's better to run python formatting pipeline when it's necessary.
@jerryshao Currently the
black
(formatter) will run beforepylint
(linter), this is enforced by themustRunAfter
function in Gradle. This pipeline was manually defined to run beforetest
andbuild
tasks by usingdependsOn(pipInstall, black, pylint)
. I've seen your reply and I will modify the Gradle script to trigger this pipeline automatically before doing any task inclient-python
project.I've add
finalizedBy
inenvSetup
task(a task brought byVenvTask
) to force every task runpip install
and code formatting pipeline before their own tasks. But I foundclient-python
was not even included incompileDistribution
task, so I think it's better to run python formatting pipeline when it's necessary.
@noidname01 sorry for late response. It is not needed for client-python
to be included in compileDistribution
task. compileDistribution
task is used to package the Gravitino server, not the client stuffs. For clients like java, python, they will only publish to the central repository like maven, pypi, they will not ship with server binary package.
@jerryshao Oh I think I gave you wrong idea because of my expression, what I mean is we only need to run python code formatting pipeline when needed, not including the compileDistribution
task which is for gravitino server.
I tried it locally, generally LGTM, just have a minor comment. @xunliu would you please take a deep look when you have time?
@noidname01 would you please create a PR to cherry-pick this merged commit to branch-0.5.
What changes were proposed in this pull request?
build
andtest
gradle tasks.Why are the changes needed?
Fix: #3206, #3203
Does this PR introduce any user-facing change?
No
How was this patch tested?
No