forked from gglockner/teslajson
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
28 lines (26 loc) · 828 Bytes
/
setup.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
from setuptools import setup, find_packages
# 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=get_version(),
description='',
url='https://github.com/lukedurrant/teslajson',
py_modules=['teslajson'],
author='Greg Glockner',
license='MIT',
install_requires=[
'polling',
]
)