-
Notifications
You must be signed in to change notification settings - Fork 390
/
setup.py
77 lines (71 loc) · 2.31 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
#
# Copyright (c) 2013 Juniper Networks, Inc. All rights reserved.
#
import os
import re
from setuptools import setup, find_packages, Command
import distutils
class RunTestsCommand(Command):
description = "Test command to run testr in virtualenv"
user_options = [
('coverage', 'c', "Generate code coverage report"),
('testrun=', None, "Run a specific test"),
]
boolean_options = ['coverage']
def initialize_options(self):
self.cwd = None
self.coverage = False
self.testrun = None
def finalize_options(self):
self.cwd = os.getcwd()
if self.testrun:
self.announce('Running test: %s' % str(self.testrun),
level=distutils.log.INFO)
def run(self):
logfname = 'test.log'
args = '-V'
if self.coverage:
logfname = 'coveragetest.log'
args += ' -c'
if self.testrun:
logfname = self.testrun + '.log'
args = self.testrun
os.system('./run_tests.sh %s' % args)
with open(logfname) as f:
if not re.search('\nOK', ''.join(f.readlines())):
os._exit(1)
setup(
name='opserver',
version='0.1dev',
packages=find_packages(exclude=["node_mgr", "node_mgr.*", "test.*",
"build.*", "plugins.*"]),
package_data={'': ['*.html', '*.css', '*.xml']},
zip_safe=False,
include_package_data=True,
long_description="VNC Analytics API Implementation",
install_requires=[
'lxml',
'gevent',
'geventhttpclient',
'redis',
'xmltodict',
'prettytable',
'psutil>=0.4.1'
],
entry_points = {
# Please update sandesh/common/vns.sandesh on process name change
'console_scripts' : [
'contrail-analytics-api = opserver.opserver:main',
'contrail-alarm-gen = opserver.alarmgen:main',
'contrail-logs = opserver.log:main',
'contrail-stats = opserver.stats:main',
'contrail-flows = opserver.flow:main',
'contrail-logs-api-audit = opserver.api_log:main',
'contrail-db = opserver.db:main',
'contrail-alarm-notify = opserver.alarm_notify:main'
],
},
cmdclass={
'run_tests': RunTestsCommand,
},
)