forked from StyraHem/pyShelly
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
executable file
·50 lines (44 loc) · 1.51 KB
/
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
import setuptools
import re
import os
import codecs
import sys
here = os.path.abspath(os.path.dirname(__file__))
with codecs.open("README.md", "r", encoding="utf-8") as fh:
LONG_DESCRIPTION = fh.read()
def read_file(*parts):
with codecs.open(os.path.join(here, *parts), 'r') as fp:
return fp.read()
def find_version(*file_paths):
try:
version_file = read_file(*file_paths)
version_match = re.search(r"^VERSION = ['\"]([^'\"]*)['\"]",
version_file, re.M)
if version_match:
return version_match.group(1)
raise RuntimeError("Unable to find version string.")
except:
return "0.0.0"
if sys.version_info < (3,):
REQUIRES = ['websocket-client'],
else:
REQUIRES = ['zeroconf', 'websocket-client'],
setuptools.setup(
name="pyShellyEx",
version=find_version("pyShelly", "const.py"),
license="MIT",
author="StyraHem / Tarra AB",
author_email="[email protected]",
description="Library for Shelly smart home devices (Modified version)",
long_description=LONG_DESCRIPTION,
long_description_content_type="text/markdown",
install_requires=REQUIRES,
url="https://github.com/GoNzCiD/pyShelly",
packages=setuptools.find_packages(),
classifiers=[
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
],
)