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

autosummary - autosummary_imported_members doesn't apply to items in table #10058

Closed
akdor1154 opened this issue Jan 7, 2022 · 1 comment
Closed
Labels

Comments

@akdor1154
Copy link

akdor1154 commented Jan 7, 2022

Describe the bug

If I have
private.py

class DocumentMe:
  "document me with a docstring"
  pass

public.py

from private import DocumentMe
def some_fn():
  'document me as well'
__all__ = ['DocumentMe', 'some_fn']

conf.py

extensions = [
    'sphinx.ext.autosummary',
    'sphinx.ext.autodoc'
]
autosummary_generate = False
autosummary_imported_members = True
autodoc_class_signature = 'separated'

docs.rst

.. currentmodule:: public

.. autosummary::

   some_fn
   DocumentMe

Then I get a table with some_fn but not DocumentMe:

some_fn() document me as well

I believe this is because the ModuleDocumenter being used never gets its imported_modules flag set, regardless of app config. I'll raise a PR with a basic fix now to illustrate.

How to Reproduce

Set up files as per above

Expected behavior

A table that looks like

some_fn() document me as well
DocumentMe document me with a docstring

Your project

github.com/akdor1154/csql#caching-1

Screenshots

No response

OS

Linux

Python version

3.9

Sphinx version

4.3.2

Sphinx extensions

autodoc, autosummary

Extra tools

No response

Additional context

No response

@akdor1154
Copy link
Author

Ahh, trying to set up a test case but it's more complicated than I thought - I think it's caused by me defining :members: or :exclude-members: or something... still looking.

akdor1154 pushed a commit to akdor1154/sphinx that referenced this issue Jan 7, 2022
Pass the `autosummary_imported_members` config var into
Documenter.options.imported_members, so we don't miss
members from autosummary tables.
akdor1154 pushed a commit to akdor1154/sphinx that referenced this issue Jan 7, 2022
Pass the `autosummary_imported_members` config var into
Documenter.options.imported_members, so we don't miss
members from autosummary tables.
akdor1154 pushed a commit to akdor1154/sphinx that referenced this issue Jan 7, 2022
akdor1154 pushed a commit to akdor1154/sphinx that referenced this issue Jan 7, 2022
Pass the `autosummary_imported_members` config var into
Documenter.options.imported_members, so we don't miss
members from autosummary tables.
tk0miya added a commit that referenced this issue Jan 11, 2022
…misleads_autosummary

Fix #10058: autosummary: Imported members are not shown
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 11, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
1 participant