1
0
Fork 0
mirror of https://github.com/borgbackup/borg.git synced 2024-12-23 16:26:29 +00:00

fail in borg package if version metadata is completely broken

this helps to fail early when people do badly done scm based repackaging
This commit is contained in:
Ronny Pfannschmidt 2017-05-21 10:25:42 +02:00
parent 1cd90b2c86
commit 53d0f1fd02

View file

@ -4,3 +4,15 @@
__version_tuple__ = tuple(LooseVersion(__version__).version[:3])
# assert that all semver components are integers
# this is mainly to show errors when people repackage poorly
# and setuptools_scm determines a 0.1.dev... version
assert all(isinstance(v, int) for v in __version_tuple__), \
"""\
broken borgbackup version metadata: %r
version metadata is obtained dynamically on installation via setuptools_scm,
please ensure your git repo has the correct tags or you provide the version
using SETUPTOOLS_SCM_PRETEND_VERSION in your build script.
""" % __version__