Skip to content

Commit 400001d

Browse files
committed
do not update version if can not get commit
1 parent 955eac6 commit 400001d

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

setup.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,18 @@
1111
with open(filepath) as version_file:
1212
(__version__,) = re.findall('__version__ = "(.*)"', version_file.read())
1313
if __version__.endswith(".dev0"):
14-
dev_version_id = "unknown_version"
14+
dev_version_id = ""
1515
try:
1616
repo_root = os.path.dirname(os.path.realpath(__file__))
1717
dev_version_id = (
1818
subprocess.check_output(["git", "rev-parse", "--short", "HEAD"], cwd=repo_root) # nosec
1919
.strip()
2020
.decode()
2121
)
22+
dev_version_id = "+" + dev_version_id
2223
except subprocess.CalledProcessError:
2324
pass
24-
__version__ = __version__ + "+" + dev_version_id
25+
__version__ = __version__ + dev_version_id
2526
except Exception as error:
2627
assert False, "Error: Could not open '%s' due %s\n" % (filepath, error)
2728

0 commit comments

Comments
 (0)