setup: gracefully recover from missing setuptools_scm.
authorwhitequark <whitequark@whitequark.org>
Wed, 1 Jul 2020 21:04:04 +0000 (21:04 +0000)
committerwhitequark <whitequark@whitequark.org>
Wed, 1 Jul 2020 21:04:04 +0000 (21:04 +0000)
setup.py

index 19f25184b5a882bfe9a5dfa5767889d455ee1828..99ae4c99be1b17322b6078ada148abb0e1cfd3e9 100644 (file)
--- a/setup.py
+++ b/setup.py
@@ -1,5 +1,4 @@
 from setuptools import setup, find_packages
-from setuptools_scm.git import parse as parse_git
 
 
 def scm_version():
@@ -16,6 +15,11 @@ def scm_version():
 
 
 def doc_version():
+    try:
+        from setuptools_scm.git import parse as parse_git
+    except ImportError:
+        return ""
+
     git = parse_git(".")
     if git.exact:
         return git.format_with("{tag}")