Skip to content

Commit f7711ba

Browse files
committed
Updated changelog and improved changelog generation.
1 parent a4fc327 commit f7711ba

File tree

2 files changed

+29
-10
lines changed

2 files changed

+29
-10
lines changed

docs/CHANGES.md

Lines changed: 24 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tasks.py

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -156,21 +156,16 @@ def update_changelog(ctx: Context, version: str | None = None, dry_run: bool = F
156156
lines = []
157157
ignored_commits = []
158158
for line in output.decode("utf-8").strip().split("\n"):
159-
re_match = re.match(r"(.*)\(\#(\d+)\)", line)
159+
re_match = re.match(r".*\(\#(\d+)\)", line)
160160
if re_match and "materialsproject/dependabot/pip" not in line:
161-
pr_number = re_match[2]
162-
pr_name = re_match[1]
161+
pr_number = re_match[1].strip()
163162
response = requests.get(
164163
f"https://api.github.com/repos/materialsproject/pymatgen/pulls/{pr_number}",
165164
timeout=60,
166165
)
167-
lines += [f"* PR #{pr_number} {pr_name}"]
168-
json_resp = response.json()
169-
import pprint
170-
171-
pprint.pprint(json_resp)
172-
lines += [f"* PR #{pr_number} {pr_name} by @{json_resp['user']['login']}"]
173-
if body := json_resp["body"]:
166+
resp = response.json()
167+
lines += [f"- PR #{pr_number} {resp['title'].strip()} by @{resp['user']['login']}"]
168+
if body := resp["body"]:
174169
for ll in map(str.strip, body.split("\n")):
175170
if ll in ("", "## Summary"):
176171
continue

0 commit comments

Comments
 (0)