diff --git a/setup.py b/setup.py index 347e5dd..01be158 100644 --- a/setup.py +++ b/setup.py @@ -2,11 +2,23 @@ # To use a consistent encoding from codecs import open from os import path +import re + +# Version defined in teslajson.py ``` __version__ = 'foo' ''' +def get_version(): + VERSIONFILE = 'teslajson.py' + initfile_lines = open(VERSIONFILE, 'rt').readlines() + VSRE = r"^\s*__version__ = ['\"]([^'\"]*)['\"]" + for line in initfile_lines: + mo = re.search(VSRE, line, re.M) + if mo: + return mo.group(1) + raise RuntimeError('Unable to find version string in %s.' % (VERSIONFILE,)) setup(name='teslajson', - version='1.3.1', + version=get_version(), description='', - url='https://github.com/gglockner/teslajson', + url='https://github.com/lukedurrant/teslajson', py_modules=['teslajson'], author='Greg Glockner', license='MIT', diff --git a/teslajson.py b/teslajson.py index 7ccc6ce..eeabf98 100644 --- a/teslajson.py +++ b/teslajson.py @@ -29,7 +29,7 @@ class Connection(object): """Connection to Tesla Motors API""" - __version__ = "1.6.0" + __version__ = "1.7.0" def __init__(self, email='',