-
Notifications
You must be signed in to change notification settings - Fork 919
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 support for pydocstyle and test on abc.py #7985
Conversation
@kkraus14 @galipremsagar would appreciate thoughts here before I go any further. I started this because I was rewriting docstrings anyway in the process of other work being done in some of my recent PRs before I found #202. A wholesale update of our docstrings is a big task and too much time investment to be worth prioritizing, but I think following this approach we can improve docs incrementally without dedicating too much time. I assume that ops will need to update gpuCI containers to include |
@kkraus14 mentioned that it would be great if we could reduce duplication between docstrings and type annotations. The main related tool I was previously aware was darglint, which is a linter that validates consistency between docstring types and actually accepted arguments. It works well, but has some limitations I've run into that prevented me from adopting it for previous projects and it can be a bit slow. I don't think any of this should block us from moving forward with adding docstring validation, but it's something we should keep in mind to reduce duplication in the future. |
ok to test |
This PR is ready for initial review. rapidsai/integration#258 was just merged, so it may take a while for CI to pick up the new images with |
Looks like pydocstyle isn't in the path, or isn't installed correctly. Probably need to add it to the
|
I added it to the rapids integration metapackage and that change got merged, so I think we'll just have to wait for that conda package to get built. @ajschmidt8 may have a better idea of when that might be. For reference, I think the relevant conda package is here and we should be able to see when it's been updated (last update is from 5 days ago, which is before pydocstyle was added). |
The nightly conda package location is here: https://anaconda.org/rapidsai-nightly/rapids-build-env There was an issue with CI that I just fixed that prevented the package from getting re-deployed after your changes. Everything is getting re-built and re-deployed now. After the package is updated, the Docker container that installs that package will also have to be updated and re-deployed (this one). After both of those are complete, this PR should have |
rerun tests |
@cwharris CI images are updated and the style check passes now. |
Codecov Report
@@ Coverage Diff @@
## branch-0.20 #7985 +/- ##
===============================================
- Coverage 82.88% 82.85% -0.04%
===============================================
Files 103 103
Lines 17668 17818 +150
===============================================
+ Hits 14645 14763 +118
- Misses 3023 3055 +32
Continue to review full report at Codecov.
|
@gpucibot merge |
This PR is related to #202 and adds support for using pydocstyle to lint docstrings. It adds flake8 configuration, a pre-commit hook, and sets up the flake8 config to enable incremental application of docstring styling. As an added bonus, because of the way that pydocstyle chooses not to lint docstrings on internal objects (those prefixed with an underscore), as more files are linted we can evaluate what constitutes public API for
cudf
. Once a file has been linted and is added to the regex filter in the config, ongoing CI checks will prevent regressions in the documentation.As an initial test, this PR lints the abc.py file containing the Serializable class (and updates the docstrings accordingly). We may want to mark that entire class as internal in any case, but it's important enough that it needs to be documented in any case (and perhaps we could settle on a standard docstring style for internal-facing code as well while we're at it).