Repository navigation
Conversation
This was referenced Sep 13, 2026
Contributor
Author
This comment was marked as spam.
This comment was marked as spam.
This was referenced Nov 4, 2026
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Purpose
Hej, in #14675, I reported that parallel builds can generate an unreferenced module page.
Upon little bit further investigation, I found that the extra output is not caused by parallelization as I originally thought, but caused by
sphinx.ext.viewcode.collect_pages()using every successful source-analysis entry as a module-page candidate and every cache key when generating the module overview and parent breadcrumbs.A successful analysis entry can have an empty
usedmapping when viewcode finds and analyzes the source module but does not find a source tag for the documented object.These entries can survive in both serial and parallel builds.
Unavailable modules are also cached as
Falseentries.Empty
usedentries can generate unreferenced module pages, while both states can incorrectly affect the module overview and parent breadcrumbs.The fix filters the cache entries at page-collection time and generates output only for successfully analyzed modules with at least one used source tag.
The same filtered set is used for module pages, the module overview, progress reporting, and parent breadcrumbs.
Analysis caching, incremental purging, and parallel environment merging are unchanged.
The regression tests use the
viewcode-find-sourceevent to create a stable analyzed-but-unused module instead of tying the tests to viewcode's current handling of PEP 695 type aliases.They cover fresh serial and parallel builds.
Collector coverage also checks an unavailable-module sentinel, a used child module, the overview, progress reporting, parent breadcrumbs, and preservation of the analysis cache.
References
AI Disclosure
OpenAI Codex assisted with reproduction variants, and generation and review of portions of the implementation and regression tests. All AI-assisted changes were reviewed and understood by me.