diff options
Diffstat (limited to 'src/buildstream/_version.py')
-rw-r--r-- | src/buildstream/_version.py | 24 |
1 files changed, 4 insertions, 20 deletions
diff --git a/src/buildstream/_version.py b/src/buildstream/_version.py index 12dde1df8..baeb00699 100644 --- a/src/buildstream/_version.py +++ b/src/buildstream/_version.py @@ -134,10 +134,7 @@ def versions_from_parentdir(parentdir_prefix, root, verbose): root = os.path.dirname(root) # up a level if verbose: - print( - "Tried directories %s but none started with prefix %s" - % (str(rootdirs), parentdir_prefix) - ) + print("Tried directories %s but none started with prefix %s" % (str(rootdirs), parentdir_prefix)) raise NotThisMethod("rootdir doesn't start with parentdir_prefix") @@ -254,15 +251,7 @@ def git_pieces_from_vcs(tag_prefix, tag_regex, root, verbose, run_command=run_co # if there isn't one, this yields HEX[-dirty] (no NUM) describe_out, rc = run_command( GITS, - [ - "describe", - "--tags", - "--dirty", - "--always", - "--long", - "--match", - "%s%s" % (tag_prefix, tag_regex), - ], + ["describe", "--tags", "--dirty", "--always", "--long", "--match", "%s%s" % (tag_prefix, tag_regex),], cwd=root, ) # --long was added in git-1.5.5 @@ -305,10 +294,7 @@ def git_pieces_from_vcs(tag_prefix, tag_regex, root, verbose, run_command=run_co if verbose: fmt = "tag '%s' doesn't start with prefix '%s'" print(fmt % (full_tag, tag_prefix)) - pieces["error"] = "tag '%s' doesn't start with prefix '%s'" % ( - full_tag, - tag_prefix, - ) + pieces["error"] = "tag '%s' doesn't start with prefix '%s'" % (full_tag, tag_prefix,) return pieces pieces["closest-tag"] = full_tag[len(tag_prefix) :] @@ -325,9 +311,7 @@ def git_pieces_from_vcs(tag_prefix, tag_regex, root, verbose, run_command=run_co pieces["distance"] = int(count_out) # total number of commits # commit date: see ISO-8601 comment in git_versions_from_keywords() - date = run_command(GITS, ["show", "-s", "--format=%ci", "HEAD"], cwd=root)[ - 0 - ].strip() + date = run_command(GITS, ["show", "-s", "--format=%ci", "HEAD"], cwd=root)[0].strip() pieces["date"] = date.strip().replace(" ", "T", 1).replace(" ", "", 1) return pieces |