Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
autodoc_member_order ignored #13
I am trying to get sphinx to handle async methods in my project. I had good results with
My sphinx configuration has
Help most welcome.
Huh, that definitely sounds like a bug. Off the top of my head I can't think why this would be happening, either, since async and sync methods mostly get handled by the same code paths...
Well, actually, one thing to check is how Sphinx is even finding out the "source order" in the first place. If it's, like, running a regex over the source, and that regex is looking for
Well I do not have much time to spend on this and did not want to waste yours.
The code that does the sorting is in sphinx autodoc extension, in this file.
And at last,
All of this happens in sphinx, I do not know what hooks are available or if it's possible (or even desirable to monkey patch stuff). Probably an issue there…
… and yes, there is an awaiting PR here: sphinx-doc/sphinx#4847
@Sraw Not necessarily... judging from that PR, it might be as simple as adding a monkey-patch to
from sphinx.pycode.parser import VariableCommentPicker if not hasattr(VariableCommentPicker, "visit_AsyncFunctionDef"): VariableCommentPicker.visit_AsyncFunctionDef = VariableCommentPicker.visit_FunctionDef