do not add leading zeroes to .dev version part.

wheel normalizes to no leading zeroes, and we don't want to special-case
that.
This commit is contained in:
Maximilian Hils 2018-01-04 14:57:17 +01:00
parent 09f6160645
commit d38b5e8552
2 changed files with 2 additions and 2 deletions

View File

@ -48,7 +48,7 @@ def get_version(dev: bool = False, build: bool = False, refresh: bool = False) -
# Add suffix for non-tagged releases
if tag_dist > 0:
mitmproxy_version += ".dev{tag_dist:04}".format(tag_dist=tag_dist)
mitmproxy_version += ".dev{tag_dist}".format(tag_dist=tag_dist)
# The wheel build tag (we use the commit) must start with a digit, so we include "0x"
mitmproxy_version += "-0x{commit}".format(commit=commit)

View File

@ -27,7 +27,7 @@ def test_get_version():
assert version.get_version(True, True) == "3.0.0"
m.return_value = b"tag-2-cafecafe"
assert version.get_version(True, True) == "3.0.0.dev0002-0xcafecaf"
assert version.get_version(True, True) == "3.0.0.dev2-0xcafecaf"
m.side_effect = subprocess.CalledProcessError(-1, 'git describe --tags --long')
assert version.get_version(True, True) == "3.0.0"