Skip to content

Commit 8441ad7

Browse files
committed
Update towncrier checker to look into towncrier generated release notes
1 parent 560cf3b commit 8441ad7

1 file changed

Lines changed: 15 additions & 10 deletions

File tree

‎maint/towncrier_checker.py‎

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -66,16 +66,21 @@
6666

6767
# Find PRs that are mentioned in CHANGE_LOG already
6868
# (most likely cherrypicked to previous bugfix releases)
69-
with open(Path(os.path.dirname(__file__)) / ".." / "CHANGE_LOG") as fin:
70-
# Use regex to find all PR numbers in the file and remove them
71-
pr_re = re.compile(r"\#(\d+)")
72-
prs_in_changelog = [
73-
match.group(1) for match in pr_re.finditer(fin.read())
74-
]
75-
to_remove = {pr for pr in prs if pr in prs_in_changelog}
76-
for pr in to_remove:
77-
print(f"Removing {pr} as already in CHANGELOG")
78-
del prs[pr]
69+
basepath = Path(os.path.dirname(__file__)) / ".."
70+
oldchangelog = basepath / "CHANGE_LOG"
71+
newchangelogs = (basepath / "docs" / "source" / "release").glob("*.rst")
72+
for path in [oldchangelog, *newchangelogs]:
73+
print('Checking', path)
74+
with open(path) as fin:
75+
# Use regex to find all PR numbers in the file and remove them
76+
pr_re = re.compile(r"\#(\d+)")
77+
prs_in_changelog = [
78+
match.group(1) for match in pr_re.finditer(fin.read())
79+
]
80+
to_remove = {pr for pr in prs if pr in prs_in_changelog}
81+
for pr in to_remove:
82+
print(f"Removing {pr} as already in CHANGELOG")
83+
del prs[pr]
7984

8085
# Print PRs with missing notes
8186
if prs:

0 commit comments

Comments
 (0)