Permalink
Browse files

Use actual release info

  • Loading branch information...
1 parent 30d1448 commit 4b3769403402fa97dd91faa433ca075beb4abda3 @mitsuhiko mitsuhiko committed Feb 6, 2011
Showing with 12 additions and 3 deletions.
  1. +12 −3 docs/conf.py
View
@@ -42,9 +42,18 @@
# other places throughout the built documents.
#
# The short X.Y version.
-version = '2.0'
-# The full version, including alpha/beta/rc tags.
-release = '2.0'
+import pkg_resources
+try:
+ release = pkg_resources.get_distribution('Jinja2').version
+except ImportError:
+ print 'To build the documentation, The distribution information of Jinja2'
+ print 'Has to be available. Either install the package into your'
+ print 'development environment or run "setup.py develop" to setup the'
+ print 'metadata. A virtualenv is recommended!'
+ sys.exit(1)
+if 'dev' in release:
+ release = release.split('dev')[0] + 'dev'
+version = '.'.join(release.split('.')[:2])
# There are two options for replacing |today|: either, you set today to some
# non-false value, then it is used:

0 comments on commit 4b37694

Please sign in to comment.