Skip to content
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

Sphinx ignores op-decorated functions #18

Closed
pbourguignon opened this issue Jan 31, 2020 · 1 comment
Closed

Sphinx ignores op-decorated functions #18

pbourguignon opened this issue Jan 31, 2020 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@pbourguignon
Copy link
Contributor

The @op decorator returns an instance of the class Op, so that a function thus decorated is a module-level object that is neither of Class nor function type. It is therefore ignored by sphinx.ext.autodoc.

One workaround consists in explicitly instructing autodoc to include the decorated function by adding the following statement to the module's docstring:

.. autodata:: function_name
   :annotation:

This would however require the decorator to copy the docstring of the wrapped function onto the Op instance it returns.

@pbourguignon pbourguignon self-assigned this Feb 3, 2020
@pbourguignon pbourguignon added the bug Something isn't working label Feb 3, 2020
@pbourguignon
Copy link
Contributor Author

The docstring is now correctly copied (#19). Discovery of the callable instances by Sphinx lies outside of the scope of the library, thus I'm closing the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant