mirror of
https://github.com/pybind/pybind11.git
synced 2026-04-20 06:49:25 +00:00
docs: update changelog, nicer output for script (#2811)
This commit is contained in:
@@ -3,7 +3,10 @@
|
||||
|
||||
import re
|
||||
|
||||
import ghapi.core
|
||||
import ghapi.all
|
||||
|
||||
from rich import print
|
||||
from rich.syntax import Syntax
|
||||
|
||||
|
||||
ENTRY = re.compile(
|
||||
@@ -19,8 +22,10 @@ ENTRY = re.compile(
|
||||
re.DOTALL | re.VERBOSE,
|
||||
)
|
||||
|
||||
print()
|
||||
|
||||
api = ghapi.core.GhApi(owner="pybind", repo="pybind11")
|
||||
|
||||
api = ghapi.all.GhApi(owner="pybind", repo="pybind11")
|
||||
|
||||
issues = api.issues.list_for_repo(labels="needs changelog", state="closed")
|
||||
missing = []
|
||||
@@ -34,17 +39,25 @@ for issue in issues:
|
||||
if not msg.endswith("."):
|
||||
msg += "."
|
||||
|
||||
print(msg)
|
||||
print(f" `#{issue.number} <{issue.html_url}>`_\n")
|
||||
msg += f"\n `#{issue.number} <{issue.html_url}>`_"
|
||||
|
||||
print(Syntax(msg, "rst", theme="ansi_light"))
|
||||
print()
|
||||
|
||||
else:
|
||||
missing.append(issue)
|
||||
|
||||
if missing:
|
||||
print()
|
||||
print("-" * 30)
|
||||
print("[blue]" + "-" * 30)
|
||||
print()
|
||||
|
||||
for issue in missing:
|
||||
print(f"Missing: {issue.title}")
|
||||
print(f" {issue.html_url}")
|
||||
print(f"[red bold]Missing:[/red bold][red] {issue.title}")
|
||||
print(f"[red] {issue.html_url}\n")
|
||||
|
||||
print("[bold]Template:\n")
|
||||
msg = "## Suggested changelog entry:\n\n```rst\n\n```"
|
||||
print(Syntax(msg, "md", theme="ansi_light"))
|
||||
|
||||
print()
|
||||
|
||||
Reference in New Issue
Block a user