|
7 | 7 | from datetime import datetime, timezone
|
8 | 8 | from typing import Dict, List, Tuple
|
9 | 9 |
|
10 |
| -from rich.prompt import Prompt |
11 |
| - |
12 | 10 | GH_ORG = "py-pdf"
|
13 | 11 | GH_PROJECT = "pypdf"
|
14 | 12 | VERSION_FILE_PATH = "pypdf/_version.py"
|
@@ -84,6 +82,8 @@ def adjust_version_py(version: str) -> None:
|
84 | 82 |
|
85 | 83 | def get_version_interactive(new_version: str, changes: str) -> str:
|
86 | 84 | """Get the new __version__ interactively."""
|
| 85 | + from rich.prompt import Prompt |
| 86 | + |
87 | 87 | print("The changes are:")
|
88 | 88 | print(changes)
|
89 | 89 | orig = new_version
|
@@ -308,19 +308,17 @@ def get_git_commits_since_tag(git_tag: str) -> List[Change]:
|
308 | 308 | Returns:
|
309 | 309 | List of all changes since git_tag.
|
310 | 310 | """
|
311 |
| - commits = str( |
312 |
| - subprocess.check_output( |
313 |
| - [ |
314 |
| - "git", |
315 |
| - "--no-pager", |
316 |
| - "log", |
317 |
| - f"{git_tag}..HEAD", |
318 |
| - '--pretty=format:"%H:::%s:::%aN"', |
319 |
| - ], |
320 |
| - stderr=subprocess.STDOUT, |
321 |
| - ) |
322 |
| - ).strip("'b\\n") |
323 |
| - lines = commits.split("\\n") |
| 311 | + commits = subprocess.check_output( |
| 312 | + [ |
| 313 | + "git", |
| 314 | + "--no-pager", |
| 315 | + "log", |
| 316 | + f"{git_tag}..HEAD", |
| 317 | + '--pretty=format:"%H:::%s:::%aN"', |
| 318 | + ], |
| 319 | + stderr=subprocess.STDOUT, |
| 320 | + ).decode("UTF-8").strip() |
| 321 | + lines = commits.splitlines() |
324 | 322 | authors = get_author_mapping(len(lines))
|
325 | 323 | return [parse_commit_line(line, authors) for line in lines if line != ""]
|
326 | 324 |
|
|
0 commit comments