summaryrefslogtreecommitdiff
path: root/src/setuptools_scm/version.py
diff options
context:
space:
mode:
authorpunkadiddle <>2018-06-30 16:08:39 +0200
committerpunkadiddle <>2018-06-30 16:08:39 +0200
commit48908ca1d8ef9fc4cd69c7bf2b1787ff104cf271 (patch)
tree564920a66e02b6659e92908edcde76b3aabc1214 /src/setuptools_scm/version.py
parent4923f13691947f95e344152b96f927435c20c3fd (diff)
downloadsetuptools-scm-48908ca1d8ef9fc4cd69c7bf2b1787ff104cf271.tar.gz
assertion replaced by warning
assertion broke possibility to fallback into other entrypoints.
Diffstat (limited to 'src/setuptools_scm/version.py')
-rw-r--r--src/setuptools_scm/version.py13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/setuptools_scm/version.py b/src/setuptools_scm/version.py
index 8cdad54..f3f5f7e 100644
--- a/src/setuptools_scm/version.py
+++ b/src/setuptools_scm/version.py
@@ -164,10 +164,15 @@ def _parse_tag(tag, preformatted):
def meta(tag, distance=None, dirty=False, node=None, preformatted=False, **kw):
- parsed_version = _parse_tag(tag, preformatted)
- trace("version", tag, "->", parsed_version)
- assert parsed_version is not None, "cant parse version %s" % tag
- return ScmVersion(parsed_version, distance, node, dirty, preformatted, **kw)
+ if tag is not None:
+ parsed_version = _parse_tag(tag, preformatted)
+ trace("version", tag, "->", parsed_version)
+
+ if tag is not None:
+ return ScmVersion(parsed_version, distance, node, dirty, preformatted, **kw)
+ else:
+ warnings.warn("cant parse version %s" % tag)
+ return None
def guess_next_version(tag_version):