-
Notifications
You must be signed in to change notification settings - Fork 5
/
setup.py
143 lines (137 loc) · 5.75 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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
from setuptools import setup, find_packages
from shutil import copyfile
import glob
import os
import sys
from slapos.version import version
name = 'slapos.core'
long_description = open("README.rst").read() + "\n" + \
open("CHANGES.rst").read() + "\n"
for f in sorted(glob.glob(os.path.join('slapos', 'README.*.rst'))):
long_description += '\n' + open(f).read() + '\n'
slapos_folder_path = os.path.dirname(__file__)
for template_name in ('slapos-client.cfg.example',
'slapos-proxy.cfg.example', 'slapos.cfg.example'):
template_path = os.path.join(slapos_folder_path, template_name)
if os.path.exists(template_path):
copyfile(template_path,
os.path.join(slapos_folder_path, 'slapos', template_name))
additional_install_requires = []
# Even if argparse is available in python2.7, some python2.7 installations
# do not have it, so checking python version is dangerous
try:
import argparse
except ImportError:
additional_install_requires.append('argparse')
extras_require = {
'docs': (
'Sphinx',
'repoze.sphinx.autointerface',
'sphinxcontrib.programoutput',
),
'ipython_console': ('ipython',),
'bpython_console': ('bpython',),
'test': ( # to run slapos.core's own test suite
'pyflakes',
'mock',
'httmock',
),
'testing': ( # to use slapos.core testing helpers (typically, in software release tests)
'caucase',
'cryptography',
)
}
setup(name=name,
version=version,
description="SlapOS core.",
long_description=long_description,
classifiers=[
"Programming Language :: Python",
],
keywords='slapos core',
license='GPLv3',
url='https://slapos.nexedi.com/',
author='VIFIB',
namespace_packages=['slapos'],
packages=find_packages(),
include_package_data=True,
install_requires=[
'Flask>=1.1.2', # used by proxy
'lxml', # needed to play with XML trees
'netaddr>=0.7.5', # to play safely with IPv6 prefixes
'netifaces', # to fetch information about network devices
'setuptools', # namespaces
'supervisor', # slapgrid uses supervisor to manage processes
'psutil>=2.0.0',
'xml_marshaller>=0.9.3', # to unmarshall/marshall python objects to/from
# XML
'zope.interface', # slap library implementes interfaces
'zc.buildout',
'cliff',
'requests>=2.4.3',
'six',
'cachecontrol[filecache]',
'jsonschema',
'PyYAML',
'uritemplate', # used by hateoas navigator
'distro',
'subprocess32; python_version<"3"',
'enum34; python_version<"3"',
'selectors34; python_version<"3"', # used by SlapPopen (grid/utils)
'ipaddress; python_version<"3"', # used by whitelistfirewall
] + additional_install_requires,
extras_require=extras_require,
tests_require=extras_require['test'],
zip_safe=False, # proxy depends on Flask, which has issues with
# accessing templates
entry_points={
'console_scripts': [
'slapos-watchdog = slapos.grid.watchdog:main',
'slapos = slapos.cli.entry:main',
],
'cliff.formatter.completion': [
'fish = slapos.cli.complete:CompleteFish',
],
'slapos.cli': [
# Utilities
'cachelookup binary-sr = slapos.cli.cache_binarysr:CacheLookupCommand',
'cachelookup url = slapos.cli.cache_url:CacheLookupCommand',
'cachelookup pypi = slapos.cli.cache_pypi:CacheLookupCommand',
'complete = slapos.cli.complete:CompleteCommand',
# SlapOS Node commands
'node bang = slapos.cli.bang:BangCommand',
'node format = slapos.cli.format:FormatCommand',
'node register = slapos.cli.register:RegisterCommand',
'node supervisord = slapos.cli.supervisord:SupervisordCommand',
'node supervisorctl = slapos.cli.supervisorctl:SupervisorctlCommand',
'node status = slapos.cli.supervisorctl:SupervisorctlStatusCommand',
'node start = slapos.cli.supervisorctl:SupervisorctlStartCommand',
'node stop = slapos.cli.supervisorctl:SupervisorctlStopCommand',
'node restart = slapos.cli.supervisorctl:SupervisorctlRestartCommand',
'node tail = slapos.cli.supervisorctl:SupervisorctlTailCommand',
'node report = slapos.cli.slapgrid:ReportCommand',
'node software = slapos.cli.slapgrid:SoftwareCommand',
'node instance = slapos.cli.slapgrid:InstanceCommand',
'node promise = slapos.cli.slapgrid:PromiseCommand',
'node boot = slapos.cli.boot:BootCommand',
'node collect = slapos.cli.collect:CollectCommand',
'node prune = slapos.cli.prune:PruneCommand',
# SlapOS client commands
'console = slapos.cli.console:ConsoleCommand',
'configure local = slapos.cli.configure_local:ConfigureLocalCommand',
'configure client = slapos.cli.configure_client:ConfigureClientCommand',
'service info = slapos.cli.info:InfoCommand',
'service list = slapos.cli.list:ListCommand',
'computer list = slapos.cli.computer_list:ListCommand',
'computer info = slapos.cli.computer_info:InfoCommand',
'computer token = slapos.cli.computer_token:TokenCommand',
'supply = slapos.cli.supply:SupplyCommand',
'remove = slapos.cli.remove:RemoveCommand',
'request = slapos.cli.request:RequestCommand',
# SlapOS Proxy commands
'proxy start = slapos.cli.proxy_start:ProxyStartCommand',
'proxy show = slapos.cli.proxy_show:ProxyShowCommand',
]
},
test_suite="slapos.tests",
)