Skip to content
Snippets Groups Projects

Draft: Develop

Closed Markus Holzer requested to merge holzer/pystencils:develop into master
5 files
+ 114
37
Compare changes
  • Side-by-side
  • Inline
Files
5
+ 15
12
@@ -18,17 +18,20 @@ def version_number_from_git(tag_prefix='release/', sha_length=10, version_format
@@ -18,17 +18,20 @@ def version_number_from_git(tag_prefix='release/', sha_length=10, version_format
version_strings = get_released_versions()
version_strings = get_released_versions()
version_strings.sort(key=StrictVersion)
version_strings.sort(key=StrictVersion)
latest_release = version_strings[-1]
if len(version_strings) > 0:
commits_since_tag = subprocess.getoutput('git rev-list {}..HEAD --count'.format(tag_from_version(latest_release)))
latest_release = version_strings[-1]
sha = subprocess.getoutput('git rev-parse HEAD')[:sha_length]
commits_since_tag = subprocess.getoutput('git rev-list {}..HEAD --count'.format(tag_from_version(latest_release)))
is_dirty = len(subprocess.getoutput("git status --untracked-files=no -s")) > 0
sha = subprocess.getoutput('git rev-parse HEAD')[:sha_length]
 
is_dirty = len(subprocess.getoutput("git status --untracked-files=no -s")) > 0
if int(commits_since_tag) == 0:
if int(commits_since_tag) == 0:
version_string = latest_release
version_string = latest_release
else:
else:
next_version = increment_version(latest_release)
next_version = increment_version(latest_release)
version_string = version_format.format(version=next_version, commits=commits_since_tag, sha=sha)
version_string = version_format.format(version=next_version, commits=commits_since_tag, sha=sha)
if is_dirty:
if is_dirty:
version_string += ".dirty"
version_string += ".dirty"
return version_string
return version_string
 
else:
 
return "development"
Loading