setup.py 5.06 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
if sys.version_info[0] < 3:
  additional_install_requires.append('subprocess32')

34 35 36 37 38 39 40
setup(name=name,
      version=version,
      description="SlapOS core.",
      long_description=long_description,
      classifiers=[
          "Programming Language :: Python",
        ],
Łukasz Nowak's avatar
Łukasz Nowak committed
41
      keywords='slapos core',
42
      license='GPLv3',
43
      url='http://community.slapos.org',
44
      author='VIFIB',
45 46 47 48
      namespace_packages=['slapos'],
      packages=find_packages(),
      include_package_data=True,
      install_requires=[
49 50 51 52 53 54
          'Flask', # 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
55
          'psutil>=2.0.0',
56 57 58 59
          'xml_marshaller>=0.9.3', # to unmarshall/marshall python objects to/from
                                   # XML
          'zope.interface', # slap library implementes interfaces
          'zc.buildout',
60
          'cliff',
Marco Mariani's avatar
Marco Mariani committed
61
          'requests>=2.4.3',
62
          'six',
63 64
          'cachecontrol',
          'lockfile',
65
          'uritemplate', # used by hateoas navigator
66
        ] + additional_install_requires,
67 68
      extras_require={
      'docs': (
69 70 71
        'Sphinx',
        'repoze.sphinx.autointerface',
        'sphinxcontrib.programoutput'
72 73 74
      ),
      'ipython_console': ('ipython',),
      'bpython_console': ('bpython',)},
75 76
      tests_require=[
          'pyflakes',
77 78
          'mock',
          'httmock',
79
      ],
80 81 82 83
      zip_safe=False, # proxy depends on Flask, which has issues with
                      # accessing templates
      entry_points={
        'console_scripts': [
84
          'slapos-watchdog = slapos.grid.watchdog:main',
85
          'slapos = slapos.cli.entry:main',
86 87
        ],
        'slapos.cli': [
88
          # Utilities
89
          'cache lookup = slapos.cli.cache:CacheLookupCommand',
90
          'cache source = slapos.cli.cache_source:CacheLookupCommand',
91
          # SlapOS Node commands
92
          'node bang = slapos.cli.bang:BangCommand',
93
          'node format = slapos.cli.format:FormatCommand',
94
          'node register = slapos.cli.register:RegisterCommand',
95 96 97 98 99 100
          '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
101
          'node tail = slapos.cli.supervisorctl:SupervisorctlTailCommand',
102 103 104
          'node report = slapos.cli.slapgrid:ReportCommand',
          'node software = slapos.cli.slapgrid:SoftwareCommand',
          'node instance = slapos.cli.slapgrid:InstanceCommand',
105
          'node promise = slapos.cli.slapgrid:PromiseCommand',
106
          'node boot = slapos.cli.boot:BootCommand',
107
          'node collect = slapos.cli.collect:CollectCommand',
108
          'node prune = slapos.cli.prune:PruneCommand',
109
          # SlapOS client commands
Marco Mariani's avatar
Marco Mariani committed
110
          'console = slapos.cli.console:ConsoleCommand',
111
          'configure local = slapos.cli.configure_local:ConfigureLocalCommand',
112
          'configure client = slapos.cli.configure_client:ConfigureClientCommand',
113 114
          'service info = slapos.cli.info:InfoCommand',
          'service list = slapos.cli.list:ListCommand',
115 116
          'computer list = slapos.cli.computer_list:ListCommand',
          'computer info = slapos.cli.computer_info:InfoCommand',
117
          'computer token = slapos.cli.computer_token:TokenCommand',
118 119
          'supply = slapos.cli.supply:SupplyCommand',
          'remove = slapos.cli.remove:RemoveCommand',
Marco Mariani's avatar
Marco Mariani committed
120
          'request = slapos.cli.request:RequestCommand',
121 122 123
          # SlapOS Proxy commands
          'proxy start = slapos.cli.proxy_start:ProxyStartCommand',
          'proxy show = slapos.cli.proxy_show:ProxyShowCommand',
124 125
        ]
      },
126
      test_suite="slapos.tests",
127
    )