Skip to content

Commit

Permalink
Handle converting four-component versions to semver by use of a pre-r…
Browse files Browse the repository at this point in the history
…elease version component
  • Loading branch information
benjaminwinger committed Aug 14, 2023
1 parent f361abe commit 54df97e
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions tools/rust_api/update_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,12 @@ def get_kuzu_version():
with open(cmake_file) as f:
for line in f:
if line.startswith("project(Kuzu VERSION"):
return line.split(" ")[2].strip()
version = line.split(" ")[2].strip()
# Make version semver-compatible
components = version.split(".")
if len(components) >= 4:
version = ".".join(components[0:3]) + "-" + ".".join(components[3:])
return version


if __name__ == "__main__":
Expand All @@ -38,5 +43,5 @@ def get_kuzu_version():
break

if version_changed:
with open("Cargo.toml", "w", encoding="utf-8") as file:
with open(KUZU_RS_ROOT / "Cargo.toml", "w", encoding="utf-8") as file:
file.writelines(data)

0 comments on commit 54df97e

Please sign in to comment.