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

Cannot omit undoc-members when specifying options #456

Closed
mfncooper opened this issue Jun 15, 2024 · 2 comments
Closed

Cannot omit undoc-members when specifying options #456

mfncooper opened this issue Jun 15, 2024 · 2 comments

Comments

@mfncooper
Copy link

This is rather a bizarre issue that I'm seeing with sphinx-autoapi version 3.1.1.

Simple test case with directory structure as follows:

./docs
./docs/index.rst
./docs/Makefile
./docs/conf.py
./tc
./tc/__init__.py

init.py contains only:

class MyClass:
    """ This is my base class. """

    def a_method(self):
        """ This is a method. """
        pass

and conf.py is as follows:

project = 'TestCase'
author = 'Martin F N Cooper'
copyright = '2024, ' + author

extensions = [
    'autoapi.extension'
]
autoapi_dirs = ['../tc']

# The following is the default set of options from the docs. This works.
#autoapi_options = [ 'members', 'undoc-members', 'private-members', 'show-inheritance', 'show-module-summary', 'special-members', 'imported-members' ]

# The following is the same list but without 'undoc-members'. This breaks.
autoapi_options = [ 'members', 'private-members', 'show-inheritance', 'show-module-summary', 'special-members', 'imported-members' ]

templates_path = ['_templates']

When running make html in the docs directory, I get:

Extension error (autoapi.extension):
Handler <function run_autoapi at 0x10783f700> for event 'builder-inited' threw an exception (exception: [Errno 2] No such file or directory: '/Users/<rest_of_path>/docs/autoapi/index.rst')

As noted in the conf.py comments, it works if I use the complete list of defaults. If I omit the options specification entirely, it behaves the same as if I specify those defaults (not surprisingly). But if I specify any options, I must include 'undoc-members' or it fails. This is particularly odd since, in this example, I don't actually have any undocumented members.

@sachahu1
Copy link

sachahu1 commented Jun 17, 2024

I believe this is a duplicate of #448 and #441.

See this comment

@AWhetter
Copy link
Collaborator

Closing as a duplicate of #448. You can omit undoc-members but you must document the module, otherwise it is considered undocumented and therefore not rendered.

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

No branches or pull requests

3 participants