diff --git a/api/version.py b/api/version.py index 3a75a42..b4a83cd 100644 --- a/api/version.py +++ b/api/version.py @@ -1,8 +1,9 @@ +import contextlib __version__ = None try: from api._version import version as __version__ except ImportError: - from setuptools_scm import get_version - __version__ = get_version(root='..', relative_to=__file__) - + with contextlib.suppress(ImportError, LookupError): + from setuptools_scm import get_version + __version__ = get_version(root='..', relative_to=__file__)