sphinx-doc / sphinx-doc/sphinx

Sphinx build stuck in reading sources... when `singledispatch` and `autodoc_mock_imports` are used

Open
#10,591 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

extensions:autodoc type:bug
Dominant language
Python
Stars
8k
Forks
2.6k
PR merge metrics
No merged PRs in 30d

Description

Describe the bug

Sphinx build hangs forever (until it times out) if autodoc_mock_imports is used with code that uses singledispatch.

How to Reproduce

See this repository and its GitHub Actions to reproduce the issue:
https://github.com/rozsasarpi/sphinx_singledispatch

Expected behavior

make html finishes the build.

Your project

https://github.com/rozsasarpi/sphinx_singledispatch

Screenshots

image

OS

Linux/Win

Python version

3.8, 3.9

Sphinx version

5.0.2/4.5.0

Sphinx extensions

sphinx.ext.autodoc, myst_parser

Extra tools

No response

Additional context

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the linked sphinx_singledispatch reproduction repository and run its make html build using both singledispatch and autodoc_mock_imports. Compare it with the working builds that omit one of those features, then trace the sphinx.ext.autodoc processing involved. Done means the combined configuration completes instead of hanging while reading sources.

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
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.