Skip to content

Commit bde6d88

Browse files
authored
fix(scripts): add uv lock refresh to version update script (#50)
The update_version.py script now runs `uv lock` after updating the version in __init__.py. This ensures that uv.lock stays in sync when pyproject.toml version changes, preventing potential lockfile inconsistencies after release-please updates. Changes: - Import subprocess module for running shell commands - Add `uv lock` execution at the end of main() - Update docstring to reflect the additional responsibility
1 parent e0a67c2 commit bde6d88

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

scripts/update_version.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,14 @@
1111
"""
1212

1313
import re
14+
import subprocess
1415
from pathlib import Path
1516

1617
import tomli
1718

1819

1920
def main() -> None:
20-
"""Update version in __init__.py to match pyproject.toml."""
21+
"""Update version in __init__.py to match pyproject.toml and refresh uv.lock."""
2122
# Read version from pyproject.toml
2223
pyproject_path = Path("pyproject.toml")
2324
init_path = Path("stackone_ai/__init__.py")
@@ -36,6 +37,11 @@ def main() -> None:
3637
else:
3738
print(f"Version in {init_path} already matches {version}")
3839

40+
# Update uv.lock to reflect version change in pyproject.toml
41+
print("Updating uv.lock...")
42+
subprocess.run(["uv", "lock"], check=True)
43+
print("uv.lock updated successfully")
44+
3945

4046
if __name__ == "__main__":
4147
main()

0 commit comments

Comments
 (0)