setup.py 5.5 KB
Newer Older
1
from setuptools import setup, find_packages
2
from shutil import copyfile
3 4
import glob
import os
5
import sys
6 7

from slapos.version import version
8
name = 'slapos.core'
9 10
long_description = open("README.rst").read() + "\n" + \
    open("CHANGES.rst").read() + "\n"
11

12
for f in sorted(glob.glob(os.path.join('slapos', 'README.*.rst'))):
13 14
  long_description += '\n' + open(f).read() + '\n'

15 16 17
slapos_folder_path = os.path.dirname(__file__)
for template_name in ('slapos-client.cfg.example',
    'slapos-proxy.cfg.example', 'slapos.cfg.example'):
18 19 20 21
  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))
22

23 24 25 26 27 28 29 30
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')

31 32 33 34 35 36 37 38 39 40 41 42 43 44
extras_require = {
    'docs': (
        'Sphinx',
        'repoze.sphinx.autointerface',
        'sphinxcontrib.programoutput',
    ),
    'ipython_console': ('ipython',),
    'bpython_console': ('bpython',),
    'test': (
        'pyflakes',
        'mock',
        'httmock',
    ),
}
45

46 47 48 49 50 51 52
setup(name=name,
      version=version,
      description="SlapOS core.",
      long_description=long_description,
      classifiers=[
          "Programming Language :: Python",
        ],
Łukasz Nowak's avatar
Łukasz Nowak committed
53
      keywords='slapos core',
54
      license='GPLv3',
55
      url='https://slapos.nexedi.net',
56
      author='VIFIB',
57 58 59 60
      namespace_packages=['slapos'],
      packages=find_packages(),
      include_package_data=True,
      install_requires=[
61
          'Flask>=1.1.2', # used by proxy
62 63 64 65 66
          '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
67
          'psutil>=2.0.0',
68 69 70 71
          'xml_marshaller>=0.9.3', # to unmarshall/marshall python objects to/from
                                   # XML
          'zope.interface', # slap library implementes interfaces
          'zc.buildout',
72
          'cliff',
Marco Mariani's avatar
Marco Mariani committed
73
          'requests>=2.4.3',
74
          'six',
75 76
          'cachecontrol',
          'lockfile',
77
          'jsonschema',
78
          'PyYAML',
79
          'uritemplate', # used by hateoas navigator
80
          'distro',
81
          'subprocess32; python_version<"3"',
Jérome Perrin's avatar
Jérome Perrin committed
82
          'enum34; python_version<"3"',
83
          'ipaddress; python_version<"3"',  # used by whitelistfirewall
84
        ] + additional_install_requires,
85 86
      extras_require=extras_require,
      tests_require=extras_require['test'],
87 88 89 90
      zip_safe=False, # proxy depends on Flask, which has issues with
                      # accessing templates
      entry_points={
        'console_scripts': [
91
          'slapos-watchdog = slapos.grid.watchdog:main',
92
          'slapos = slapos.cli.entry:main',
93
        ],
94 95 96
        'cliff.formatter.completion': [
          'fish = slapos.cli.complete:CompleteFish',
        ],
97
        'slapos.cli': [
98
          # Utilities
99 100 101
          'cachelookup binary-sr = slapos.cli.cache_binarysr:CacheLookupCommand',
          'cachelookup url = slapos.cli.cache_url:CacheLookupCommand',
          'cachelookup pypi = slapos.cli.cache_pypi:CacheLookupCommand',
102
          'complete = slapos.cli.complete:CompleteCommand',
103
          # SlapOS Node commands
104
          'node bang = slapos.cli.bang:BangCommand',
105
          'node format = slapos.cli.format:FormatCommand',
106
          'node register = slapos.cli.register:RegisterCommand',
107 108 109 110 111 112
          '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',
Marco Mariani's avatar
Marco Mariani committed
113
          'node tail = slapos.cli.supervisorctl:SupervisorctlTailCommand',
114 115 116
          'node report = slapos.cli.slapgrid:ReportCommand',
          'node software = slapos.cli.slapgrid:SoftwareCommand',
          'node instance = slapos.cli.slapgrid:InstanceCommand',
117
          'node promise = slapos.cli.slapgrid:PromiseCommand',
118
          'node boot = slapos.cli.boot:BootCommand',
119
          'node collect = slapos.cli.collect:CollectCommand',
120
          'node prune = slapos.cli.prune:PruneCommand',
121
          # SlapOS client commands
Marco Mariani's avatar
Marco Mariani committed
122
          'console = slapos.cli.console:ConsoleCommand',
123
          'configure local = slapos.cli.configure_local:ConfigureLocalCommand',
124
          'configure client = slapos.cli.configure_client:ConfigureClientCommand',
125 126
          'service info = slapos.cli.info:InfoCommand',
          'service list = slapos.cli.list:ListCommand',
127 128
          'computer list = slapos.cli.computer_list:ListCommand',
          'computer info = slapos.cli.computer_info:InfoCommand',
129
          'computer token = slapos.cli.computer_token:TokenCommand',
130 131
          'supply = slapos.cli.supply:SupplyCommand',
          'remove = slapos.cli.remove:RemoveCommand',
Marco Mariani's avatar
Marco Mariani committed
132
          'request = slapos.cli.request:RequestCommand',
133 134 135
          # SlapOS Proxy commands
          'proxy start = slapos.cli.proxy_start:ProxyStartCommand',
          'proxy show = slapos.cli.proxy_show:ProxyShowCommand',
136 137
        ]
      },
138
      test_suite="slapos.tests",
139
    )