-
Notifications
You must be signed in to change notification settings - Fork 917
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
Update cython-lint and replace flake8 with ruff #13699
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
vyasr
added
code quality
Python
Affects Python cuDF API.
improvement
Improvement / enhancement to an existing function
non-breaking
Non-breaking change
labels
Jul 14, 2023
bdice
approved these changes
Jul 14, 2023
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.
Awesome. I’d been wanting to explore this change, thanks for doing so.
ajschmidt8
approved these changes
Jul 17, 2023
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.
Approving ops-codeowner
file changes
/merge |
3 tasks
rapids-bot bot
pushed a commit
to rapidsai/rmm
that referenced
this pull request
Jul 18, 2023
The cython-lint change is necessary to unblock runs after the Cython 3.0 update, but it is also a QOL improvement that allows us to remove flake8 usage in Cython files since cython-lint now covers a superset of what flake8 could do for Cython. ruff is (nearly) a superset of flake8 for pure Python and has a wide range of advantages, so this switch is beneficial as well. cf. rapidsai/cudf#13699 Authors: - Vyas Ramasubramani (https://github.com/vyasr) Approvers: - Ashwin Srinath (https://github.com/shwina) - Mark Harris (https://github.com/harrism) URL: #1302
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
CMake
CMake build issue
improvement
Improvement / enhancement to an existing function
non-breaking
Non-breaking change
Python
Affects Python cuDF API.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR makes three changes to linting
cython-lint has achieved parity with flake8 for Cython files, so we no longer need flake8 for that. Meanwhile ruff advertises itself as a suitable replacement for flake8 under three conditions: 1) few plugins, 2) using with black, and 3) Python 3 only. All of those apply to cudf code. From a quick analysis, there are a small handful of error codes supported by flake8 (via pyflakes or pycodestyle) that are not yet supported by ruff (pyflakes: F723, F842; pycodstyle: W391,W503, W504, W505, W606). On the flip side, ruff autofixes a range of issues that flake8 can't, it runs more than an order of magnitude faster, it supports more flexible configuration via pyproject.toml, and it promises to replace multiple tools over time. Therefore, I think this is a good switch for us to make.
Note that ruff could in theory also replace isort for Python files, but it does not support Cython yet, so I have left our isort hook in place. We could revisit in the future if that changes.
Checklist