Skip to content

Commit 8adfc87

Browse files
add update uv lock to bump command
1 parent ac2335b commit 8adfc87

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

.bin/bump.py

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,18 @@ def update_changelog(new_version: str) -> None:
144144
run("git", "commit", "-m", f"update CHANGELOG for version {new_version}")
145145

146146

147+
def update_uv_lock(new_version: str) -> None:
148+
run("uv", "lock")
149+
150+
changes = run("git", "status", "--porcelain", force_run=True)
151+
if "uv.lock" not in changes:
152+
print("No changes to uv.lock, skipping commit")
153+
return
154+
155+
run("git", "add", "uv.lock")
156+
run("git", "commit", "-m", f"update uv.lock for version {new_version}")
157+
158+
147159
cli = typer.Typer()
148160

149161

@@ -187,9 +199,14 @@ def version(
187199
new_version = get_new_version(version, tag)
188200
release_branch = f"release-v{new_version}"
189201

190-
run("git", "checkout", "-b", release_branch)
202+
try:
203+
run("git", "checkout", "-b", release_branch)
204+
except Exception:
205+
run("git", "checkout", release_branch)
206+
191207
run("bumpver", "update", tag=tag, **{version: True})
192208
update_changelog(new_version)
209+
update_uv_lock(new_version)
193210

194211
run("git", "push", "--set-upstream", "origin", release_branch)
195212
title = run("git", "log", "-1", "--pretty=%s")

0 commit comments

Comments
 (0)