Skip to content

fix: avoid warnings in custom config option extension#1014

Merged
acolomb merged 4 commits into
syncthing:mainfrom
acolomb:fix-config-ext-warnings
Jun 8, 2026
Merged

fix: avoid warnings in custom config option extension#1014
acolomb merged 4 commits into
syncthing:mainfrom
acolomb:fix-config-ext-warnings

Conversation

@acolomb

@acolomb acolomb commented Jun 7, 2026

Copy link
Copy Markdown
Member

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.

acolomb added 4 commits June 7, 2026 23:10
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>
@acolomb acolomb merged commit a59b729 into syncthing:main Jun 8, 2026
4 checks passed
@acolomb acolomb deleted the fix-config-ext-warnings branch June 8, 2026 09:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants