Skip to content

Commit

Permalink
Add cleaner version support
Browse files Browse the repository at this point in the history
  • Loading branch information
Nick Zaccardi committed Oct 31, 2019
1 parent cbef554 commit 0a53153
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 4 deletions.
18 changes: 15 additions & 3 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,29 @@
# import sys
# sys.path.insert(0, os.path.abspath('.'))

import keg_storage.version
import keg_storage
import datetime as dt

import configparser


# -- Project information -----------------------------------------------------

project = 'Keg-Storage'
copyright = u"{year} Level 12".format(year=dt.datetime.utcnow().year)

# The full version, including alpha/beta/rc tags
release = keg_storage.version.VERSION

cfg = configparser.SafeConfigParser()
cfg.read('../../setup.cfg')

tag = cfg.get('egg_info', 'tag_build')

html_context = {
'prerelease': bool(tag), # True if tag is not the empty string
}

# The full version, including alpha/beta/rc tags.
release = keg_storage.__version__ + tag


# -- General configuration ---------------------------------------------------
Expand Down
1 change: 1 addition & 0 deletions keg_storage/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from keg_storage.version import __version__ # noqa
from importlib.util import find_spec as _find_spec

if _find_spec('keg'):
Expand Down
2 changes: 1 addition & 1 deletion keg_storage/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
VERSION = '0.4.1'
VERSION = __version__ = '0.4.1'
3 changes: 3 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
[egg_info]
tag_build =

[metadata]
description-file=README.rst

Expand Down

0 comments on commit 0a53153

Please sign in to comment.