Skip to content

Commit

Permalink
Detect missing setuptools-scm in setup.py
Browse files Browse the repository at this point in the history
  • Loading branch information
axnsan12 committed Dec 21, 2018
1 parent 3b31c54 commit 8057ce7
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,15 @@ def drf_yasg_setup(**kwargs):


try:
import setuptools_scm
drf_yasg_setup(use_scm_version=True)
except LookupError as e:
except (ImportError, LookupError) as e:
if os.getenv('CI', 'false') == 'true' or os.getenv('TRAVIS', 'false') == 'true':
# don't silently fail on travis - we don't want to accidentally push a dummy version to PyPI
raise

if 'setuptools-scm' in str(e):
err_msg = str(e)
if 'setuptools-scm' in err_msg or 'setuptools_scm' in err_msg:
import time

timestamp_ms = int(time.time() * 1000)
Expand Down

0 comments on commit 8057ce7

Please sign in to comment.