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
Trying to fix API doc signatures #150
Conversation
I know what the problem is now - it's because of the Looking into how to tell sphinx to just look at the |
for more information, see https://pre-commit.ci
OK This is fixed now. What I say above about the introduction of the Basically, autodoc draws its default signatures from a function like this (or exactly this, if using that exact version of sphinx): https://github.com/sphinx-doc/sphinx/blob/b4eca324b0499a4c41ba75b45dedb3d8d7e4497f/sphinx/ext/autodoc/typehints.py#L15-L34 As you can see, it basically just looks at the Now, what is weird is when I called However, trying it in a lower environment replicates what readthedocs sees (and unfortunately, I don't see an option to force readthedocs to use anything other than 3.8...) which is instead, That's all for background. TL;DR - we can fix this real easy with a couple lines in the |
Codecov Report
@@ Coverage Diff @@
## main #150 +/- ##
=======================================
Coverage 91.51% 91.51%
=======================================
Files 64 64
Lines 3349 3349
=======================================
Hits 3065 3065
Misses 284 284
Flags with carried forward coverage won't be shown. Click here to find out more.
|
Nice. I was expecting this would solve the issue on #148 but the tools do not really show up here either. I am starting to think it might be an import issue? I wonder if you have any ideas there. Btw, #149 has the configuration to use python 3.9 on read the docs but I still don't see proper signatures. Check out the Finally, where did you find this setup function for overiding |
So weird... Maybe it's a specific 3.9 subversion? I have no idea at that point.
You see stuff 'like it' scattered around any time custom stuff is needed. I've used it for other stuff before just not this particular function. Here's one example: https://stackoverflow.com/questions/5599254/how-to-use-sphinxs-autodoc-to-document-a-classs-init-self-method The rest is digging into the Python source code for sphinx. |
Curious if this fixes #147...
The
__getattribute__
override itself shouldn't have changed anything, but the metaclass inheritance may have confused sphinx on where to look for the class arguments.This was apparently working back in the day (link from an old PR): https://neuroconv--56.org.readthedocs.build/en/56/api/interfaces.ecephys.html#module-neuroconv.datainterfaces.ecephys.ced.ceddatainterface