Automatic versioning

This commit is contained in:
Manuel Ebert 2013-04-17 10:19:38 +02:00
parent ba6f7a43ba
commit a8958e7b0d
4 changed files with 23 additions and 3 deletions

View file

@ -51,9 +51,16 @@ if sys.argv[-1] == 'publish':
base_dir = os.path.dirname(os.path.abspath(__file__))
def get_version(filename="kerouac/__init__.py"):
with open(os.path.join(base_dir, filename)) as initfile:
for line in initfile.readlines():
m = re.match("__version__ *= *['\"](.*)['\"]", line)
if m:
return m.group(1)
setup(
name = "jrnl",
version = "1.0.1",
version = get_version(),
description = "A command line journal application that stores your journal in a plain text file",
packages = ['jrnl'],
install_requires = [