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

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

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

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

22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
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')

setup(name=name,
      version=version,
      description="SlapOS core.",
      long_description=long_description,
      classifiers=[
          "Programming Language :: Python",
        ],
Łukasz Nowak's avatar
Łukasz Nowak committed
37
      keywords='slapos core',
38
      license='GPLv3',
39 40
      url='http://www.slapos.org',
      author='VIFIB',
41 42 43 44
      namespace_packages=['slapos'],
      packages=find_packages(),
      include_package_data=True,
      install_requires=[
45 46 47 48 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
          'xml_marshaller>=0.9.3', # to unmarshall/marshall python objects to/from
                                   # XML
          'zope.interface', # slap library implementes interfaces
          'zc.buildout',
55
          'cliff',
56
          'requests',
57
        ] + additional_install_requires,
58 59
      extras_require={
      'docs': (
60 61 62
        'Sphinx',
        'repoze.sphinx.autointerface',
        'sphinxcontrib.programoutput'
63 64 65
      ),
      'ipython_console': ('ipython',),
      'bpython_console': ('bpython',)},
66 67
      tests_require=[
          'pyflakes',
68
          'mock'
69
      ],
70 71 72 73
      zip_safe=False, # proxy depends on Flask, which has issues with
                      # accessing templates
      entry_points={
        'console_scripts': [
74
          'slapos-watchdog = slapos.grid.watchdog:main',
75
          'slapproxy = slapos.cli_legacy.proxy_start:main',
76
          'slapos = slapos.cli.entry:main',
77
          # Deprecated entry points
78
          'slapconsole = slapos.cli_legacy.console:console',
79
          'slapformat = slapos.cli_legacy.format:main',
80 81 82
          'slapgrid-sr = slapos.cli_legacy.slapgrid:runSoftwareRelease',
          'slapgrid-cp = slapos.cli_legacy.slapgrid:runComputerPartition',
          'slapgrid-ur = slapos.cli_legacy.slapgrid:runUsageReport',
83 84
          'slapgrid-supervisorctl = slapos.cli_legacy.svcbackend:supervisorctl',
          'slapgrid-supervisord = slapos.cli_legacy.svcbackend:supervisord',
85
          'bang = slapos.cli_legacy.bang:main',
86 87
        ],
        'slapos.cli': [
88
          # Utilities
89
          'cache lookup = slapos.cli.cache:CacheLookupCommand',
90
          # SlapOS Node commands
91
          'node bang = slapos.cli.bang:BangCommand',
92
          'node format = slapos.cli.format:FormatCommand',
93
          'node register = slapos.cli.register:RegisterCommand',
94 95 96 97 98 99
          '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
100
          'node tail = slapos.cli.supervisorctl:SupervisorctlTailCommand',
101 102 103
          'node report = slapos.cli.slapgrid:ReportCommand',
          'node software = slapos.cli.slapgrid:SoftwareCommand',
          'node instance = slapos.cli.slapgrid:InstanceCommand',
104
          # SlapOS client commands
Marco Mariani's avatar
Marco Mariani committed
105
          'console = slapos.cli.console:ConsoleCommand',
106
          'configure local = slapos.cli.configure_local:ConfigureLocalCommand',
107
          'configure client = slapos.cli.configure_client:ConfigureClientCommand',
108 109
          'proxy start = slapos.cli.proxy_start:ProxyStartCommand',
          'proxy show = slapos.cli.proxy_show:ProxyShowCommand',
110 111
          'supply = slapos.cli.supply:SupplyCommand',
          'remove = slapos.cli.remove:RemoveCommand',
Marco Mariani's avatar
Marco Mariani committed
112
          'request = slapos.cli.request:RequestCommand',
113 114
        ]
      },
115
      test_suite="slapos.tests",
116
    )