forked from saltstack/salt
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
executable file
·119 lines (110 loc) · 3.78 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
#!/usr/bin/env python2
'''
The setup script for salt
'''
import os
import sys
from glob import glob
from distutils.core import setup, Extension
from distutils.command.sdist import sdist
from distutils.cmd import Command
from distutils.sysconfig import get_python_lib, PREFIX
if os.environ.get('VIRTUAL_ENV'):
from setuptools import setup
execfile('salt/version.py')
class TestCommand(Command):
description = 'Run tests'
user_options = []
def initialize_options(self): pass
def finalize_options(self): pass
def run(self):
from subprocess import Popen
self.run_command('build')
build_cmd = self.get_finalized_command('build_ext')
runner = os.path.abspath('tests/runtests.py')
test_cmd = 'python %s' % runner
print("running test")
test_process = Popen(
test_cmd, shell=True,
stdout=sys.stdout, stderr=sys.stderr,
cwd=build_cmd.build_lib
)
test_process.communicate()
NAME = 'salt'
VER = __version__
DESC = ('Portable, distributed, remote execution and '
'configuration management system')
mod_path = os.path.join(get_python_lib(), 'salt/modules')
doc_path = os.path.join(PREFIX, 'share/doc', NAME + '-' + VER)
example_path = os.path.join(doc_path, 'examples')
template_path = os.path.join(example_path, 'templates')
if 'SYSCONFDIR' in os.environ:
etc_path = os.environ['SYSCONFDIR']
else:
etc_path = os.path.join(os.path.dirname(PREFIX), 'etc')
libraries = ['ws2_32'] if sys.platform == 'win32' else []
requirements=''
with open('requirements.txt') as f:
requirements = f.read()
setup(
name=NAME,
version=VER,
description=DESC,
author='Thomas S Hatch',
author_email='[email protected]',
url='http://saltstack.org',
cmdclass={'test': TestCommand},
classifiers=[
'Programming Language :: Python',
'Programming Language :: Cython',
'Programming Language :: Python :: 2.6',
'Programming Language :: Python :: 2.7',
'Development Status :: 5 - Production/Stable',
'Environment :: Console',
'Intended Audience :: Developers',
'Intended Audience :: Information Technology',
'Intended Audience :: System Administrators',
'License :: OSI Approved :: Apache Software License',
'Operating System :: POSIX :: Linux',
'Topic :: System :: Clustering',
'Topic :: System :: Distributed Computing',
],
packages=['salt',
'salt.cli',
'salt.ext',
'salt.grains',
'salt.modules',
'salt.renderers',
'salt.returners',
'salt.runners',
'salt.states',
'salt.utils',
],
scripts=['scripts/salt-master',
'scripts/salt-minion',
'scripts/salt-syndic',
'scripts/salt-key',
'scripts/salt-cp',
'scripts/salt-call',
'scripts/salt-run',
'scripts/salt'],
data_files=[(os.path.join(etc_path, 'salt'),
['conf/master.template',
'conf/minion.template',
]),
('share/man/man1',
['doc/man/salt-master.1',
'doc/man/salt-key.1',
'doc/man/salt.1',
'doc/man/salt-cp.1',
'doc/man/salt-call.1',
'doc/man/salt-syndic.1',
'doc/man/salt-run.1',
'doc/man/salt-minion.1',
]),
('share/man/man7',
['doc/man/salt.7',
]),
],
install_requires=requirements,
)