This is an automated email from the ASF dual-hosted git repository.

lidavidm pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/arrow-adbc.git


The following commit(s) were added to refs/heads/main by this push:
     new abdf32c  fix(c/driver_manager,c/driver/postgres): fix version 
inference from Git tags (#184)
abdf32c is described below

commit abdf32c459f50984a8c862cbd9815d02ac021b9b
Author: David Li <[email protected]>
AuthorDate: Wed Nov 16 15:42:16 2022 -0500

    fix(c/driver_manager,c/driver/postgres): fix version inference from Git 
tags (#184)
---
 python/adbc_driver_manager/adbc_driver_manager/_version.py   | 8 ++++++--
 python/adbc_driver_postgres/adbc_driver_postgres/_version.py | 8 ++++++--
 2 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/python/adbc_driver_manager/adbc_driver_manager/_version.py 
b/python/adbc_driver_manager/adbc_driver_manager/_version.py
index 2d2fa6c..919fbef 100644
--- a/python/adbc_driver_manager/adbc_driver_manager/_version.py
+++ b/python/adbc_driver_manager/adbc_driver_manager/_version.py
@@ -103,11 +103,11 @@ def get_version_from_git():
         .decode()
         .strip("v")  # Tags can have a leading 'v', but the version should not
         .rstrip("\n")
-        .rsplit("-", 2)  # Split the latest tag, commits since tag, and hash
+        .rsplit("-", 3)  # Split the latest tag, commits since tag, and hash
     )
 
     try:
-        release, dev, git = description
+        _, release, dev, git = description
     except ValueError:  # No tags, only the git hash
         # prepend 'g' to match with format returned by 'git describe'
         git = "g{}".format(*description)
@@ -204,3 +204,7 @@ def get_cmdclass(pkg_source_path):
             _write_version(os.path.join(base_dir, pkg_source_path, 
STATIC_VERSION_FILE))
 
     return dict(sdist=_sdist, build_py=_build_py)
+
+
+if __name__ == "__main__":
+    print("Version: ", get_version())
diff --git a/python/adbc_driver_postgres/adbc_driver_postgres/_version.py 
b/python/adbc_driver_postgres/adbc_driver_postgres/_version.py
index 2d2fa6c..919fbef 100644
--- a/python/adbc_driver_postgres/adbc_driver_postgres/_version.py
+++ b/python/adbc_driver_postgres/adbc_driver_postgres/_version.py
@@ -103,11 +103,11 @@ def get_version_from_git():
         .decode()
         .strip("v")  # Tags can have a leading 'v', but the version should not
         .rstrip("\n")
-        .rsplit("-", 2)  # Split the latest tag, commits since tag, and hash
+        .rsplit("-", 3)  # Split the latest tag, commits since tag, and hash
     )
 
     try:
-        release, dev, git = description
+        _, release, dev, git = description
     except ValueError:  # No tags, only the git hash
         # prepend 'g' to match with format returned by 'git describe'
         git = "g{}".format(*description)
@@ -204,3 +204,7 @@ def get_cmdclass(pkg_source_path):
             _write_version(os.path.join(base_dir, pkg_source_path, 
STATIC_VERSION_FILE))
 
     return dict(sdist=_sdist, build_py=_build_py)
+
+
+if __name__ == "__main__":
+    print("Version: ", get_version())

Reply via email to