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