forked from cyberflow/kapacitor_alert_to_icinga2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
executable file
·40 lines (32 loc) · 1.09 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
#!/usr/bin/env python
from setuptools import setup, find_packages, Command
import os
class PyTest(Command):
user_options = [('pytest-args=', 'a', "Arguments to pass to py.test")]
def initialize_options(self):
pass
def finalize_options(self):
pass
def run(self):
import pytest
pytest.main('')
def generate_console_scripts(location):
yield '[console_scripts]'
files = os.listdir(location)
checks = filter(lambda x: x.endswith('.py'),
files)
for check_name in checks:
simple_name = check_name[:-len('.py')]
line = "%s=kapacitor_plugins.%s:main" % (check_name, simple_name)
yield line
setup(name="kapacitor_plugins",
version="1.0",
description="kapacitor plugins in python",
author="Dmitry Ryobrishkin",
author_email="[email protected]",
url="http://fillmeplease",
packages=find_packages(),
install_requires=['requests',
'regex'],
entry_points="\n".join(generate_console_scripts('kapacitor_plugins')),
cmdclass={'test': PyTest})