Fix docstrings
See original GitHub issueSphinx>=3.1.0
doesn’t build our documentation for some reason (I guess our experimental
and deprecated
decorators are the devils, not sure though).
At first, as https://github.com/optuna/optuna/issues/1368 said, we were optimistic about this, i.e., we thought the next stable would work. However, it’s not happened yet. So it’s high time we dirtied our hands to enable the latest Sphinx.
~~The latest ongoing pull request is https://github.com/optuna/optuna/pull/1613.~~
Issue Analytics
- State:
- Created 3 years ago
- Reactions:2
- Comments:14 (13 by maintainers)
Top Results From Across the Web
DOC: Fix formatting errors in docstrings · Issue #27977
This should give the list of errors to fix. We've got a list of steps to follow when fixing a docstring that it...
Read more >Python Docstrings
Python documentation strings (or docstrings) provide a convenient way of associating documentation with Python modules, functions, classes, ...
Read more >How do you fix "Missing module docstringpylint ...
A python module's docstring documents what the contents of that file are for. You can solve this error by adding a docstring at...
Read more >Python Docstrings Tutorial : Examples & Format for Pydoc ...
Learn about the different types of docstrings & various docstring formats ... be useful for comments on Fixing bugs and tasks that are...
Read more >Specify types with docstrings | PyCharm Documentation
To specify the parameter types, follow these general steps · Press Ctrl+Alt+S and go to Editor | General |Smart Keys. · Place the...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
After some digging, I found that the root cause is that
sphinx
calls python’s built-ininspect.signature
withfollow_wrapped=False
when processing classes.sphinx’s
inspect.signature
which internally calls python’sinspect.signature
withfollow_wrapped=False
by default: https://github.com/sphinx-doc/sphinx/blob/5e6da19f0e44a0ae83944fb6ce18f18f781e1a6e/sphinx/util/inspect.py#L437ClassDocumenter
calls sphinx’sinspect.signature
withoutfollow_wrapped
. https://github.com/sphinx-doc/sphinx/blob/38b868cc0d0583d9a58496cd121f0bc345bf9eaa/sphinx/ext/autodoc/__init__.py#L1401The same thing occurs in
update_annotations_using_type_comments
: https://github.com/sphinx-doc/sphinx/blob/38b868cc0d0583d9a58496cd121f0bc345bf9eaa/sphinx/ext/autodoc/type_comment.py#L122Hope this makes sense.
Filed a PR in the sphinx repo: https://github.com/sphinx-doc/sphinx/pull/8115 😂