-
Notifications
You must be signed in to change notification settings - Fork 196
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
[infra] replace pycln
with ruff
#1485
Conversation
pyproject.toml
Outdated
@@ -859,6 +860,310 @@ ignore_missing_imports = true | |||
module = "tenacity.*" | |||
ignore_missing_imports = true | |||
|
|||
[[tool.mypy.overrides]] |
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.
Not important, but just out of curiosity, is there a specific reason that we are not specifying modules in an array (e.g. here)? I can see pytest.*
is declared twice in the file. I assume using a more compact syntax would be helpful?
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 is generated automatically... im actually not sure why its here and why its needed
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.
theres 229 entries of tool.mypy.overrides
in pyproject.toml
and 6 for module = "sqlalchemy.*"
i feel like this is misconfigured
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.
I see, I think we can leave it for another working item. BTW, here is a stackoverflow I found for what this ignore_missing_imports
is used for in case you are interest.
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.
I'm all for merging different tools into a single one (and I like ruff a lot). The PR looks misleading since we're also bumping other things like mypy
in the same go. I'd prefer to keep them separate in the future to make the reviews easier, but we can combine this one since you already did the work for it.
agreed, i removed |
7f1720d
to
8f15d8a
Compare
hooks: | ||
- id: ruff | ||
args: [ --fix, --exit-non-zero-on-fix, --preview ] |
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.
I think we have the --exit-non-zero-on-fix
in there for the CI
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.
I agree with removing --preview
: https://docs.astral.sh/ruff/preview/
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.
added back --exit-non-zero-on-fix
@@ -58,7 +58,7 @@ select = [ | |||
"I", # isort | |||
"UP", # pyupgrade | |||
] | |||
ignore = ["E501","E203","B024","B028","UP037"] | |||
ignore = ["E501","E203","B024","B028","UP037", "UP035", "UP006"] |
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.
UP006 makes sense to me, we can do a follow up to fix UP035: https://docs.astral.sh/ruff/rules/deprecated-import/
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, this looks great! Thanks for fixing this @kevinjqliu. Let me approve this to unblock the other PRs
poetry.lock
Outdated
{file = "jsonpath_ng-1.7.0-py2-none-any.whl", hash = "sha256:898c93fc173f0c336784a3fa63d7434297544b7198124a68f9a3ef9597b0ae6e"}, | ||
{file = "jsonpath_ng-1.7.0-py3-none-any.whl", hash = "sha256:f3d7f9e848cba1b6da28c55b1c26ff915dc9e0b1ba7e752a53d6da8d5cbd00b6"}, |
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.
Do we want to revert these as well?
pycln
has an issue in CI , also see hadialqattan/pycln#249Since we already use ruff linter, this PR replaces
pycln
withruff
Commits:
pre-commit autoupdate
(d621712)pycln
(230a747)make lint
(1cb37db)