Skip to content

Commit

Permalink
fix double vv in version string; update release script
Browse files Browse the repository at this point in the history
  • Loading branch information
Cielquan committed Jul 7, 2024
1 parent 30c6c46 commit c54f48a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ NOTE: please use them in this order.

## [1.2.1 (2024-03-23)](https://github.com/rstcheck/rstcheck-core/releases/v1.2.1)

[diff vv1.2.0...v1.2.1](https://github.com/rstcheck/rstcheck-core/compare/vv1.2.0...v1.2.1)
[diff v1.2.0...v1.2.1](https://github.com/rstcheck/rstcheck-core/compare/v1.2.0...v1.2.1)

### Miscellaneous

Expand Down
21 changes: 11 additions & 10 deletions prep_release.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,14 +71,14 @@ def update_changelog(new_version: str, last_version: str, *, first_release: bool

if release_line:
today = datetime.datetime.now(tz=datetime.UTC).date().isoformat()
compare = f"{'' if first_release else 'v'}{last_version}...v{new_version}"
compare = f"{'' if first_release else ''}{last_version}...v{new_version}"
changelog_lines[release_line] = (
"## Unreleased\n"
"\n"
f"[diff v{new_version}...main]"
f"({REPO_URL}/compare/v{new_version}...main)\n"
"\n"
f"## [{new_version} ({today})]({REPO_URL}/releases/v{new_version})\n"
f"## [{new_version} ({today})]({REPO_URL}/releases/{new_version})\n"
"\n"
f"[diff {compare}]({REPO_URL}/compare/{compare})"
)
Expand All @@ -93,8 +93,8 @@ def update_changelog(new_version: str, last_version: str, *, first_release: bool

def commit_and_tag(version: str) -> None:
"""Git commit and tag the new release."""
subprocess.run(
[ # noqa: S603,S607
subprocess.run( # noqa: S603
[ # noqa: S607
"git",
"commit",
"--no-verify",
Expand All @@ -105,8 +105,9 @@ def commit_and_tag(version: str) -> None:
],
check=True,
)
subprocess.run(
["git", "tag", "-am", f"'v{version}'", f"v{version}"], check=True # noqa: S603,S607
subprocess.run( # noqa: S603
["git", "tag", "-am", f"'v{version}'", f"v{version}"], # noqa: S607
check=True,
)


Expand Down Expand Up @@ -139,15 +140,15 @@ def _main() -> int:
if args.first_release:
release_version = "v1.0.0"
#: Get first commit
current_version = subprocess.run(
["git", "rev-list", "--max-parents=0", "HEAD"], # noqa: S603,S607
current_version = subprocess.run( # noqa: S603
["git", "rev-list", "--max-parents=0", "HEAD"], # noqa: S607
check=True,
capture_output=True,
).stdout.decode()[0:7]
else:
git_tags = (
subprocess.run(
["git", "tag", "--list"], # noqa: S603,S607
subprocess.run( # noqa: S603
["git", "tag", "--list"], # noqa: S607
check=True,
capture_output=True,
cwd=Path(__file__).parent,
Expand Down

0 comments on commit c54f48a

Please sign in to comment.