-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Python: Replace isort
, pylint
, prettier
, pyupgrade
& flake8
with ruff
#8408
Python: Replace isort
, pylint
, prettier
, pyupgrade
& flake8
with ruff
#8408
Conversation
…ing of python projects
Linked to issue: #8294 |
Co-authored-by: Fokko Driesprong <[email protected]>
I saw flake8 also being used we can remove that as well, as Ruff can take care of flake rules by default |
… were exlcuded in flake in ruff aswell
isort
, pylint
, prettier
& flake8
with ruff
isort
, pylint
, prettier
& flake8
with ruffisort
, pylint
, prettier
& flake8
with ruff
@MehulBatra I think we can also remove pyupgrade: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some small comments, can you take a look at those @MehulBatra? Apart from that, it looks great! There are probably more rules that we want to enable, but we can do that in a follow up PR. I like ruff a lot.
Co-authored-by: Fokko Driesprong <[email protected]>
isort
, pylint
, prettier
& flake8
with ruff
isort
, pylint
, prettier
, pyupgrade
& flake8
with ruff
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Something looks really off 🤔
666f891
to
3afd3ed
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some small nits, but apart from that it looks great! Almost there
python/build-module.py
Outdated
@@ -17,6 +17,7 @@ | |||
|
|||
import os | |||
import shutil | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line surprises me since they are both internal packages.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It separated import and from statements mostly due to property
lines-between-types = 1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://beta.ruff.rs/docs/settings/#isort-lines-between-types
I can try setting it up 0
Co-authored-by: Fokko Driesprong <[email protected]>
python/build-module.py
Outdated
@@ -17,6 +17,7 @@ | |||
|
|||
import os | |||
import shutil | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It separated import and from statements mostly due to property
lines-between-types = 1
python/tests/avro/test_decoder.py
Outdated
@@ -24,8 +24,7 @@ | |||
from unittest.mock import MagicMock, patch | |||
|
|||
import pytest | |||
|
|||
from pyiceberg.avro.decoder import BinaryDecoder, StreamingBinaryDecoder, new_decoder | |||
from pyiceberg.avro.decoder import BinaryDecoder, StreamingBinaryDecoder, new_decoder # type: ignore |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was throwing Module "pyiceberg.avro.decoder" has no attribute "new_decoder" while running mypy check in commit hook hence added
#
type: ignore comment to tell mypy to ignore this error
python/pyiceberg/io/pyarrow.py:1164:16: E721 Do not compare types, use |
for ruff isort properties added properties in toml: |
This is a great catch already, thanks for fixing this! |
fixed the mypy_path config |
Thanks again @MehulBatra for working on this, great to have this in! |
Nice one :) |
We will be using Rust for faster CICD
It's written in rust for faster linting , sorting & typechecking it will be used as a part of the pre-commit hook & git runner replacing Isort, pylint, prettier, pyupgrade and flake8 and will help in the faster development cycle by pointing errors, bugs, stylistic errors, and suspicious constructs faster than ever.
Resolves #8294