astropy / astropy/sphinx-automodapi

Does not mock with autodoc_mock_imports

Open
#77 1 comment 0 reactions 0 assignees View on GitHub
bug
Dominant language
Python
Stars
67
Forks
48
Avg merge
11h 52m
Merged PRs (30d)
1

Description

Sphinx autodoc uses `autodoc_mock_imports` to, well, mock imports.

Trying to mock modules with `MagicMock` causes them to be excluded from the compiled docs, see https://github.com/sphinx-doc/sphinx/issues/4956

Since automodapi doesn't respect `autodoc_mock_imports`, it tries to import the modules, but since they can't be mocked otherwise (as far as I have been able to get) this breaks automodapi when modules need to be mocked (ie. build with readthedocs).

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing the documentation build using Sphinx's autodoc_mock_imports with a MagicMock-imported module, then inspect how automodapi discovers and imports modules. Compare the generated output with and without mocked imports; done means automodapi respects autodoc_mock_imports without excluding the mocked modules from the compiled docs.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
documentation
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.