aboutsummaryrefslogtreecommitdiff
path: root/tools/make_changelog.py
diff options
context:
space:
mode:
Diffstat (limited to 'tools/make_changelog.py')
-rwxr-xr-xtools/make_changelog.py19
1 files changed, 9 insertions, 10 deletions
diff --git a/tools/make_changelog.py b/tools/make_changelog.py
index 609ce2f1..b5bd8329 100755
--- a/tools/make_changelog.py
+++ b/tools/make_changelog.py
@@ -1,14 +1,11 @@
#!/usr/bin/env python3
-# -*- coding: utf-8 -*-
import re
import ghapi.all
-
from rich import print
from rich.syntax import Syntax
-
ENTRY = re.compile(
r"""
Suggested \s changelog \s entry:
@@ -27,12 +24,17 @@ print()
api = ghapi.all.GhApi(owner="pybind", repo="pybind11")
-issues = api.issues.list_for_repo(labels="needs changelog", state="closed")
+issues_pages = ghapi.page.paged(
+ api.issues.list_for_repo, labels="needs changelog", state="closed"
+)
+issues = (issue for page in issues_pages for issue in page)
missing = []
for issue in issues:
- changelog = ENTRY.findall(issue.body)
- if changelog:
+ changelog = ENTRY.findall(issue.body or "")
+ if not changelog or not changelog[0]:
+ missing.append(issue)
+ else:
(msg,) = changelog
if not msg.startswith("* "):
msg = "* " + msg
@@ -41,12 +43,9 @@ for issue in issues:
msg += f"\n `#{issue.number} <{issue.html_url}>`_"
- print(Syntax(msg, "rst", theme="ansi_light"))
+ print(Syntax(msg, "rst", theme="ansi_light", word_wrap=True))
print()
- else:
- missing.append(issue)
-
if missing:
print()
print("[blue]" + "-" * 30)