setup: update scm_version().
authorwhitequark <whitequark@whitequark.org>
Wed, 16 Oct 2019 15:29:13 +0000 (15:29 +0000)
committerwhitequark <whitequark@whitequark.org>
Wed, 16 Oct 2019 15:29:13 +0000 (15:29 +0000)
setup.py

index 5a8baa26dc774fbc961ecf154929ebecff200ac7..016458bd514e9db4597a8c2557ac203d44aeaede 100644 (file)
--- a/setup.py
+++ b/setup.py
@@ -3,8 +3,15 @@ from setuptools import setup, find_packages
 
 def scm_version():
     def local_scheme(version):
-        return version.format_choice("+{node}", "+{node}.dirty")
-    return {"version_scheme": "guess-next-dev", "local_scheme": local_scheme}
+        if version.tag and not version.distance:
+            return version.format_with("")
+        else:
+            return version.format_choice("+{node}", "+{node}.dirty")
+    return {
+        "relative_to": __file__,
+        "version_scheme": "guess-next-dev",
+        "local_scheme": local_scheme
+    }
 
 
 setup(