-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
63 lines (54 loc) · 1.91 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
51
52
53
54
55
56
57
58
59
60
61
import setuptools
from ntpath import dirname
import os
with open('README.md', 'r') as f:
longDescription = f.read()
def isRPI():
path = '/sys/firmware/devicetree/base/model'
if os.path.exists(path):
with open(path, 'r') as m:
if 'raspberry pi' in m.read().lower():
return True
return False
def getDeps():
deps=['Flask', 'schedule', 'flask-expects-json', 'requests', 'matplotlib', 'hid', 'pyudev']
if isRPI():
#rpi specific
deps.extend(['rpi-rf', 'RPLCD', 'waitress', 'smbus2', 'pigpio', 'pimoroni-bme280'])
return deps
# single sourcing version number to __init__.py
def getVersion(pkgDir):
currentPath = dirname(__file__)
initPath = f"{currentPath}/{pkgDir}/__init__.py"
with open(initPath) as f:
for line in f.readlines():
if line.startswith("__version__"):
delim = '"' if '"' in line else "'"
return line.split(delim)[1]
else:
raise RuntimeError("Unable to find version string.")
setuptools.setup(
name="smart-home-server",
version=getVersion("smart_home_server"),
author="Joshua McPherson",
author_email="[email protected]",
description="A server for home automation",
long_description = longDescription,
long_description_content_type = 'text/markdown',
url="https://github.com/PrinceOfPuppers/smart-home-server",
packages=setuptools.find_packages(),
include_package_data=True,
install_requires=getDeps(),
classifiers=[
"Programming Language :: Python :: 3",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Environment :: Console",
"Intended Audience :: End Users/Desktop",
],
python_requires='>=3.6',
scripts=["bin/smart-home-server"],
entry_points={
'console_scripts': ['smart-home-server = smart_home_server:main'],
},
)