-
Notifications
You must be signed in to change notification settings - Fork 902
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
Make gpuCI and pre-commit style configurations consistent #8215
Make gpuCI and pre-commit style configurations consistent #8215
Conversation
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 minor quirks around the behavior of isort
:
ci/checks/style.sh
Outdated
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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. |
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
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 |
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.
|
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.
Can you update the copyright year for all the files?
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.
Dask-cudf changes seem fine - Just left a minor question
from dask.utils import tmpfile | ||
|
||
import dask_cudf | ||
|
||
import dask.dataframe as dd # isort:skip |
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.
Why the override here?
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.
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 dd
I 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.
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.
Java approval
@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.py
so 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.py
now runsclang-format
oncpp/libcudf_kafka/
andjava/src/main/native/
to match with pre-commit (also removedcpp/include/cudf
andcpp/include/nvtext
as 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.