-
-
Notifications
You must be signed in to change notification settings - Fork 18.2k
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
CI: Docstring validation is slow #57578
Comments
yeah it needs to generate all these docstrings, write them to temporary files, run validation against them... tbh I think we should rip all the docstring sharing logic, just have plain old docstrings without substitutions, and let ruff do all the linting and validation in a matter of seconds. this shouldn't be done manually though, maybe I should see if it's automatable doctests can be validated with pytest --doctest-modules |
Big +1 |
cool - no idea how difficult this actually is but I'll give it a go next week and see |
I started this here: #57683 I have a little script to do this, which seems to working well enough. Before I go too far, just checking people are OK with it Pros of keeping docstring substitutions:
Pros of removing docstring substitions:
I don't think ruff replaces all of the |
I get we have a lot of docstrings but I am surprised that this would take 22 minutes. Not a hill I'd want to die on but I do think the shared docstrings serve a good purpose in keeping things consistent |
Wasn't aware of this issue and wrote #57826 after I introduced a docstring error in my first PR and got annoyed at the speed of the docstring checks. It reduces the runtime of the I also have another PR ready to go once #57826 is merged. That second PR brings the validation down to about 10 seconds. Main issue was the way the temp files were created and how pep8 was called via the shell. So maybe with a 10 second runtime it's not necessary to do any functionality changes to the docstring validation and sharing in the end? |
I think the docstring sharing is still worth removing to:
|
I'm happy to move towards removing or reducing the docstring sharing. But based on my experience getting fully rid of it may take years. If we want to proactively work on duplicating now reused docstrings, I'd start by the ones with higher complexity and see how that goes, before opening issues to remove all them. |
It takes around 22 minutes, for some reason.
The text was updated successfully, but these errors were encountered: