|
4 | 4 | import re
|
5 | 5 | import subprocess
|
6 | 6 | from pathlib import Path
|
7 |
| -from typing import DefaultDict, List, Tuple |
| 7 | +from typing import List, Tuple |
8 | 8 |
|
9 | 9 | import nox
|
10 | 10 | from nox.sessions import Session
|
@@ -168,26 +168,17 @@ def commits_since_last_tag(session: Session) -> None:
|
168 | 168 | .split("\n")
|
169 | 169 | )
|
170 | 170 |
|
171 |
| - commits: List[Tuple[str, str, str]] = [] |
172 |
| - for commit_ref in commit_references: |
| 171 | + def parse_commit_reference(commit_ref: str) -> Tuple[str, str, str]: |
173 | 172 | commit_sha, remainder = commit_ref.split(" ", 1)
|
174 | 173 | commit_message, commit_date = remainder[1:-1].rsplit(", ", 1)
|
175 |
| - commits.append((commit_sha, commit_message, commit_date)) |
| 174 | + return commit_sha, commit_message, commit_date |
176 | 175 |
|
177 |
| - commits_by_date: DefaultDict[str, List[str]] = DefaultDict(list) |
178 |
| - for sha, msg, date in commits: |
| 176 | + for sha, msg, _ in map(parse_commit_reference, commit_references): |
179 | 177 | if rst_format:
|
180 | 178 | sha_repr = f"`{sha} <https://github.com/idom-team/idom/commit/{sha}>`__"
|
181 | 179 | else:
|
182 | 180 | sha_repr = sha
|
183 |
| - commits_by_date[date].append(f"{msg} - {sha_repr}") |
184 |
| - |
185 |
| - for date, commits in commits_by_date.items(): |
186 |
| - print(f"Commits on {date}") |
187 |
| - print() |
188 |
| - for cmt in commits: |
189 |
| - print("-", cmt) |
190 |
| - print() |
| 181 | + print(f"- {msg} - {sha_repr}") |
191 | 182 |
|
192 | 183 |
|
193 | 184 | def install_idom_dev(session: Session, extras: str = "stable") -> None:
|
|
0 commit comments