Skip to content

Commit

Permalink
Merge branch 'guyer-issue482-FiPy_development_version_string_not_comp…
Browse files Browse the repository at this point in the history
…liant_with_PEP_440' into develop
  • Loading branch information
tkphd committed Feb 1, 2016
2 parents 5c8209f + b0540c3 commit abc4f23
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion setup.py
Expand Up @@ -240,7 +240,14 @@ def _minimal_ext_cmd(cmd):
# ticket:475 - fix for bytecode received in Py3k
# http://jeetworks.org/node/67
out = out.decode("utf-8")
version = out.strip().replace('version-', '').replace('_', '.').replace('-', '-dev', 1)
# convert git long-form version string, e.g., "version-3_1_1-127-g413ed61",
# into PEP 440 version, e.g., "3.1.1.dev127+g413ed61"
version = out.strip().split("-")
suffix = version[2:]
version = ".".join(version[1].split("_"))
if suffix:
dev, sha = suffix
version = "%s.dev%s+%s" % (version, dev, sha)
except OSError:
import warnings
warnings.warn("Could not run ``git describe``")
Expand Down

0 comments on commit abc4f23

Please sign in to comment.