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

autodoc_mock_imports doesn't work as expected with new :recursive: option #8306

Closed
JamesALeedham opened this issue Oct 10, 2020 · 0 comments
Closed

Comments

@JamesALeedham
Copy link

Describe the bug
I would expect autodoc_mock_imports (and autosummary_mock_imports, the behavior seems to be the same) to exclude an entire module from a project that has been automatically iterated over using the :recursive: option available to sphinx.ext.autosummary since Sphinx 3.1.

It excludes the content of that module, but not the module itself, which ends up as an 'empty' entry in the summary table.

To Reproduce
Steps to reproduce:

  1. Clone https://github.com/JamesALeedham/Sphinx-Autosummary-Recursion.
  2. View the copy of the docs hosted here and observe that mytoolbox.mymodule2 is fully documented.
  3. Edit source/conf.py and add the line autodoc_mock_imports = ['mytoolbox.mymodule2'].
  4. Follow the instructions in the Github Readme to rebuild and view the docs locally.

Expected behavior
mytoolbox.mymodule2 is excluded from the summary table completely.

Actual behavior
mytoolbox.mymodule2 is still listed in the summary table. Click on it, though, and the module is empty - the class it contains is not documented.

@tk0miya tk0miya added this to the 3.5.0 milestone Dec 25, 2020
tk0miya added a commit to tk0miya/sphinx that referenced this issue Dec 27, 2020
…pty page

The :recursive: option for autosummary directive creates an empty page
for mocked modules unexpectedly.  This make them ignored.
tk0miya added a commit that referenced this issue Dec 28, 2020
…mented

Fix #8306: autosummary: mocked modules are documented as empty page
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 16, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants