mirror of
https://github.com/python/cpython.git
synced 2025-09-26 10:19:53 +00:00
gh-101100: Use list of 'dirty' docs, with warnings, instead of a clean list (#103191)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
This commit is contained in:
parent
11c302055a
commit
24facd60f6
3 changed files with 332 additions and 371 deletions
|
@ -6,16 +6,39 @@ so they are rebuilt and we can catch regressions.
|
|||
|
||||
from pathlib import Path
|
||||
|
||||
# Input file has blank line between entries to reduce merge conflicts
|
||||
with Path("Doc/tools/clean-files.txt").open() as clean_files:
|
||||
CLEAN = [
|
||||
wrong_directory_msg = "Must run this script from the repo root"
|
||||
assert Path("Doc").exists() and Path("Doc").is_dir(), wrong_directory_msg
|
||||
|
||||
# Exclude these whether they're dirty or clean,
|
||||
# because they trigger a rebuild of dirty files.
|
||||
EXCLUDE_FILES = {
|
||||
Path("Doc/whatsnew/changelog.rst"),
|
||||
}
|
||||
|
||||
# Subdirectories of Doc/ to exclude.
|
||||
EXCLUDE_SUBDIRS = {
|
||||
".env",
|
||||
".venv",
|
||||
"env",
|
||||
"includes",
|
||||
"venv",
|
||||
}
|
||||
|
||||
ALL_RST = {
|
||||
rst for rst in Path("Doc/").rglob("*.rst") if rst.parts[1] not in EXCLUDE_SUBDIRS
|
||||
}
|
||||
|
||||
with Path("Doc/tools/.nitignore").open() as clean_files:
|
||||
DIRTY = {
|
||||
Path(filename.strip())
|
||||
for filename in clean_files
|
||||
if filename.strip() and not filename.startswith("#")
|
||||
]
|
||||
}
|
||||
|
||||
CLEAN = ALL_RST - DIRTY - EXCLUDE_FILES
|
||||
|
||||
print("Touching:")
|
||||
for filename in CLEAN:
|
||||
for filename in sorted(CLEAN):
|
||||
print(filename)
|
||||
filename.touch()
|
||||
print(f"Touched {len(CLEAN)} files")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue