-
Notifications
You must be signed in to change notification settings - Fork 74
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
Add ruff linter #201
base: main
Are you sure you want to change the base?
Add ruff linter #201
Conversation
/ok to test |
The actions seem to be broken as of a long time ago. The culprit being a faulty build command which looks for setup.py in cuda-python top level directory. I'm wondering if that will be addressed by QA, or if I/someone should fix it. |
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 couple of comments:
- Once you're ready, can you try testing the builds and tests across our supported Python versions (3.9 to 3.12) and 3.13? For the bindings just doing 3.9 and 3.13 is probably sufficient(?), just because the build there takes a while. In the past some of my own code formats had issues for certain versions, so some paranoia is creeping in. Surely since this is a linter all of that ought to be ok, but still 🙂.
Would need a follow-up PR into the 11.8.x branch. Just an FYI for when the time comes.Actually no, this shouldn't be necessary since the only change expected on that branch are the bindings which aren't covered by the linter anyways. The only items remaining would be the tests/examples, but that is expected to stay the same.
cuda_bindings/examples/4_CUDA_Libraries/conjugateGradientMultiBlockCG_test.py
Outdated
Show resolved
Hide resolved
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.
Looks good to me, but what do you think about splitting this PR into two parts:
- Add tox testing only.
- Add ruff only with the tox testing in place already.
That would make it easier** to see what changes (if any?) are required to establish tox testing, and what changes are a consequence of introducing ruff.
easier** in the future, in case we have to backtrack for whatever reason.
@vzhurba01 The changes have been verified against python 3.9 and 3.13 successfully. |
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.
Another idea borrowed from pybind11:
This ensures that all PRs pass the pre-commit checks.
I didn't see that here. I'm not sure if you have another way of achieving the same?
Add Ruff linter and format to pre-commit-hooks + make the appropriate changes in the code base so that we start with a passing commit.
some per-file ignores have been added, and some globals. I think these can be a work in progress, and I used my best judgement, but I would love to hear feedback.
Depends on #203
The only real bug this exposes is #203 which I am addressing in a separate PR and issue for cleanliness
Closes #195