-
-
Notifications
You must be signed in to change notification settings - Fork 350
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 missing docstrings #2762
Add missing docstrings #2762
Conversation
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## master #2762 +/- ##
=======================================
Coverage 99.18% 99.18%
=======================================
Files 115 115
Lines 17551 17551
Branches 3149 3149
=======================================
Hits 17408 17408
Misses 99 99
Partials 44 44
|
This is now the only thing remaining for |
…l.rst, and copy documentation from reference-lowlevel.rst to trio/_core_io kqueue, epoll and windows
…xports when getting ruff warnings, add docstring for fromshare
…the value of success on AssertionError
|
@njsmith (and anybody else even remotely familiar with #26, #52 or the docstrings in question):
|
I think this might be because of differences in the installed version of ruff and the pre-commit ruff hook version, not completely sure to be honest though. At least for me, I always have to run the gen_exports script with python3.11 instead of just running it directly, because my system defaults to python3.9, and the version of packages used in the different python installations is different. Not sure if this applies but I thought I'd mention it.
This is because it's attempting to autofix the errors, and right now the config says it doesn't need to comment about what fixes it applies.
So I think the "leftover violations" are the warnings, or maybe we need to specifically say |
Ah shit, this is my bad. I had a
Yeah, it's autofixing instead of reporting the errors but we've disabled autofix in the pre-commit CI and it's failing because files are getting changed. So we either need to disable autofix for ruff when it's run through pre-commit, or for pre-commit to display the changes to the files that caused it to fail. Re: "@CoolCat467 |
I think I got the overloads from the |
Simplifying the mess sounds like a big win to me, cause this is indeed really really messy |
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 great to me - thanks, @jakkdl!
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.
I think that for the information we have these look great
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.
General formatting things, content looks fine.
trio/_core/_io_epoll.py
Outdated
"""Call this before closing a file descriptor (on Unix) or socket (on | ||
Windows). This will cause any `wait_readable` or `wait_writable` | ||
calls on the given object to immediately wake up and raise | ||
`~trio.ClosedResourceError`. |
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.
First line should be a description but not exactly sure what would work.
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.
Notify waiters of the given object that it will be closed.
works?
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.
Yeah
trio/_core/_io_windows.py
Outdated
"""Call this before closing a file descriptor (on Unix) or socket (on | ||
Windows). This will cause any `wait_readable` or `wait_writable` | ||
calls on the given object to immediately wake up and raise | ||
`~trio.ClosedResourceError`. |
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.
Also missing summary.
trio/_subprocess.py
Outdated
Raises: | ||
OSError: if the process spawning fails, for example because the | ||
specified command could not be found. |
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.
Is this docstring format correct? You use the plain sphinx format elsewhere in this PR.
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.
This is a copy-paste of the docstring at line 346 for _open_process
- but maybe that one is incorrectly formatted? Or all the other ones I copy-pasted from the docs are?
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.
TBH as long as sphinx renders this fine then whatever. And it does seem to.
trio/_subprocess.py
Outdated
Raises: | ||
UnicodeError: if ``stdin`` is specified as a Unicode string, rather | ||
than bytes | ||
ValueError: if multiple redirections are specified for the same | ||
stream, e.g., both ``capture_stdout=True`` and | ||
``stdout=subprocess.DEVNULL`` | ||
subprocess.CalledProcessError: if ``check=False`` is not passed | ||
and the process exits with a nonzero exit status | ||
OSError: if an error is encountered starting or communicating with | ||
the process |
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.
Again note about docstring format
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.
same thing - copypasted from run_process
earlier in the file. (and yes duplicate docstrings is incredibly ugly and bad... but I don't know how to improve @TeamSpen210's magic to avoid needing to and have it work both on runtime, in static analysis, and on all platforms.)
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.
TBH sphinx renders this fine so whatever.
Co-authored-by: EXPLOSION <git@helvetica.moe>
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 fine, if things don't like multiple docstring formats then we can fix them then. Not worth the time ATM I think.
(also the summary looks fine, so maybe add that before merging ^^ -- not sure if you already did but the comments aren't resolved so IDK)
Sorry yeah, I added them :) Time to get rid of the jsons!! 🚀 |
I started trying to write these ... and while I could maybe figure out what the functions are supposed to do it would be lovely if somebody else chipped in with suggestions (@A5rocks? @njsmith?)
This also made me notice that there were some problems in #2753 with
open_process
andrun_process
, I noted them here but they should probably be fixed by @TeamSpen210 in a separate PR