diff options
author | Stephen Finucane <stephen@that.guru> | 2018-04-11 17:36:16 +0100 |
---|---|---|
committer | Daniel Axtens <dja@axtens.net> | 2018-04-14 17:14:52 +1000 |
commit | 1ff190fe2abea40285129e64dc8f2f3a6e789eef (patch) | |
tree | d6df188373aca4c7bae7d0ceac20ad8eac2971a0 /docs | |
parent | 785edf966812168c621de9841fa93d76e214cb3d (diff) | |
download | patchwork-1ff190fe2abea40285129e64dc8f2f3a6e789eef.tar patchwork-1ff190fe2abea40285129e64dc8f2f3a6e789eef.tar.gz |
docs: Read version from 'patchwork.VERSION'
Because this isn't an installable package we need to do some path
hackery. Not the end of the world though.
Signed-off-by: Stephen Finucane <stephen@that.guru>
Signed-off-by: Daniel Axtens <dja@axtens.net>
Diffstat (limited to 'docs')
-rw-r--r-- | docs/conf.py | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/docs/conf.py b/docs/conf.py index f692cf9..4fd3a04 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -2,12 +2,21 @@ # # Patchwork documentation build configuration file +import os +import sys + try: import sphinx_rtd_theme has_rtd_theme = True except ImportError: has_rtd_theme = False +PATCHWORK_DIR = os.path.abspath(os.path.dirname(os.path.dirname(__file__))) +sys.path.insert(0, PATCHWORK_DIR) + +from patchwork import VERSION # noqa + + # -- General configuration ------------------------------------------------ # If your documentation needs a minimal Sphinx version, state it here. @@ -45,12 +54,10 @@ author = u'Stephen Finucane' # |version| and |release|, also used in various other places throughout the # built documents. # -# TODO(stephenfin): Eventually this should read the version programmatically -# # The short X.Y version. -version = u'2.0-alpha' +version = '.'.join((str(x) for x in VERSION[:3])) # The full version, including alpha/beta/rc tags. -release = u'2.0-alpha' +release = '.'.join((str(x) for x in VERSION)) # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. |