Skip to content
Merged
Show file tree
Hide file tree
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
4 changes: 3 additions & 1 deletion adbc_drivers_dev/make.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,9 @@ def detect_version(
)
)
rev = check_output(["git", "rev-parse", "--short", "HEAD"], cwd=repo_root)
version += f"-dev.{count}.{rev}"
# Prefix the revision so an all-numeric hash with a leading zero is
# not interpreted as an invalid numeric SemVer identifier.
version += f"-dev.{count}.g{rev}"

# Append -dirty if there are uncommitted changes
dirty = check_output(["git", "status", "--porcelain"], cwd=repo_root).splitlines()
Expand Down
2 changes: 1 addition & 1 deletion tests/test_detect_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def test_after_tag(repo):
cwd=repo,
)
version = detect_version(repo)
assert version.startswith("v1.2.3-dev.1."), version
assert version.startswith("v1.2.3-dev.1.g"), version


def test_after_tag_subdir(repo):
Expand Down