fix: avoid warnings in custom config option extension#1014
Merged
Conversation
Implement the clear_doc() method to fix warnings about duplicate object definitions when using incremental builds. The data attribute is cached in the build environment, thus the duplication warning triggers on each reprocessed document. But clear_doc() is called for each document being re-read, so it should simply remove the matching previous entries. Not important for sections, these amy simply linger after a partial rebuild if removed. No biggie. Signed-off-by: André Colomb <src@andre.colomb.de>
As declared, the default value should be a set, while the initial_data template contained an empty list. Signed-off-by: André Colomb <src@andre.colomb.de>
Sphinx may process different documents concurrently in several runners. The resulting domain data (signatures and corresponding object entries) must be merged by the Domain code. Declare this extension safe for parallel processing with the method now implemented. Signed-off-by: André Colomb <src@andre.colomb.de>
Signed-off-by: André Colomb <src@andre.colomb.de>
calmh
approved these changes
Jun 8, 2026
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.
The custom extension for implementing special config option directives in Sphinx has always caused lots of warnings for incremental rebuilds and was not safe for parallel builds. Implement two additional Domain methods to fix both issues. Fix some minor quirks and linter warnings for modern Python versions (3.9 is end-of-life already and was the first to support some newer syntax).
Some more details in individual commit messages.