Make gpuCI and pre-commit style configurations consistent - #8215
Conversation
charlesbluca
left a comment
There was a problem hiding this comment.
Some minor quirks around the behavior of isort:
| ISORT=`isort --check-only python/**/*.py` | ||
| ISORT_RETVAL=$? | ||
| # Run isort-cudf and get results/return code | ||
| ISORT_CUDF=`isort python/cudf --check-only --settings-path=python/cudf/setup.cfg --skip-glob *.pyx --skip-glob *.pyi 2>&1` |
There was a problem hiding this comment.
For some reason, the pre-commit hooks for isort automatically skip Cython files, while the CLI does not, so I had to specify to skip them here. Do we want package sorting for Cython files?
There was a problem hiding this comment.
Looks like we can get Cython/PYI resorting in pre-commit's isort hook with:
types: [text]
types_or: [python, cython, pyi]So if we would like package resorting on Cython and/or module files it's now totally doable.
The fact that this runs on |
|
I think this PR would need to include the results of running Also, @charlesbluca, could you please confirm that as a result of this commit, the intention is for clang formatting to run on I ask because It would be good to have |
I agree - I was planning to run through the pre-commit hooks once all the config changes were ironed out.
No, the intent is so that when gpuCI is ran, it will run A relatively simple workaround for this which would address the situation you described and also make this PR a little simpler would be to make a GitHub Actions workflow running a pre-commit action (or using precommit.ci, which seems to be its successor). This would ensure that the style checks being ran when making commits and opening PRs are always the same, since they rely on identical configs; it would also create a workflow to check for formatting independent of if a PR is submitted with That being said, I'm not sure of the potential downsides to moving aspects of our testing outside of gpuCI. |
ajschmidt8
left a comment
There was a problem hiding this comment.
Approving ops-codeowner file changes
|
To update the separate style CI issue, rapidsai/ops#1580 has been opened - @mythrocks, would you prefer that get resolved before merging this? |
|
@charlesbluca what needs to happen to get this in? We are entering code freeze tomorrow. |
|
I think this would be better retargetted to |
|
Sorry I missed this question. Please go ahead with this change. |
|
Thanks @mythrocks! Now the only blocker on this is rapidsai/integration#286, which would allow us to resort packages in .pxd files. |
|
To be specific on the failure that happened in import dask.dataframe as ddinstead preferring: from dask import dataframe as ddWhereas |
I'd suggest to keep it simple as: import dask.dataframe as dd |
|
fwiw |
|
I couldn't find an option to force that specific import style so I just skipped |
Codecov Report
@@ Coverage Diff @@
## branch-21.08 #8215 +/- ##
===============================================
Coverage ? 10.67%
===============================================
Files ? 109
Lines ? 18669
Branches ? 0
===============================================
Hits ? 1993
Misses ? 16676
Partials ? 0 Continue to review full report at Codecov.
|
galipremsagar
left a comment
There was a problem hiding this comment.
Can you update the copyright year for all the files?
rjzamora
left a comment
There was a problem hiding this comment.
Dask-cudf changes seem fine - Just left a minor question
|
|
||
| import dask_cudf | ||
|
|
||
| import dask.dataframe as dd # isort:skip |
There was a problem hiding this comment.
Now that gpuCI's isort==5.0.7 check is targetting this file, it want to change this line to
from dask import dataframe as ddI couldn't find an option for isort to allow this type of import, but can confirm that isort==5.6.4 (which we are planning to bump gpuCI to after this PR is merged) allows either style of import, so this override can be removed once rapidsai/integration#286 is merged.
|
@gpucibot merge |
|
After playing around with Cython resorting for a while, I noticed a quirk of |
Closes #8193
Makes changes to the pre-commit config, gpuCI style script, and
cpp/scripts/run-clang-format.pyso that the styling of the pre-commit hooks should roughly match the style checks done by gpuCI. In particular:python/to match with gpuCIcpp/scripts/run-clang-format.pynow runsclang-formatoncpp/libcudf_kafka/andjava/src/main/native/to match with pre-commit (also removedcpp/include/cudfandcpp/include/nvtextas they were redundant here)It would probably be good to run the updated hooks on the codebase either in this PR or a linked one so that this changes doesn't break tests.