Skip to content

Commit

Permalink
Extra lint
Browse files Browse the repository at this point in the history
  • Loading branch information
mroeschke committed Nov 20, 2017
1 parent bbc742d commit c49a325
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions versioneer.py
Original file line number Diff line number Diff line change
Expand Up @@ -606,11 +606,11 @@ def git_versions_from_keywords(keywords, tag_prefix, verbose):
if verbose:
print("keywords are unexpanded, not using")
raise NotThisMethod("unexpanded keywords, not a git-archive tarball")
refs = set(r.strip() for r in refnames.strip("()").split(","))
refs = {r.strip() for r in refnames.strip("()").split(",")}
# starting in git-1.8.3, tags are listed as "tag: foo-1.0" instead of
# just "foo-1.0". If we see a "tag: " prefix, prefer those.
TAG = "tag: "
tags = set(r[len(TAG):] for r in refs if r.startswith(TAG))
tags = {r[len(TAG):] for r in refs if r.startswith(TAG)}
if not tags:
# Either we're using git < 1.8.3, or there really are no tags. We use
# a heuristic: assume all version tags have a digit. The old git %%d
Expand All @@ -619,7 +619,7 @@ def git_versions_from_keywords(keywords, tag_prefix, verbose):
# between branches and tags. By ignoring refnames without digits, we
# filter out many common branch names like "release" and
# "stabilization", as well as "HEAD" and "master".
tags = set(r for r in refs if re.search(r'\d', r))
tags = {r for r in refs if re.search(r'\d', r)}
if verbose:
print("discarding '%%s', no digits" %% ",".join(refs-tags))
if verbose:
Expand Down Expand Up @@ -960,11 +960,11 @@ def git_versions_from_keywords(keywords, tag_prefix, verbose):
if verbose:
print("keywords are unexpanded, not using")
raise NotThisMethod("unexpanded keywords, not a git-archive tarball")
refs = set(r.strip() for r in refnames.strip("()").split(","))
refs = {r.strip() for r in refnames.strip("()").split(",")}
# starting in git-1.8.3, tags are listed as "tag: foo-1.0" instead of
# just "foo-1.0". If we see a "tag: " prefix, prefer those.
TAG = "tag: "
tags = set(r[len(TAG):] for r in refs if r.startswith(TAG))
tags = {r[len(TAG):] for r in refs if r.startswith(TAG)}
if not tags:
# Either we're using git < 1.8.3, or there really are no tags. We use
# a heuristic: assume all version tags have a digit. The old git %d
Expand All @@ -973,7 +973,7 @@ def git_versions_from_keywords(keywords, tag_prefix, verbose):
# between branches and tags. By ignoring refnames without digits, we
# filter out many common branch names like "release" and
# "stabilization", as well as "HEAD" and "master".
tags = set(r for r in refs if re.search(r'\d', r))
tags = {r for r in refs if re.search(r'\d', r)}
if verbose:
print("discarding '%s', no digits" % ",".join(refs-tags))
if verbose:
Expand Down

0 comments on commit c49a325

Please sign in to comment.