[FIX] missing deps babel and openid
[odoo/odoo.git] / setup.py
1 #!/usr/bin/env python
2 # -*- coding: utf-8 -*-
3 ##############################################################################
4 #
5 #    OpenERP, Open Source Management Solution
6 #    Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
7 #
8 #    This program is free software: you can redistribute it and/or modify
9 #    it under the terms of the GNU Affero General Public License as
10 #    published by the Free Software Foundation, either version 3 of the
11 #    License, or (at your option) any later version.
12 #
13 #    This program is distributed in the hope that it will be useful,
14 #    but WITHOUT ANY WARRANTY; without even the implied warranty of
15 #    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16 #    GNU Affero General Public License for more details.
17 #
18 #    You should have received a copy of the GNU Affero General Public License
19 #    along with this program.  If not, see <http://www.gnu.org/licenses/>.
20 #
21 ##############################################################################
22
23 import glob, os, re, setuptools, sys
24 from os.path import join, isfile
25
26 # List all data files
27 def data():
28     files = []
29     for root, dirnames, filenames in os.walk('openerp'):
30         for filename in filenames:
31             if not re.match(r'.*(\.pyc|\.pyo|\~)$',filename):
32                 files.append(os.path.join(root, filename))
33     d = {}
34     for v in files:
35         k=os.path.dirname(v)
36         if k in d:
37             d[k].append(v)
38         else:
39             d[k]=[v]
40     r = d.items()
41     return r
42
43 def gen_manifest():
44     file_list="\n".join(data())
45     open('MANIFEST','w').write(file_list)
46
47 def py2exe_options():
48     if os.name == 'nt':
49         import py2exe
50         return {
51             "console" : [ { "script": "openerp-server", "icon_resources": [(1, join("pixmaps","openerp-icon.ico"))], }],
52             'options' : {
53                 "py2exe": {
54                     "skip_archive": 1,
55                     "optimize": 2,
56                     "dist_dir": 'dist',
57                     "packages": [ "DAV", "HTMLParser", "PIL", "asynchat", "asyncore", "commands", "dateutil", "decimal", "email", "encodings", "imaplib", "lxml", "lxml._elementpath", "lxml.builder", "lxml.etree", "lxml.objectify", "mako", "openerp", "poplib", "pychart", "pydot", "pyparsing", "reportlab", "select", "simplejson", "smtplib", "uuid", "vatnumber" "vobject", "xml", "xml", "xml.dom", "xml.xpath", "yaml", ],
58                     "excludes" : ["Tkconstants","Tkinter","tcl"],
59                 }
60             }
61         }
62     else:
63         return {}
64
65 execfile(join(os.path.dirname(__file__), 'openerp', 'release.py'))
66 if timestamp:
67     version = version + "-" + timestamp
68
69 setuptools.setup(
70       name             = 'openerp',
71       version          = version,
72       description      = description,
73       long_description = long_desc,
74       url              = url,
75       author           = author,
76       author_email     = author_email,
77       classifiers      = filter(None, classifiers.split("\n")),
78       license          = license,
79       scripts          = ['openerp-server'],
80       data_files       = data(),
81       packages         = setuptools.find_packages(),
82       #include_package_data = True,
83       install_requires = [
84         # TODO the pychart package we include in openerp corresponds to PyChart 1.37.
85         # It seems there is a single difference, which is a spurious print in generate_docs.py.
86         # It is probably safe to move to PyChart 1.39 (the latest one).
87         # (Let setup.py choose the latest one, and we should check we can remove pychart from
88         # our tree.) http://download.gna.org/pychart/
89         # TODO  'pychart',
90           'babel',
91           'feedparser',
92           'lxml',
93           'mako',
94           'openid',
95           'psycopg2',
96           'pydot',
97           'python-dateutil',
98           'pytz',
99           'pywebdav',
100           'pyyaml',
101           'reportlab',
102           'simplejson',
103           'vatnumber', # recommended by base_vat
104           'werkzeug',
105       ],
106       extras_require = {
107           'SSL' : ['pyopenssl'],
108       },
109       **py2exe_options()
110 )
111