-
Notifications
You must be signed in to change notification settings - Fork 48
/
setup.py
executable file
·70 lines (60 loc) · 1.56 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
62
63
64
65
66
67
68
69
70
#!/usr/bin/python
from distutils.core import setup
from DistUtilsExtra.auto import clean_build_tree
from DistUtilsExtra.command import build_extra
from landscape import UPSTREAM_VERSION
SETUP = dict(
name=None,
description=None,
packages=None,
py_modules=None,
scripts=None,
version=UPSTREAM_VERSION,
author="Landscape Team",
author_email="landscape-team@canonical.com",
url="http://landscape.canonical.com",
cmdclass={"build": build_extra.build_extra, "clean": clean_build_tree},
)
def setup_landscape(
name,
description,
packages,
modules=None,
scripts=None,
**kwargs,
):
assert name and description and packages
kwargs = dict(
SETUP,
name=name,
description=description,
packages=packages,
py_modules=modules,
scripts=scripts,
**kwargs,
)
kwargs = {k: v for k, v in kwargs.items() if k is not None}
setup(**kwargs)
# Import these afterward to avoid circular imports.
import setup_lib # noqa: E402
import setup_sysinfo # noqa: E402
import setup_client # noqa: E402
PACKAGES = []
MODULES = []
SCRIPTS = []
DEB_REQUIRES = []
REQUIRES = []
for sub in (setup_lib, setup_sysinfo, setup_client):
PACKAGES += sub.PACKAGES
MODULES += sub.MODULES
SCRIPTS += sub.SCRIPTS
DEB_REQUIRES += sub.DEB_REQUIRES
REQUIRES += sub.REQUIRES
if __name__ == "__main__":
setup_landscape(
name="landscape-client",
description="Landscape Client",
packages=PACKAGES,
modules=MODULES,
scripts=SCRIPTS,
)