rename openerp-web.py to openerp-web
[odoo/odoo.git] / setup.py
1
2 import os
3 import re
4 import sys
5 from setuptools import setup, find_packages
6
7 execfile('addons/web/common/release.py')
8
9 version_dash_incompatible = False
10 if 'bdist_rpm' in sys.argv:
11     version_dash_incompatible = True
12 try:
13     import py2exe
14     from py2exe_utils import opts
15     version_dash_incompatible = True
16 except ImportError:
17     opts = {}
18 if version_dash_incompatible:
19     version = version.split('-')[0]
20
21 FILE_PATTERNS = \
22     r'.+\.(py|cfg|po|pot|mo|txt|rst|gif|png|jpg|ico|mako|html|js|css|htc|swf)$'
23 def find_data_files(source, patterns=FILE_PATTERNS):
24     file_matcher = re.compile(patterns, re.I)
25     out = []
26     for base, _, files in os.walk(source):
27         cur_files = []
28         for f in files:
29             if file_matcher.match(f):
30                 cur_files.append(os.path.join(base, f))
31         if cur_files:
32             out.append(
33                 (base, cur_files))
34
35     return out
36
37 setup(
38     name=name,
39     version=version,
40     description=description,
41     long_description=long_description,
42     author=author,
43     author_email=author_email,
44     url=url,
45     download_url=download_url,
46     license=license,
47     install_requires=[
48         "Babel >= 0.9.6",
49         "simplejson >= 2.0.9",
50         "python-dateutil >= 1.4.1",
51         "pytz",
52         "werkzeug == 0.7",
53     ],
54     tests_require=[
55         'unittest2',
56         'mock',
57     ],
58     test_suite = 'unittest2.collector',
59     zip_safe=False,
60     packages=find_packages(),
61     classifiers=[
62         'Development Status :: 6 - Production/Stable',
63         'Operating System :: OS Independent',
64         'Programming Language :: Python',
65         'Environment :: Web Environment',
66         'Topic :: Office/Business :: Financial',
67         ],
68     scripts=['openerp-web'],
69     data_files=(find_data_files('addons')
70               + opts.pop('data_files', [])
71     ),
72     **opts
73 )