Add check to prevent build of docs with bad version

master
Cristi Vîjdea 2019-01-03 20:36:12 +02:00
parent bda545e85f
commit 4b1098369c
2 changed files with 6 additions and 1 deletions

View File

@ -48,6 +48,11 @@ author = 'Cristi V.'
# The full version, including alpha/beta/rc tags.
release = get_distribution('drf_yasg').version
if 'noscm' in release:
raise AssertionError('Invalid package version string: %s. \n'
'The documentation must be built with drf_yasg installed from a distribution package, '
'which must have been built with a proper version number (i.e. from a full source checkout).'
% (release,))
# The short X.Y.Z version.
version = '.'.join(release.split('.')[:3])