Skip to content

Commit

Permalink
Adjust dummy version
Browse files Browse the repository at this point in the history
  • Loading branch information
axnsan12 committed Dec 23, 2018
1 parent f020cbd commit d2cc0a3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion docs/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ install the build requirements yourself (just ```setuptools`` and ``setuptools-s

Additionally, for correct package version detection, a full git checkout is required when building (this was always the
case). Building without ``.git`` or without ``setuptools-scm`` will result in a distribution with a version like
``drf-yasg-0.0.0rc0+noscm00000167d19bd859``.
``drf-yasg-1!0.0.0.dev0+noscm.00000167d19bd859``.

**********
**1.11.1**
Expand Down
8 changes: 5 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,13 +77,15 @@ def drf_yasg_setup(**kwargs):
err_msg = str(e)
if 'setuptools-scm' in err_msg or 'setuptools_scm' in err_msg:
import time
import traceback

timestamp_ms = int(time.time() * 1000)
timestamp_str = hex(timestamp_ms)[2:].zfill(16)
dummy_version = '0.0.0rc0+noscm' + timestamp_str
dummy_version = '1!0.0.0.dev0+noscm.' + timestamp_str

drf_yasg_setup(version=dummy_version)
print(str(e), file=sys.stderr)
print("failed to detect version, build was done using dummy version " + dummy_version, file=sys.stderr)

traceback.print_exc(file=sys.stderr)
print("failed to detect version, package was built with dummy version " + dummy_version, file=sys.stderr)
else:
raise

0 comments on commit d2cc0a3

Please sign in to comment.