rapidsai / build-planning

Tracking for RAPIDS-wide build tasks
https://github.com/rapidsai
0 stars 4 forks source link

Enable Ruff's NumPy rules #103

Open jakirkham opened 1 month ago

jakirkham commented 1 month ago

Ruff ships with a few NumPy checks. It may be worth considering adding these to the Ruff checks that we include in RAPIDS projects

Note: NPY201 specifically checks for NumPy 2 support. Though there are other checks, which may be worth including too

vyasr commented 1 month ago

Most RAPIDS repos don't use ruff at all yet, so getting that set up would be a good first step (presumably replacing flake8).

jakirkham commented 1 month ago

Interesting saw things like...

So assumed we were already using this somehow

If not, agree that setting up Ruff would be the first step

vyasr commented 1 month ago

cudf is the only repository using ruff so far AFAIK.

jakirkham commented 1 month ago

Am seeing additions via PRs to projects:

Plus other PRs for various tooling:

That said, am not aware of a coordinated effort to make this change. Just different projects have made this change themselves

vyasr commented 1 month ago

Oh cool! Then we've come further with that than I thought. I'd say a coordinated migration to ruff from flake8 at least is warranted.

jameslamb commented 1 month ago

+1 to that. @bdice also rightly pointed out in https://github.com/rapidsai/build-planning/issues/101#issuecomment-2356570697 that if projects were all using ruff instead of flake8, the effort to fix something like #101 would have been lower because ruff can auto-fix so many of the issues it raises.

jakirkham commented 1 month ago

FWIW am personally encouraged by the fact that projects are adopting Ruff on their own and making this transition

Perhaps we could provide some guidelines if they would be helpful. This probably works best if we pick one RAPIDS project and concentrate effort on bringing its Ruff configuration up-to-date and then point to that as an example for others

That said, am happy to see projects continue to make these changes themselves. Though it might be worth raising awareness of this (say at the PIC meeting) and see if more projects will sign up to make these changes