|
6 | 6 |
|
7 | 7 | def check_release_month(line: str, current_date: datetime.date):
|
8 | 8 | current_month = current_date.strftime("%B").lower()[:3]
|
9 |
| - month_match = re.search("month = {(?P<month>[a-z]{3})}", line) |
| 9 | + month_match = re.search("month = (?P<month>[a-z]{3})", line) |
| 10 | + if month_match is not None: |
| 11 | + print(month_match["month"]) |
10 | 12 | if month_match is not None and month_match["month"] != current_month:
|
11 | 13 | raise ValueError(
|
12 | 14 | f"Release month in README.md ({month_match['month']}) is not consistent with current month ({current_month}). Please update it."
|
@@ -40,13 +42,13 @@ def check_release_date():
|
40 | 42 | args = parser.parse_args()
|
41 | 43 | major, minor, patch = args.version
|
42 | 44 |
|
43 |
| - # os.system("git checkout main") |
44 |
| - # os.system("git pull") |
| 45 | + os.system("git checkout main") |
| 46 | + os.system("git pull") |
45 | 47 |
|
46 | 48 | check_release_date()
|
47 | 49 |
|
48 |
| - # new_branch = f"prepare-release-{major}.{minor}.{patch}" |
49 |
| - # os.system(f"git checkout -b {new_branch}") |
50 |
| - # os.system(f"bump2version --new-version {major}.{minor}.{patch} --commit .") |
51 |
| - # os.system(f"bump2version --new-version {major}.{minor + 1}.0.dev0 --commit .") |
52 |
| - # os.system(f"git push --set-upstream origin {new_branch}") |
| 50 | + new_branch = f"prepare-release-{major}.{minor}.{patch}" |
| 51 | + os.system(f"git checkout -b {new_branch}") |
| 52 | + os.system(f"bump2version --new-version {major}.{minor}.{patch} --commit .") |
| 53 | + os.system(f"bump2version --new-version {major}.{minor + 1}.0.dev0 --commit .") |
| 54 | + os.system(f"git push --set-upstream origin {new_branch}") |
0 commit comments