Add requirements to setup

This commit is contained in:
Thomas Klaehn 2019-08-13 14:37:03 +02:00
parent 764bb0f563
commit 31c1e9ffb0
2 changed files with 7 additions and 3 deletions

3
.gitignore vendored
View File

@ -1 +1,4 @@
dist/
build/
__pycache__
greenhouse.egg-info/

View File

@ -2,7 +2,7 @@
'''
@author: Thomas Klaehn <tkl@blackfinn.de>
'''
from distutils.core import setup
from setuptools import setup
import os
import shutil
import stat
@ -15,6 +15,7 @@ EMAIL = 'tkl@blackfinn.de'
SYSTEMD_SCRIPTS = ['greenhouse.service']
PACKAGES = ['greenhouse']
PACKAGE_DIRS = {'greenhouse':'greenhouse'}
REQUIRES = ['RPi.GPIO', 'Adafruit_DHT', 'paho-mqtt']
SYSTEMD_PATH = '/lib/systemd/system/'
@ -22,7 +23,7 @@ if sys.argv[1] == 'install':
for script in SYSTEMD_SCRIPTS:
shutil.copyfile(script, os.path.join(SYSTEMD_PATH, script))
os.chmod(os.path.join(SYSTEMD_PATH, script), stat.S_IRUSR | stat.S_IWUSR | stat.S_IRGRP | stat.S_IROTH)
setup(name=NAME, version=VERSION, author=AUTHOR, author_email=EMAIL, package_dir=PACKAGE_DIRS, packages=PACKAGES)
setup(name=NAME, version=VERSION, author=AUTHOR, author_email=EMAIL, package_dir=PACKAGE_DIRS, packages=PACKAGES, install_requires=REQUIRES)
elif sys.argv[1] == 'sdist':
setup(name=NAME, version=VERSION, author=AUTHOR, author_email=EMAIL, package_dir=PACKAGE_DIRS, packages=PACKAGES,
setup(name=NAME, version=VERSION, author=AUTHOR, author_email=EMAIL, package_dir=PACKAGE_DIRS, packages=PACKAGES, install_requires=REQUIRES,
scripts=SYSTEMD_SCRIPTS)