mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-11 12:27:14 +02:00
Hardcopy of pybind11 instead of using git submodules (#552)
* removed pybind as submodule * added hardcopy of pybind11 2.10.0 * rename pybind11 folder to avoid conflicts when changing branch Co-authored-by: Dhanya Thattil <dhanya.thattil@psi.ch>
This commit is contained in:
63
libs/pybind/tools/make_changelog.py
Executable file
63
libs/pybind/tools/make_changelog.py
Executable file
@ -0,0 +1,63 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
import re
|
||||
|
||||
import ghapi.all
|
||||
from rich import print
|
||||
from rich.syntax import Syntax
|
||||
|
||||
ENTRY = re.compile(
|
||||
r"""
|
||||
Suggested \s changelog \s entry:
|
||||
.*
|
||||
```rst
|
||||
\s*
|
||||
(.*?)
|
||||
\s*
|
||||
```
|
||||
""",
|
||||
re.DOTALL | re.VERBOSE,
|
||||
)
|
||||
|
||||
print()
|
||||
|
||||
|
||||
api = ghapi.all.GhApi(owner="pybind", repo="pybind11")
|
||||
|
||||
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:
|
||||
(msg,) = changelog
|
||||
if not msg.startswith("* "):
|
||||
msg = "* " + msg
|
||||
if not msg.endswith("."):
|
||||
msg += "."
|
||||
|
||||
msg += f"\n `#{issue.number} <{issue.html_url}>`_"
|
||||
|
||||
print(Syntax(msg, "rst", theme="ansi_light", word_wrap=True))
|
||||
print()
|
||||
|
||||
else:
|
||||
missing.append(issue)
|
||||
|
||||
if missing:
|
||||
print()
|
||||
print("[blue]" + "-" * 30)
|
||||
print()
|
||||
|
||||
for issue in missing:
|
||||
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