Merge pull request #218 from ThomasWaldmann/docs-version

use version from package init also for sphinx docs, insert toplevel dir ...
This commit is contained in:
James Kasten
2015-02-02 15:13:31 -08:00
2 changed files with 14 additions and 4 deletions
+13 -4
View File
@@ -12,13 +12,22 @@
# All configuration values have a default; values that are commented out
# serve to show the default.
import sys
import codecs
import os
import re
import sys
here = os.path.abspath(os.path.dirname(__file__))
# read version number (and other metadata) from package init
init_fn = os.path.join(here, '..', 'letsencrypt', '__init__.py')
with codecs.open(init_fn, encoding='utf8') as fd:
meta = dict(re.findall(r"""__([a-z]+)__ = "([^"]+)""", fd.read()))
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#sys.path.insert(0, os.path.abspath('.'))
sys.path.insert(0, os.path.abspath(os.path.join(here, '..')))
# -- General configuration ------------------------------------------------
@@ -58,9 +67,9 @@ copyright = u'2014, Let\'s Encrypt Project'
# built documents.
#
# The short X.Y version.
version = '0.1'
version = '.'.join(meta['version'].split('.')[:2])
# The full version, including alpha/beta/rc tags.
release = '0.1'
release = meta['version']
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
+1
View File
@@ -1,2 +1,3 @@
"""Let's Encrypt."""
# version number like 1.2.3a0, must have at least 2 parts, like 1.2
__version__ = "0.1"