question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Sphinx>=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:closed
  • Created 3 years ago
  • Reactions:2
  • Comments:14 (13 by maintainers)

github_iconTop GitHub Comments

2reactions
harupycommented, Aug 11, 2020

After some digging, I found that the root cause is that sphinx calls python’s built-in inspect.signature with follow_wrapped=False when processing classes.

sphinx’s inspect.signature which internally calls python’s inspect.signature with follow_wrapped=False by default: https://github.com/sphinx-doc/sphinx/blob/5e6da19f0e44a0ae83944fb6ce18f18f781e1a6e/sphinx/util/inspect.py#L437

ClassDocumenter calls sphinx’s inspect.signature without follow_wrapped. https://github.com/sphinx-doc/sphinx/blob/38b868cc0d0583d9a58496cd121f0bc345bf9eaa/sphinx/ext/autodoc/__init__.py#L1401

The same thing occurs in update_annotations_using_type_comments: https://github.com/sphinx-doc/sphinx/blob/38b868cc0d0583d9a58496cd121f0bc345bf9eaa/sphinx/ext/autodoc/type_comment.py#L122

Hope this makes sense.

1reaction
harupycommented, Aug 13, 2020

Filed a PR in the sphinx repo: https://github.com/sphinx-doc/sphinx/pull/8115 😂

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found