forked from metarelate/metarelate
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
63 lines (53 loc) · 2.1 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
from distutils.core import setup, Command
import os
import sys
import nose
class TestRunner(Command):
description = 'Run the metOcean unit tests'
user_options = []
def initialize_options(self):
pass
def finalize_options(self):
pass
def run(self):
lib_dir = os.path.join(sys.path[0], 'lib')
modules = []
for module in os.listdir(lib_dir):
path = os.path.join(lib_dir, module)
tests_path = os.path.join(path, 'tests')
if path not in ['.git', '.svn'] and os.path.exists(tests_path):
modules.append('{}.tests'.format(module))
if not modules:
raise ValueError('No tests were found to run.')
n_processors = 1
args = ['', 'module', '--processes={}'.format(n_processors),
'--verbosity=2']
success = True
for module in modules:
args[1] = module
msg = 'Running test discovery on module {!r} with {} processor{}.'
print
print msg.format(module, n_processors,
's' if n_processors > 1 else '')
print
success &= nose.run(argv=args)
if not success:
exit(1)
setup(
name='metarelate',
version='0.8',
description='Python packages for working with MetaRelate data',
url='http://metarelate.net',
package_dir={'': 'lib'},
packages=['metarelate', 'metarelate.editor', 'metarelate.editor.app', 'metarelate.tests'],
package_data={'metarelate': ['etc/site.cfg'],
'metarelate.editor': ['metarelate_editor.sh'],
'metarelate.editor.app': ['static/main.css', 'static/styles.css',
'static/tmp_images/*', 'templates/*', 'templatetags/*'],
'metarelate.tests': ['results/*/*', 'static/*/*', 'tdb/tdb']},
data_files=[('lib/python2.7/site-packages/metarelate', ['COPYING', 'COPYING.LESSER']),
('bin', ['lib/run_mr_editor.py'])],
author='marqh',
author_email='[email protected]',
cmdclass={'test': TestRunner},
)