Adjust dummy version

master 1.12.0
Cristi Vîjdea 2018-12-23 19:29:07 +02:00
parent f020cbd99e
commit d2cc0a348c
2 changed files with 6 additions and 4 deletions

View File

@ -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**

View File

@ -77,13 +77,15 @@ except (ImportError, LookupError) as e:
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