[ADD] unittest2.collector as a setuptools test_suite, though it doesn't go search...
[odoo/odoo.git] / setup.py
1
2 import os
3 import re
4 import sys
5 from setuptools import setup
6
7 name = 'openerp-web-proto'
8 version = '6.0.1'
9 description = "Web Client of OpenERP, the Enterprise Management Software"
10 long_description = "OpenERP Web is the web client of the OpenERP, a free enterprise management software"
11 author = "OpenERP S.A."
12 author_email = "info@openerp.com"
13 support_email = 'support@openerp.com'
14 url = "http://www.openerp.com/"
15 download_url = ''
16 license = "OEPL"
17
18 version_dash_incompatible = False
19 if 'bdist_rpm' in sys.argv:
20     version_dash_incompatible = True
21 try:
22     import py2exe
23     from py2exe_utils import opts
24     version_dash_incompatible = True
25 except ImportError:
26     opts = {}
27 if version_dash_incompatible:
28     version = version.split('-')[0]
29
30 FILE_PATTERNS = \
31     r'.+\.(py|cfg|po|pot|mo|txt|rst|gif|png|jpg|ico|mako|html|js|css|htc|swf)$'
32 def find_data_files(source, patterns=FILE_PATTERNS):
33     file_matcher = re.compile(patterns, re.I)
34     out = []
35     for base, _, files in os.walk(source):
36         cur_files = []
37         for f in files:
38             if file_matcher.match(f):
39                 cur_files.append(os.path.join(base, f))
40         if cur_files:
41             out.append(
42                 (base, cur_files))
43
44     return out
45
46 setup(
47     name=name,
48     version=version,
49     description=description,
50     long_description=long_description,
51     author=author,
52     author_email=author_email,
53     url=url,
54     download_url=download_url,
55     license=license,
56     install_requires=[
57         "CherryPy >= 3.1.2",
58         "Babel >= 0.9.4",
59         "simplejson >= 2.0.9",
60         "python-dateutil >= 1.4.1",
61     ],
62     tests_require=[
63         'unittest2',
64         'mock',
65     ],
66     test_suite = 'unittest2.collector',
67     zip_safe=False,
68     packages=[
69         'addons',
70         'addons.base',
71         'addons.base.controllers',
72         'addons.base_calendar',
73         'addons.base_hello',
74         'openerpweb',
75     ],
76     classifiers=[
77         'Development Status :: 6 - Production/Stable',
78         'Operating System :: OS Independent',
79         'Programming Language :: Python',
80         'Environment :: Web Environment',
81         'Topic :: Office/Business :: Financial',
82         ],
83     scripts=['scripts/openerp-web'],
84     data_files=(find_data_files('addons')
85               + opts.pop('data_files', [])
86     ),
87     **opts
88 )