|
6 | 6 | # that just contains the computed version number.
|
7 | 7 |
|
8 | 8 | # This file is released into the public domain. Generated by
|
9 |
| -# versioneer-0.18 (https://github.com/warner/python-versioneer) |
| 9 | +# versioneer-0.19 (https://github.com/python-versioneer/python-versioneer) |
10 | 10 |
|
11 | 11 | """Git implementation of _version.py."""
|
12 | 12 |
|
@@ -58,7 +58,7 @@ class NotThisMethod(Exception):
|
58 | 58 |
|
59 | 59 |
|
60 | 60 | def register_vcs_handler(vcs, method): # decorator
|
61 |
| - """Decorator to mark a method as the handler for a particular VCS.""" |
| 61 | + """Create decorator to mark a method as the handler of a VCS.""" |
62 | 62 | def decorate(f):
|
63 | 63 | """Store f in HANDLERS[vcs][method]."""
|
64 | 64 | if vcs not in HANDLERS:
|
@@ -94,9 +94,7 @@ def run_command(commands, args, cwd=None, verbose=False, hide_stderr=False,
|
94 | 94 | if verbose:
|
95 | 95 | print("unable to find command, tried %s" % (commands,))
|
96 | 96 | return None, None
|
97 |
| - stdout = p.communicate()[0].strip() |
98 |
| - if sys.version_info[0] >= 3: |
99 |
| - stdout = stdout.decode() |
| 97 | + stdout = p.communicate()[0].strip().decode() |
100 | 98 | if p.returncode != 0:
|
101 | 99 | if verbose:
|
102 | 100 | print("unable to run %s (error)" % dispcmd)
|
@@ -174,6 +172,10 @@ def git_versions_from_keywords(keywords, tag_prefix, verbose):
|
174 | 172 | raise NotThisMethod("Short version file found")
|
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
|
@@ -314,6 +316,9 @@ def git_pieces_from_vcs(tag_prefix, root, verbose, run_command=run_command):
|
314 | 316 | # commit date: see ISO-8601 comment in git_versions_from_keywords()
|
315 | 317 | date = run_command(GITS, ["show", "-s", "--format=%ci", "HEAD"],
|
316 | 318 | cwd=root)[0].strip()
|
| 319 | + # Use only the last line. Previous lines may contain GPG signature |
| 320 | + # information. |
| 321 | + date = date.splitlines()[-1] |
317 | 322 | pieces["date"] = date.strip().replace(" ", "T", 1).replace(" ", "", 1)
|
318 | 323 |
|
319 | 324 | return pieces
|
@@ -352,18 +357,18 @@ def render_pep440(pieces):
|
352 | 357 |
|
353 | 358 |
|
354 | 359 | def render_pep440_pre(pieces):
|
355 |
| - """TAG[.post.devDISTANCE] -- No -dirty. |
| 360 | + """TAG[.post0.devDISTANCE] -- No -dirty. |
356 | 361 |
|
357 | 362 | Exceptions:
|
358 |
| - 1: no tags. 0.post.devDISTANCE |
| 363 | + 1: no tags. 0.post0.devDISTANCE |
359 | 364 | """
|
360 | 365 | if pieces["closest-tag"]:
|
361 | 366 | rendered = pieces["closest-tag"]
|
362 | 367 | if pieces["distance"]:
|
363 |
| - rendered += ".post.dev%d" % pieces["distance"] |
| 368 | + rendered += ".post0.dev%d" % pieces["distance"] |
364 | 369 | else:
|
365 | 370 | # exception #1
|
366 |
| - rendered = "0.post.dev%d" % pieces["distance"] |
| 371 | + rendered = "0.post0.dev%d" % pieces["distance"] |
367 | 372 | return rendered
|
368 | 373 |
|
369 | 374 |
|
@@ -399,7 +404,7 @@ def render_pep440_old(pieces):
|
399 | 404 |
|
400 | 405 | The ".dev0" means dirty.
|
401 | 406 |
|
402 |
| - Eexceptions: |
| 407 | + Exceptions: |
403 | 408 | 1: no tags. 0.postDISTANCE[.dev0]
|
404 | 409 | """
|
405 | 410 | if pieces["closest-tag"]:
|
|
0 commit comments