-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathsetup.py
executable file
·79 lines (65 loc) · 2.32 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
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import sys
try:
python_version = sys.version_info
except:
python_version = (1, 5)
sys.exit("coshsh requires python 3.x")
if python_version < (3,):
sys.exit("coshsh requires python 3.x")
from setuptools import setup
from distutils import log
from distutils.command.install import install as _install
from distutils.command.install_data import install_data as _install_data
from distutils.core import setup, Command
import glob
import os
class CoshshTest(Command):
user_options = []
def initialize_options(self):
pass
def finalize_options(self):
pass
def run(self):
import subprocess
import sys
if 'PYTHONPATH' in os.environ:
os.environ['PYTHONPATH'] += ":" + os.getcwd()
else:
os.environ['PYTHONPATH'] = os.getcwd()
os.chdir('tests')
for test in glob.glob('test_*.py'):
log.info('Running test ' + test)
errno = subprocess.call([sys.executable, test])
if errno != 0:
raise SystemExit(errno)
class install(_install):
def run(self):
_install.run(self)
class install_data(_install_data):
def run(self):
_install_data.run(self)
setup(name='coshsh',
version='10.2.3',
setup_requires=['wheel'],
description='Coshsh - config generator for monitoring systems',
long_description=open('README.md').read(),
long_description_content_type='text/markdown',
url='http://github.com/lausser/coshsh',
author='Gerhard Lausser',
author_email='gerhard.lausser@consol.de',
license='AGPLv3',
keywords=['nagios', 'icinga', 'naemon', 'shinken', 'prometheus', 'monitoring'],
packages=['coshsh'],
data_files=[
(os.path.join('recipes', 'default', 'classes'),
glob.glob(os.path.join('recipes', 'default', 'classes', '*.py'))),
(os.path.join('recipes', 'default', 'templates'),
glob.glob(os.path.join('recipes', 'default', 'templates', '*.tpl')))
],
scripts=['bin/coshsh-cook', 'bin/coshsh-create-template-tree'],
#cmdclass={'install_data': install_data, 'install': install, 'test': CoshshTest},
cmdclass={'install_data': install_data, 'install': install},
test_suite="tests",
zip_safe=False)