mitmproxy --version: incorporate non-annotated tags

This commit is contained in:
Maximilian Hils 2019-12-21 02:18:17 +01:00
parent 294eb32689
commit 89c3675741
2 changed files with 2 additions and 2 deletions

View File

@ -21,7 +21,7 @@ def get_dev_version() -> str:
here = os.path.abspath(os.path.join(os.path.dirname(__file__), "..")) here = os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))
try: try:
git_describe = subprocess.check_output( git_describe = subprocess.check_output(
['git', 'describe', '--long'], ['git', 'describe', '--tags', '--long'],
stderr=subprocess.STDOUT, stderr=subprocess.STDOUT,
cwd=here, cwd=here,
) )

View File

@ -30,5 +30,5 @@ def test_get_version():
m.return_value = b"tag-2-cafecafe" m.return_value = b"tag-2-cafecafe"
assert version.get_dev_version() == "3.0.0rc2 (+2, commit cafecaf)" assert version.get_dev_version() == "3.0.0rc2 (+2, commit cafecaf)"
m.side_effect = subprocess.CalledProcessError(-1, 'git describe --long') m.side_effect = subprocess.CalledProcessError(-1, 'git describe --tags --long')
assert version.get_dev_version() == "3.0.0rc2" assert version.get_dev_version() == "3.0.0rc2"