diff --git a/setup.py b/setup.py index ad4a6e7..ae3a62f 100644 --- a/setup.py +++ b/setup.py @@ -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():