|
5 | 5 | # that just contains the computed version number.
|
6 | 6 |
|
7 | 7 | # 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) |
9 | 9 |
|
10 | 10 | """Git implementation of _version.py."""
|
11 | 11 |
|
@@ -56,7 +56,7 @@ class NotThisMethod(Exception):
|
56 | 56 |
|
57 | 57 |
|
58 | 58 | 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.""" |
60 | 60 |
|
61 | 61 | def decorate(f):
|
62 | 62 | """Store f in HANDLERS[vcs][method]."""
|
@@ -96,9 +96,7 @@ def run_command(commands, args, cwd=None, verbose=False, hide_stderr=False, env=
|
96 | 96 | if verbose:
|
97 | 97 | print("unable to find command, tried %s" % (commands,))
|
98 | 98 | 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() |
102 | 100 | if p.returncode != 0:
|
103 | 101 | if verbose:
|
104 | 102 | print("unable to run %s (error)" % dispcmd)
|
@@ -174,6 +172,10 @@ def git_versions_from_keywords(keywords, tag_prefix, verbose):
|
174 | 172 | raise NotThisMethod("no keywords at all, weird")
|
175 | 173 | date = keywords.get("date")
|
176 | 174 | 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 | + |
177 | 179 | # git-2.2.0 added "%cI", which expands to an ISO-8601 -compliant
|
178 | 180 | # datestamp. However we prefer "%ci" (which expands to an "ISO-8601
|
179 | 181 | # -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):
|
325 | 327 | date = run_command(GITS, ["show", "-s", "--format=%ci", "HEAD"], cwd=root)[
|
326 | 328 | 0
|
327 | 329 | ].strip()
|
| 330 | + # Use only the last line. Previous lines may contain GPG signature |
| 331 | + # information. |
| 332 | + date = date.splitlines()[-1] |
328 | 333 | pieces["date"] = date.strip().replace(" ", "T", 1).replace(" ", "", 1)
|
329 | 334 |
|
330 | 335 | return pieces
|
@@ -362,18 +367,18 @@ def render_pep440(pieces):
|
362 | 367 |
|
363 | 368 |
|
364 | 369 | def render_pep440_pre(pieces):
|
365 |
| - """TAG[.post.devDISTANCE] -- No -dirty. |
| 370 | + """TAG[.post0.devDISTANCE] -- No -dirty. |
366 | 371 |
|
367 | 372 | Exceptions:
|
368 |
| - 1: no tags. 0.post.devDISTANCE |
| 373 | + 1: no tags. 0.post0.devDISTANCE |
369 | 374 | """
|
370 | 375 | if pieces["closest-tag"]:
|
371 | 376 | rendered = pieces["closest-tag"]
|
372 | 377 | if pieces["distance"]:
|
373 |
| - rendered += ".post.dev%d" % pieces["distance"] |
| 378 | + rendered += ".post0.dev%d" % pieces["distance"] |
374 | 379 | else:
|
375 | 380 | # exception #1
|
376 |
| - rendered = "0.post.dev%d" % pieces["distance"] |
| 381 | + rendered = "0.post0.dev%d" % pieces["distance"] |
377 | 382 | return rendered
|
378 | 383 |
|
379 | 384 |
|
@@ -409,7 +414,7 @@ def render_pep440_old(pieces):
|
409 | 414 |
|
410 | 415 | The ".dev0" means dirty.
|
411 | 416 |
|
412 |
| - Eexceptions: |
| 417 | + Exceptions: |
413 | 418 | 1: no tags. 0.postDISTANCE[.dev0]
|
414 | 419 | """
|
415 | 420 | if pieces["closest-tag"]:
|
|
0 commit comments