Skip to content

Commit

Permalink
Don't import to get version, parse directly
Browse files Browse the repository at this point in the history
  • Loading branch information
havardgulldahl committed Sep 3, 2016
1 parent 66a028d commit c7a03af
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env python
# encoding: utf-8
#
# This file is part of jottafs.
# This file is part of jottalib.
#
# jottafs is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
Expand All @@ -16,15 +16,19 @@
# You should have received a copy of the GNU General Public License
# along with jottafs. If not, see <http://www.gnu.org/licenses/>.
#
# Copyright 2014,2015 Håvard Gulldahl <[email protected]>
# Copyright 2014-2016 Håvard Gulldahl <[email protected]>

from setuptools import setup

import os
import sys
sys.path.insert(0, './src')
import os.path
import re
#sys.path.insert(0, './src')

from jottalib import __version__
# get metadata (__version__, etc) from module magic
with open(os.path.join('src', 'jottalib', '__init__.py')) as f:
metadata = dict(re.findall("__([a-z]+)__\s*=\s*'([^']+)'", f.read()))

try:
with open('README.txt') as f:
Expand All @@ -33,7 +37,7 @@
long_desc = ''

setup(name='jottalib',
version=__version__,
version=metadata['version'],
license='GPLv3',
description='A library and tools to access the JottaCloud API',
long_description=long_desc,
Expand Down

0 comments on commit c7a03af

Please sign in to comment.