[IMP] point_of_sale: re-use the /web provided font-awesome font
[odoo/odoo.git] / setup.py
1 #!/usr/bin/env python
2 # -*- coding: utf-8 -*-
3
4 import os
5 import re
6 from glob import glob
7 from setuptools import find_packages, setup
8 from os.path import join, dirname
9
10
11 execfile(join(dirname(__file__), 'openerp', 'release.py'))  # Load release variables
12 lib_name = 'openerp'
13
14
15 def py2exe_datafiles():
16     data_files = {}
17     data_files['Microsoft.VC90.CRT'] = glob('C:\Microsoft.VC90.CRT\*.*')
18
19     for root, dirnames, filenames in os.walk('openerp'):
20         for filename in filenames:
21             if not re.match(r'.*(\.pyc|\.pyo|\~)$', filename):
22                 data_files.setdefault(root, []).append(join(root, filename))
23
24     import babel
25     data_files['babel/localedata'] = glob(join(dirname(babel.__file__), 'localedata', '*'))
26     others = ['global.dat', 'numbers.py', 'support.py', 'plural.py']
27     data_files['babel'] = map(lambda f: join(dirname(babel.__file__), f), others)
28     others = ['frontend.py', 'mofile.py']
29     data_files['babel/messages'] = map(lambda f: join(dirname(babel.__file__), 'messages', f), others)
30
31     import pytz
32     tzdir = dirname(pytz.__file__)
33     for root, _, filenames in os.walk(join(tzdir, 'zoneinfo')):
34         base = join('pytz', root[len(tzdir) + 1:])
35         data_files[base] = [join(root, f) for f in filenames]
36
37     import docutils
38     dudir = dirname(docutils.__file__)
39     for root, _, filenames in os.walk(dudir):
40         base = join('docutils', root[len(dudir) + 1:])
41         data_files[base] = [join(root, f) for f in filenames if not f.endswith(('.py', '.pyc', '.pyo'))]
42
43     import passlib
44     pl = dirname(passlib.__file__)
45     for root, _, filenames in os.walk(pl):
46         base = join('passlib', root[len(pl) + 1:])
47         data_files[base] = [join(root, f) for f in filenames if not f.endswith(('.py', '.pyc', '.pyo'))]
48
49     return data_files.items()
50
51
52 def py2exe_options():
53     if os.name == 'nt':
54         import py2exe
55         return {
56             'console': [
57                 {'script': 'odoo.py'},
58                 {'script': 'openerp-gevent'},
59                 {'script': 'openerp-server', 'icon_resources': [
60                     (1, join('setup', 'win32', 'static', 'pixmaps', 'openerp-icon.ico'))
61                 ]},
62             ],
63             'options': {
64                 'py2exe': {
65                     'skip_archive': 1,
66                     'optimize': 0,  # Keep the assert running as the integrated tests rely on them.
67                     'dist_dir': 'dist',
68                     'packages': [
69                         'asynchat', 'asyncore',
70                         'commands',
71                         'dateutil',
72                         'decimal',
73                         'decorator',
74                         'docutils',
75                         'email',
76                         'encodings',
77                         'HTMLParser',
78                         'imaplib',
79                         'jinja2',
80                         'lxml', 'lxml._elementpath', 'lxml.builder', 'lxml.etree', 'lxml.objectify',
81                         'mako',
82                         'markupsafe',
83                         'mock',
84                         'openerp',
85                         'openid',
86                         'passlib',
87                         'PIL',
88                         'poplib',
89                         'psutil',
90                         'pychart',
91                         'pydot',
92                         'pyparsing',
93                         'pyPdf',
94                         'pytz',
95                         'reportlab',
96                         'requests',
97                         'select',
98                         'simplejson',
99                         'smtplib',
100                         'uuid',
101                         'vatnumber',
102                         'vobject',
103                         'win32service', 'win32serviceutil',
104                         'xlwt',
105                         'xml', 'xml.dom',
106                         'yaml',
107                     ],
108                     'excludes': ['Tkconstants', 'Tkinter', 'tcl'],
109                 }
110             },
111             'data_files': py2exe_datafiles()
112         }
113     else:
114         return {}
115
116
117 setup(
118     name='openerp',
119     version=version,
120     description=description,
121     long_description=long_desc,
122     url=url,
123     author=author,
124     author_email=author_email,
125     classifiers=filter(None, classifiers.split('\n')),
126     license=license,
127     scripts=['openerp-server', 'openerp-gevent', 'odoo.py'],
128     packages=find_packages(),
129     package_dir={'%s' % lib_name: 'openerp'},
130     include_package_data=True,
131     dependency_links=['http://download.gna.org/pychart/'],
132     install_requires=[
133         'babel >= 1.0',
134         'decorator',
135         'docutils',
136         'feedparser',
137         'gevent',
138         'Jinja2',
139         'lxml',  # windows binary http://www.lfd.uci.edu/~gohlke/pythonlibs/
140         'mako',
141         'mock',
142         'passlib',
143         'pillow',  # windows binary http://www.lfd.uci.edu/~gohlke/pythonlibs/
144         'psutil',  # windows binary code.google.com/p/psutil/downloads/list
145         'psycogreen',
146         'psycopg2 >= 2.2',
147         'pychart',  # not on pypi, use: pip install http://download.gna.org/pychart/PyChart-1.39.tar.gz
148         'pydot',
149         'pyparsing < 2',
150         'pypdf',
151         'pyserial',
152         'python-dateutil',
153         'python-ldap',  # optional
154         'python-openid',
155         'pytz',
156         'pyusb >= 1.0.0b1',
157         'pyyaml',
158         'qrcode',
159         'reportlab',  # windows binary pypi.python.org/pypi/reportlab
160         'requests',
161         'simplejson',
162         'unittest2',
163         'vatnumber',
164         'vobject',
165         'werkzeug',
166         'xlwt',
167     ],
168     extras_require={
169         'SSL': ['pyopenssl'],
170     },
171     tests_require=[
172         'unittest2',
173         'mock',
174     ],
175     **py2exe_options()
176 )