From cc8da3bd7510d3d973ed4b1c5468c3b9a23f3604 Mon Sep 17 00:00:00 2001 From: zmoody Date: Tue, 3 Jul 2018 12:47:29 -0500 Subject: [PATCH] Fixes #67 - breaks on import updates how version dunder is derived. --- pynetbox/__init__.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/pynetbox/__init__.py b/pynetbox/__init__.py index 2040240d..16a8448a 100644 --- a/pynetbox/__init__.py +++ b/pynetbox/__init__.py @@ -1,6 +1,9 @@ -from setuptools_scm import get_version +from pkg_resources import get_distribution, DistributionNotFound + from pynetbox.api import Api as api from pynetbox.lib import RequestError - -__version__ = get_version(root='..', relative_to=__file__) +try: + __version__ = get_distribution(__name__).version +except DistributionNotFound: + pass