Skip to content

Commit

Permalink
Add check to prevent build of docs with bad version
Browse files Browse the repository at this point in the history
  • Loading branch information
axnsan12 committed Jan 3, 2019
1 parent bda545e commit 4b10983
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
dist: xenial
sudo: required
- python: '3.6'
env: TOXENV=docs
env: TOXENV=docs
- python: '3.6'
env: TOXENV=djmaster
- python: '3.6'
Expand Down
5 changes: 5 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,11 @@

# 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])
Expand Down

0 comments on commit 4b10983

Please sign in to comment.