greenhouse/setup.py

25 lines
733 B
Python
Raw Permalink Normal View History

2021-03-22 11:03:15 +00:00
import shutil
2021-03-17 09:28:25 +00:00
import sys
2019-04-08 15:26:45 +00:00
import os
2021-03-17 09:28:25 +00:00
from setuptools import setup
2019-04-08 15:26:45 +00:00
2021-03-17 09:28:25 +00:00
NAME = 'Greenhouse'
VERSION = '1'
2019-04-08 15:26:45 +00:00
AUTHOR = 'Thomas Klaehn'
EMAIL = 'tkl@blackfinn.de'
PACKAGES = ['greenhouse']
2021-03-17 09:28:25 +00:00
REQUIRES = ['Flask', 'w1thermsensor', 'RPi.GPIO']
2021-03-22 11:03:15 +00:00
CONFIG_FOLDER = '/etc/greenhouse'
CONFIG_FILE = 'greenhouse.json'
2019-04-08 15:26:45 +00:00
2021-03-17 09:28:25 +00:00
setup(name=NAME, version=VERSION, long_description=__doc__, author=AUTHOR, author_email=EMAIL,
packages=PACKAGES, include_package_data=True, zip_safe=False, install_requires=REQUIRES)
2021-03-22 11:03:15 +00:00
if sys.argv[1] == 'install':
try:
os.makedirs(CONFIG_FOLDER)
shutil.copyfile(CONFIG_FILE, os.path.join(CONFIG_FOLDER, CONFIG_FILE))
except FileExistsError:
#FIXME: handle overwriting the config file
pass