From 15f525e86bc4dbbf031439098b753f2ee3c98479 Mon Sep 17 00:00:00 2001 From: Maximilian Hils Date: Sun, 7 Jan 2018 20:25:27 +0100 Subject: [PATCH] only use annotated tags for version calculation --- mitmproxy/version.py | 2 +- release/README.md | 4 ++++ test/mitmproxy/test_version.py | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/mitmproxy/version.py b/mitmproxy/version.py index a37f07cf6..d932c0673 100644 --- a/mitmproxy/version.py +++ b/mitmproxy/version.py @@ -33,7 +33,7 @@ def get_version(dev: bool = False, build: bool = False, refresh: bool = False) - here = os.path.abspath(os.path.join(os.path.dirname(__file__), "..")) try: git_describe = subprocess.check_output( - ['git', 'describe', '--tags', '--long'], + ['git', 'describe', '--long'], stderr=subprocess.STDOUT, cwd=here, ) diff --git a/release/README.md b/release/README.md index a60b7f98e..7bb896388 100644 --- a/release/README.md +++ b/release/README.md @@ -5,6 +5,10 @@ Make sure run all these steps on the correct branch you want to create a new rel - Update CHANGELOG - Verify that all CI tests pass - Tag the release and push to Github + - For alphas, betas, and release candidates, use lightweight tags. + This is necessary so that the .devXXXX counter does not reset. + - For final releases, use annotated tags. + This makes the .devXXXX counter reset. - Wait for tag CI to complete ## GitHub Release diff --git a/test/mitmproxy/test_version.py b/test/mitmproxy/test_version.py index b5b33ba12..8c176542d 100644 --- a/test/mitmproxy/test_version.py +++ b/test/mitmproxy/test_version.py @@ -32,5 +32,5 @@ def test_get_version(): m.return_value = b"tag-2-cafecafe" assert version.get_version(True, True) == "3.0.0.dev2-0xcafecaf" - m.side_effect = subprocess.CalledProcessError(-1, 'git describe --tags --long') + m.side_effect = subprocess.CalledProcessError(-1, 'git describe --long') assert version.get_version(True, True) == "3.0.0"