Skip to content

Commit cb165ca

Browse files
committed
MNT: Upgrade versioneer to 0.19 + STY: black
1 parent ab38789 commit cb165ca

File tree

2 files changed

+279
-179
lines changed

2 files changed

+279
-179
lines changed

pydra/tasks/TODO/_version.py

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# that just contains the computed version number.
66

77
# This file is released into the public domain. Generated by
8-
# versioneer-0.18 (https://github.com/warner/python-versioneer)
8+
# versioneer-0.19 (https://github.com/python-versioneer/python-versioneer)
99

1010
"""Git implementation of _version.py."""
1111

@@ -56,7 +56,7 @@ class NotThisMethod(Exception):
5656

5757

5858
def register_vcs_handler(vcs, method): # decorator
59-
"""Decorator to mark a method as the handler for a particular VCS."""
59+
"""Create decorator to mark a method as the handler of a VCS."""
6060

6161
def decorate(f):
6262
"""Store f in HANDLERS[vcs][method]."""
@@ -96,9 +96,7 @@ def run_command(commands, args, cwd=None, verbose=False, hide_stderr=False, env=
9696
if verbose:
9797
print("unable to find command, tried %s" % (commands,))
9898
return None, None
99-
stdout = p.communicate()[0].strip()
100-
if sys.version_info[0] >= 3:
101-
stdout = stdout.decode()
99+
stdout = p.communicate()[0].strip().decode()
102100
if p.returncode != 0:
103101
if verbose:
104102
print("unable to run %s (error)" % dispcmd)
@@ -174,6 +172,10 @@ def git_versions_from_keywords(keywords, tag_prefix, verbose):
174172
raise NotThisMethod("no keywords at all, weird")
175173
date = keywords.get("date")
176174
if date is not None:
175+
# Use only the last line. Previous lines may contain GPG signature
176+
# information.
177+
date = date.splitlines()[-1]
178+
177179
# git-2.2.0 added "%cI", which expands to an ISO-8601 -compliant
178180
# datestamp. However we prefer "%ci" (which expands to an "ISO-8601
179181
# -like" string, which we must then edit to make compliant), because
@@ -325,6 +327,9 @@ def git_pieces_from_vcs(tag_prefix, root, verbose, run_command=run_command):
325327
date = run_command(GITS, ["show", "-s", "--format=%ci", "HEAD"], cwd=root)[
326328
0
327329
].strip()
330+
# Use only the last line. Previous lines may contain GPG signature
331+
# information.
332+
date = date.splitlines()[-1]
328333
pieces["date"] = date.strip().replace(" ", "T", 1).replace(" ", "", 1)
329334

330335
return pieces
@@ -362,18 +367,18 @@ def render_pep440(pieces):
362367

363368

364369
def render_pep440_pre(pieces):
365-
"""TAG[.post.devDISTANCE] -- No -dirty.
370+
"""TAG[.post0.devDISTANCE] -- No -dirty.
366371
367372
Exceptions:
368-
1: no tags. 0.post.devDISTANCE
373+
1: no tags. 0.post0.devDISTANCE
369374
"""
370375
if pieces["closest-tag"]:
371376
rendered = pieces["closest-tag"]
372377
if pieces["distance"]:
373-
rendered += ".post.dev%d" % pieces["distance"]
378+
rendered += ".post0.dev%d" % pieces["distance"]
374379
else:
375380
# exception #1
376-
rendered = "0.post.dev%d" % pieces["distance"]
381+
rendered = "0.post0.dev%d" % pieces["distance"]
377382
return rendered
378383

379384

@@ -409,7 +414,7 @@ def render_pep440_old(pieces):
409414
410415
The ".dev0" means dirty.
411416
412-
Eexceptions:
417+
Exceptions:
413418
1: no tags. 0.postDISTANCE[.dev0]
414419
"""
415420
if pieces["closest-tag"]:

0 commit comments

Comments
 (0)