forked from jasonrbriggs/stomp.py
-
Notifications
You must be signed in to change notification settings - Fork 1
/
setup.py
executable file
·107 lines (82 loc) · 2.64 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
import os
import shutil
from distutils.core import setup, Command
import unittest
import logging.config
try:
logging.config.fileConfig('stomp.log.conf')
except:
pass
import stomp
class TestCommand(Command):
user_options = [ ('test=', 't', 'specific test to run') ]
def initialize_options(self):
self.test = '*'
def finalize_options(self):
pass
def run(self):
try:
import coverage
cov = coverage.coverage()
cov.start()
except ImportError:
cov = None
suite = unittest.TestSuite()
if self.test == '*':
print('Running all tests')
import stomp.test
for tst in stomp.test.__all__:
suite.addTests(unittest.TestLoader().loadTestsFromName('stomp.test.%s' % tst))
else:
suite = unittest.TestLoader().loadTestsFromName('stomp.test.%s' % self.test)
unittest.TextTestRunner(verbosity=2).run(suite)
if cov:
cov.stop()
cov.save()
cov.html_report(directory='../stomppy-docs/htmlcov')
class TestPipInstallCommand(Command):
user_options = [ ]
def initialize_options(self):
pass
def finalize_options(self):
pass
def run(self):
if os.path.exists('tmp'):
shutil.rmtree('tmp')
os.mkdir('tmp')
from virtualenvapi.manage import VirtualEnvironment
env = VirtualEnvironment('tmp/scratch')
env.install('stomp.py')
class DoxygenCommand(Command):
user_options = [ ]
def initialize_options(self):
pass
def finalize_options(self):
pass
def run(self):
os.system('doxygen config.dox')
def version():
s = []
for num in stomp.__version__:
s.append(str(num))
return '.'.join(s)
setup(
name = 'stomp.py',
version = version(),
description = 'Python STOMP client, supporting versions 1.0, 1.1 and 1.2 of the protocol',
license = 'Apache',
url = 'https://github.com/jasonrbriggs/stomp.py',
author = 'Jason R Briggs',
author_email = '[email protected]',
platforms = ['any'],
packages = ['stomp', 'stomp.adapter'],
cmdclass = { 'test' : TestCommand, 'docs' : DoxygenCommand, 'piptest' : TestPipInstallCommand },
scripts = ['./scripts/stomp'],
classifiers = [
'Development Status :: 5 - Production/Stable',
'Intended Audience :: Developers',
'License :: OSI Approved :: Apache Software License',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 3'
]
)