kubeflow / katib

Automated Machine Learning on Kubernetes
https://www.kubeflow.org/docs/components/katib
Apache License 2.0
1.49k stars 440 forks source link

Add Linter and Formatter for python source codes #1601

Closed anencore94 closed 1 month ago

anencore94 commented 3 years ago

/kind feature

Describe the solution you'd like

In kubeflow/katib, there are lots of source codes written in python. Even though there are well-defined CI processes for source codes written in Golang, however for Python codes, only charmed-katib seems to have such process now.

There should be a fixed linter, formatter and tester with some rule-config files(.flake8, .pylintrc, ...) and the github action workflow to check those all. For example, there are lots of unit test codes for suggestion, but current CI process doesn't check if they are failed or check the test coverage decreased in every PR. If there are any convention checking tools, please share in katib community :)

Anything else you would like to add: If you guys agree to this, I'd like to contribute to this feature in some parts.

andreyvelich commented 3 years ago

That is a great suggestion and it will be very useful for us. Thank you for your help @anencore94!

In addition to that, I think we should move our current Python tests from AWS CI Workflow to GitHub actions: https://github.com/kubeflow/katib/blob/master/test/scripts/v1beta1/python-tests.sh.

Currently, we are not using AWS Kubernetes cluster requirement to perform this workflow step. We can create separate GitHub Actions Workflow for all Python tests (linter, formatter, unit), similar to Go: https://github.com/kubeflow/katib/tree/master/.github/workflows.

cc @gaocegege @johnugeorge

anencore94 commented 3 years ago

Using mypy to type check would be nice too.

gaocegege commented 3 years ago

SGTM, I am not quite familiar with Python, I think we need it.

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

andreyvelich commented 2 years ago

/lifecycle frozen

tenzen-y commented 6 months ago

/good-first-issue

google-oss-prow[bot] commented 6 months ago

@tenzen-y: This request has been marked as suitable for new contributors.

Please ensure the request meets the requirements listed here.

If this request no longer meets these requirements, the label can be removed by commenting with the /remove-good-first-issue command.

In response to [this](https://github.com/kubeflow/katib/issues/1601): >/good-first-issue Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository.
sagnik3788 commented 5 months ago

@sandipanpanda still working on it ?

sandipanpanda commented 4 months ago

Sorry, this fell off my radar. @sagnik3788 feel free to work on this. /unassign

sagnik3788 commented 4 months ago

/assign

forsaken628 commented 4 months ago

Which formater is better, black, autopep8 or something else?

tenzen-y commented 3 months ago

Which formater is better, black, autopep8 or something else?

We are supposed to use the flake8 and black.

Souradip121 commented 1 month ago

@sagnik3788 still working on it??

tenzen-y commented 1 month ago

This has already been fixed by https://github.com/kubeflow/katib/pull/2407. /close

/assign @Ygnas

google-oss-prow[bot] commented 1 month ago

@tenzen-y: GitHub didn't allow me to assign the following users: Ygnas.

Note that only kubeflow members with read permissions, repo collaborators and people who have commented on this issue/PR can be assigned. Additionally, issues/PRs can only have 10 assignees at the same time. For more information please see the contributor guide

In response to [this](https://github.com/kubeflow/katib/issues/1601#issuecomment-2295221399): >This has already been fixed by https://github.com/kubeflow/katib/pull/2407. >/close > >/assign @Ygnas > Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository.
google-oss-prow[bot] commented 1 month ago

@tenzen-y: Closing this issue.

In response to [this](https://github.com/kubeflow/katib/issues/1601#issuecomment-2295221399): >This has already been fixed by https://github.com/kubeflow/katib/pull/2407. >/close > >/assign @Ygnas > Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository.