Skip to content

Commit f192a55

Browse files
hugovkCAM-Gerlach
andauthored
gh-101100: Fix Sphinx warning in gc.rst and refactor docs clean list (#103116)
Co-authored-by: C.A.M. Gerlach <[email protected]>
1 parent 21e9de3 commit f192a55

File tree

4 files changed

+32
-3
lines changed

4 files changed

+32
-3
lines changed

.github/workflows/doc.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,7 @@ jobs:
7272
- name: 'Build known-good files in nit-picky mode'
7373
run: |
7474
# Mark files that must pass nit-picky
75-
touch Doc/whatsnew/3.12.rst
76-
touch Doc/library/sqlite3.rst
75+
python Doc/tools/touch-clean-files.py
7776
# Build docs with the '-n' (nit-picky) option, convert warnings to errors (-W)
7877
make -C Doc/ PYTHON=../python SPHINXOPTS="-q -n -W --keep-going" html 2>&1
7978

Doc/library/gc.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ values but should not rebind them):
251251
are printed.
252252

253253
.. versionchanged:: 3.4
254-
Following :pep:`442`, objects with a :meth:`__del__` method don't end
254+
Following :pep:`442`, objects with a :meth:`~object.__del__` method don't end
255255
up in :attr:`gc.garbage` anymore.
256256

257257
.. data:: callbacks

Doc/tools/clean-files.txt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# These files must pass Sphinx nit-picky mode, as tested on the CI
2+
# via touch-clean-files.py in doc.yml.
3+
# Add blank lines between files and keep them sorted lexicographically
4+
# to help avoid merge conflicts.
5+
6+
Doc/library/gc.rst
7+
8+
Doc/library/sqlite3.rst
9+
10+
Doc/whatsnew/3.12.rst

Doc/tools/touch-clean-files.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#!/usr/bin/env python3
2+
"""
3+
Touch files that must pass Sphinx nit-picky mode
4+
so they are rebuilt and we can catch regressions.
5+
"""
6+
7+
from pathlib import Path
8+
9+
# Input file has blank line between entries to reduce merge conflicts
10+
with Path("Doc/tools/clean-files.txt").open() as clean_files:
11+
CLEAN = [
12+
Path(filename.strip())
13+
for filename in clean_files
14+
if filename.strip() and not filename.startswith("#")
15+
]
16+
17+
print("Touching:")
18+
for filename in CLEAN:
19+
print(filename)
20+
filename.touch()

0 commit comments

Comments
 (0)