Skip to content

Commit

Permalink
Merge pull request #8 from corriporai/develop
Browse files Browse the repository at this point in the history
BLD: Versioneer updated to 0.19
  • Loading branch information
marcelcaraciolo authored Nov 21, 2020
2 parents d7890da + 87d53f4 commit 1fddf9f
Show file tree
Hide file tree
Showing 3 changed files with 123 additions and 86 deletions.
3 changes: 2 additions & 1 deletion runpandas/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from ._version import get_versions
from runpandas.reader import _read_file as read_file # noqa

from ._version import get_versions

__version__ = get_versions()["version"]
del get_versions

Expand Down
34 changes: 19 additions & 15 deletions runpandas/_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# that just contains the computed version number.

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

"""Git implementation of _version.py."""

Expand Down Expand Up @@ -40,9 +40,9 @@ def get_config():
cfg = VersioneerConfig()
cfg.VCS = "git"
cfg.style = "pep440"
cfg.tag_prefix = ""
cfg.parentdir_prefix = "None"
cfg.versionfile_source = "pandas_datareader/_version.py"
cfg.tag_prefix = "v"
cfg.parentdir_prefix = "runpandas-"
cfg.versionfile_source = "runpandas/_version.py"
cfg.verbose = False
return cfg

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


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

def decorate(f):
"""Store f in HANDLERS[vcs][method]."""
Expand Down Expand Up @@ -96,9 +96,7 @@ def run_command(commands, args, cwd=None, verbose=False, hide_stderr=False, env=
if verbose:
print("unable to find command, tried %s" % (commands,))
return None, None
stdout = p.communicate()[0].strip()
if sys.version_info[0] >= 3:
stdout = stdout.decode()
stdout = p.communicate()[0].strip().decode()
if p.returncode != 0:
if verbose:
print("unable to run %s (error)" % dispcmd)
Expand Down Expand Up @@ -174,6 +172,10 @@ def git_versions_from_keywords(keywords, tag_prefix, verbose):
raise NotThisMethod("no keywords at all, weird")
date = keywords.get("date")
if date is not None:
# Use only the last line. Previous lines may contain GPG signature
# information.
date = date.splitlines()[-1]

# git-2.2.0 added "%cI", which expands to an ISO-8601 -compliant
# datestamp. However we prefer "%ci" (which expands to an "ISO-8601
# -like" string, which we must then edit to make compliant), because
Expand Down Expand Up @@ -292,8 +294,7 @@ def git_pieces_from_vcs(tag_prefix, root, verbose, run_command=run_command):
# TAG-NUM-gHEX
mo = re.search(r"^(.+)-(\d+)-g([0-9a-f]+)$", git_describe)
if not mo:
# unparseable.
# Maybe git-describe is misbehaving?
# unparseable. Maybe git-describe is misbehaving?
pieces["error"] = "unable to parse git-describe output: '%s'" % describe_out
return pieces

Expand Down Expand Up @@ -326,6 +327,9 @@ def git_pieces_from_vcs(tag_prefix, root, verbose, run_command=run_command):
date = run_command(GITS, ["show", "-s", "--format=%ci", "HEAD"], cwd=root)[
0
].strip()
# Use only the last line. Previous lines may contain GPG signature
# information.
date = date.splitlines()[-1]
pieces["date"] = date.strip().replace(" ", "T", 1).replace(" ", "", 1)

return pieces
Expand Down Expand Up @@ -363,18 +367,18 @@ def render_pep440(pieces):


def render_pep440_pre(pieces):
"""TAG[.post.devDISTANCE] -- No -dirty.
"""TAG[.post0.devDISTANCE] -- No -dirty.
Exceptions:
1: no tags. 0.post.devDISTANCE
1: no tags. 0.post0.devDISTANCE
"""
if pieces["closest-tag"]:
rendered = pieces["closest-tag"]
if pieces["distance"]:
rendered += ".post.dev%d" % pieces["distance"]
rendered += ".post0.dev%d" % pieces["distance"]
else:
# exception #1
rendered = "0.post.dev%d" % pieces["distance"]
rendered = "0.post0.dev%d" % pieces["distance"]
return rendered


Expand Down Expand Up @@ -410,7 +414,7 @@ def render_pep440_old(pieces):
The ".dev0" means dirty.
Eexceptions:
Exceptions:
1: no tags. 0.postDISTANCE[.dev0]
"""
if pieces["closest-tag"]:
Expand Down
Loading

0 comments on commit 1fddf9f

Please sign in to comment.