Skip to content

Commit

Permalink
Fix get_setup_version() failing on non-git installs.
Browse files Browse the repository at this point in the history
  • Loading branch information
Hamuko committed Apr 28, 2016
1 parent 29caaf7 commit 06e9a15
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,15 @@ def get_setup_version():
"""Return a version string that can be used with the setup method. Includes
additional commits since the last tagged commit.
"""
process = subprocess.Popen(COMMAND_DESCRIBE_VERSION, **SUBPROCESS_KWARGS)
process.wait()
version = process.communicate()[0].decode("utf-8").strip()
return re.match(re_version, version).group(1)
if os.path.isdir('.git'):
process = subprocess.Popen(COMMAND_DESCRIBE_VERSION,
**SUBPROCESS_KWARGS)
process.wait()
version = process.communicate()[0].decode("utf-8").strip()
return re.match(re_version, version).group(1)
else:
from cum.version import __version__
return __version__


def get_version():
Expand Down

0 comments on commit 06e9a15

Please sign in to comment.