Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions scripts/bump_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
def get_current_version():
"""Extract current version from pyproject.toml."""
pyproject_path = Path(__file__).parent.parent / "pyproject.toml"
content = pyproject_path.read_text()
content = pyproject_path.read_text(encoding="utf-8")
match = re.search(r'version = "(\d+\.\d+\.\d+)"', content)
if not match:
raise ValueError("Could not find version in pyproject.toml")
Expand All @@ -41,14 +41,14 @@ def bump_version(current_version, bump_type):
def update_version(new_version):
"""Update version in pyproject.toml."""
pyproject_path = Path(__file__).parent.parent / "pyproject.toml"
content = pyproject_path.read_text()
content = pyproject_path.read_text(encoding="utf-8")

# Update version
new_content = re.sub(
r'version = "\d+\.\d+\.\d+"', f'version = "{new_version}"', content
)

pyproject_path.write_text(new_content)
pyproject_path.write_text(new_content,encoding="utf-8")

# run uv sync
subprocess.run(["uv", "sync"])
Expand Down
Loading