mkdocstrings / pytkdocs

Load Python objects documentation.
https://mkdocstrings.github.io/pytkdocs
ISC License
50 stars 32 forks source link

`inherited_members` Does **Not** Work #146

Closed Jordan-Dennis closed 1 year ago

Jordan-Dennis commented 1 year ago

Describe the bug I am using mkdocs-simple-plugin, mkdocstrings[python] and pytkdocs to generate documentation. I am extending another package that I worked on (i.e. the parent class is not in the project) but I cannot get the super class methods to render in the docs with inherited_members: True.

To Reproduce This is my construction in the same file (mkdocs-simple) as the class.

::: toliman.TolimanOptics
    handler: python
    selection:
        docstring_style: numpy
        show_source: False
        merge_init_into_class: True
        inherited_members: True
    options:
        members: [insert, remove]

where both insert and remove are methods of the parent class.

Expected behavior I expect the documentation for insert and remove to be visible when I run mkdocs serve

System (please complete the following information):

pawamoy commented 1 year ago

Hello, thanks for the report. I think you're not using pytkdocs but Griffe, because that's what mkdocstrings-python uses. If you want to use pytkdocs, which is the only one supporting inherited members yet, you have to use mkdocstrings-python-legacy (or mkdocstrings[python-legacy], same thing).

Jordan-Dennis commented 1 year ago

Thanks @pawamoy, I have tried to use this but I am now getting the following error, image Running poetry show | grep "docs" I get the following list image The content of my mkdocs.yml is, image Regards Jordan

pawamoy commented 1 year ago

Could you try to remove then recreate your Poetry-managed virtualenv?

Jordan-Dennis commented 1 year ago

Yep that worked. Thank you.