Commit a59b729
authored
fix: avoid warnings in custom config option extension (#1014)
* Clear option index for document on rebuild.
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.
* Fix initialization type of initial sections data.
As declared, the default value should be a set, while the initial_data
template contained an empty list.
* Implement merge_domaindata() method for safe parallel builds.
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.
* Modernize for Python >= 3.9, fix linter warnings.
Signed-off-by: André Colomb <src@andre.colomb.de>1 parent 7cf8f3b commit a59b729
1 file changed
Lines changed: 30 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
11 | 12 | | |
12 | 13 | | |
13 | 14 | | |
14 | 15 | | |
15 | 16 | | |
16 | 17 | | |
17 | 18 | | |
18 | | - | |
19 | 19 | | |
| 20 | + | |
20 | 21 | | |
21 | 22 | | |
22 | 23 | | |
| |||
116 | 117 | | |
117 | 118 | | |
118 | 119 | | |
119 | | - | |
120 | | - | |
| 120 | + | |
| 121 | + | |
121 | 122 | | |
122 | 123 | | |
123 | | - | |
| 124 | + | |
124 | 125 | | |
125 | 126 | | |
126 | 127 | | |
| |||
168 | 169 | | |
169 | 170 | | |
170 | 171 | | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
171 | 192 | | |
172 | 193 | | |
173 | 194 | | |
174 | 195 | | |
175 | 196 | | |
176 | 197 | | |
177 | 198 | | |
178 | | - | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
0 commit comments