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

No links to items in summary tables when using __init__.py imports #65

Closed
raymanP opened this issue Sep 27, 2021 · 5 comments · Fixed by #70
Closed

No links to items in summary tables when using __init__.py imports #65

raymanP opened this issue Sep 27, 2021 · 5 comments · Fixed by #70

Comments

@raymanP
Copy link

raymanP commented Sep 27, 2021

Hi dears,
if having an module import in __init__.py the links are missing for the class.
Sphinx is showing the links correctly, .e.g. for :meth:`mymodule.myclass.mymethod` for the below example.

Example:

  • mymodule/__init__.py
    from mymodule.mysubmodule import myclass

  • mymodule/mysubmodule.py

class myclass():
    def mymethod(self):
        """my doc"""
  • doc.rst
.. currentmodule:: mymodule.myclass

.. autoclasssumm:: myclass
    :autosummary-members:
@Chilipp
Copy link
Owner

Chilipp commented Sep 27, 2021

hey @raymanP! I wonder what you get with

.. autosummary::

    myclass.mymethod

Could you please try? I wonder whether this could be related to what I observed quite some time ago in sphinx-doc/sphinx#9069

@raymanP
Copy link
Author

raymanP commented Sep 27, 2021

hey @Chilipp! Thank you for your fast reply! This also produces an entry without a link.
I already tried all possibilities I could imagine.

Classes in the same module which are not in the __init__.py are linked correctly.

@Chilipp
Copy link
Owner

Chilipp commented Sep 27, 2021

hey @raymanP! thanks for the confirmation! this is what I expected. It's an upstream issue in autosummary, sphinx-doc/sphinx#9069. It would work, if you import from mymodule.mysubmodule import myclass as _myclass, but unfortunately I do not have any other workaround. One would need to fix the upstream issue

@raymanP
Copy link
Author

raymanP commented Sep 27, 2021

Great to know.. Thank you @Chilipp! Then I will wait for the upstream fix. :)

@raymanP
Copy link
Author

raymanP commented Sep 27, 2021

Then we can close this here. Have a nice day ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants