This repository has been archived by the owner on Oct 9, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathsetup.py
61 lines (52 loc) · 1.87 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
"""Setup script to install HomeControl as a package"""
from setuptools import find_namespace_packages, setup
from setuptools.command.develop import develop
from homecontrol import const
MODULE_REQUIREMENTS = []
# Try to extract pip requirements from modules
# Only works if PyYAML is already installed
try:
from homecontrol.scripts.module_requirements import get_requirements
MODULE_REQUIREMENTS = get_requirements()
except ModuleNotFoundError:
pass
REQUIREMENTS = open("requirements.txt").read().splitlines()
REQUIREMENTS_DEV = open("requirements_dev.txt").read().splitlines()
MINIMUM_PYTHON_VERSION = ">=" + \
".".join(map(str, const.MINIMUM_PYTHON_VERSION))
class DevelopCommand(develop):
""""Custom develop command that also install development requirements"""
def __init__(self, dist, **kw):
dist.install_requires.extend(REQUIREMENTS_DEV)
super().__init__(dist)
setup(
name="homecontrol",
version=const.VERSION_STRING,
url="https://github.com/lennart-k/HomeControl",
author="Lennart K",
description="Another approach to home automation",
long_description=open("README.md").read(),
long_description_content_type="text/markdown",
packages=find_namespace_packages(include=("homecontrol", "homecontrol.*")),
include_package_data=True,
install_requires=REQUIREMENTS + MODULE_REQUIREMENTS,
cmdclass={
"develop": DevelopCommand
},
python_requires=MINIMUM_PYTHON_VERSION,
package_data={
"": ["*"]
},
license="MIT",
keywords="homecontrol home automation",
project_urls={
"GitHub": "https://github.com/lennart-k/HomeControl",
"Docs": "https://homecontrol.readthedocs.io/en/latest/"
},
entry_points={
"console_scripts": [
"homecontrol = homecontrol.__main__:main",
"homecli = homecontrol.cli.__main__:main"
]
}
)