make_changelog.py
Go to the documentation of this file.
1 #!/usr/bin/env python3
2 
3 import re
4 
5 import ghapi.all
6 from rich import print
7 from rich.syntax import Syntax
8 
9 ENTRY = re.compile(
10  r"""
11  Suggested \s changelog \s entry:
12  .*
13  ```rst
14  \s*
15  (.*?)
16  \s*
17  ```
18 """,
19  re.DOTALL | re.VERBOSE,
20 )
21 
22 print()
23 
24 
25 api = ghapi.all.GhApi(owner="pybind", repo="pybind11")
26 
27 issues_pages = ghapi.page.paged(
28  api.issues.list_for_repo, labels="needs changelog", state="closed"
29 )
30 issues = (issue for page in issues_pages for issue in page)
31 missing = []
32 
33 for issue in issues:
34  changelog = ENTRY.findall(issue.body)
35  if changelog:
36  (msg,) = changelog
37  if not msg.startswith("* "):
38  msg = "* " + msg
39  if not msg.endswith("."):
40  msg += "."
41 
42  msg += f"\n `#{issue.number} <{issue.html_url}>`_"
43 
44  print(Syntax(msg, "rst", theme="ansi_light", word_wrap=True))
45  print()
46 
47  else:
48  missing.append(issue)
49 
50 if missing:
51  print()
52  print("[blue]" + "-" * 30)
53  print()
54 
55  for issue in missing:
56  print(f"[red bold]Missing:[/red bold][red] {issue.title}")
57  print(f"[red] {issue.html_url}\n")
58 
59  print("[bold]Template:\n")
60  msg = "## Suggested changelog entry:\n\n```rst\n\n```"
61  print(Syntax(msg, "md", theme="ansi_light"))
62 
63 print()
EIGEN_STRONG_INLINE Packet4f print(const Packet4f &a)


gtsam
Author(s):
autogenerated on Tue Jul 4 2023 02:34:35