[IMP] directory cleanups, moved historical cruft into history
[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 execfile(join('openerp', 'release.py'))
27
28 py2exe_keywords = {}
29 if os.name == 'nt':
30     import py2exe
31     py2exe_keywords['console'] = [
32         { "script": "openerp-server",
33           "icon_resources": [(1, join("pixmaps","openerp-icon.ico"))],
34         }]
35     py2exe_keywords['options'] = {
36         "py2exe": {
37             "skip_archive": 1,
38             "optimize": 2,
39             "dist_dir": 'dist',
40             "packages": [
41                 "lxml", "lxml.builder", "lxml._elementpath", "lxml.etree",
42                 "lxml.objectify", "decimal", "xml", "xml", "xml.dom", "xml.xpath",
43                 "encodings", "dateutil", "pychart", "PIL", "pyparsing",
44                 "pydot", "asyncore","asynchat", "reportlab", "vobject",
45                 "HTMLParser", "select", "mako", "poplib",
46                 "imaplib", "smtplib", "email", "yaml", "DAV",
47                 "uuid", "commands", "openerp", "simplejson", "vatnumber"
48             ],
49             "excludes" : ["Tkconstants","Tkinter","tcl"],
50         }
51     }
52
53 # List all data files
54 def data():
55     files = []
56     for root, dirnames, filenames in os.walk('openerp'):
57         for filename in filenames:
58             if not re.match(r'.*(\.pyc|\.pyo|\~)$',filename):
59                 files.append(os.path.join(root, filename))
60     d = {}
61     for v in files:
62         k=os.path.dirname(v)
63         if k in d:
64             d[k].append(v)
65         else:
66             d[k]=[v]
67     r = d.items()
68     return r
69
70 def gen_manifest():
71     file_list="\n".join(data())
72     open('MANIFEST','w').write(file_list)
73
74 setuptools.setup(
75       name             = name,
76       version          = version,
77       description      = description,
78       long_description = long_desc,
79       url              = url,
80       author           = author,
81       author_email     = author_email,
82       classifiers      = filter(None, classifiers.split("\n")),
83       license          = license,
84       scripts          = ['openerp-server'],
85       data_files       = data(),
86       packages         = setuptools.find_packages(),
87       #include_package_data = True,
88       install_requires = [
89        # We require the same version as caldav for lxml.
90           'lxml==2.1.5',
91           'mako',
92           'python-dateutil',
93           'psycopg2',
94         # TODO the pychart package we include in openerp corresponds to PyChart 1.37.
95         # It seems there is a single difference, which is a spurious print in generate_docs.py.
96         # It is probably safe to move to PyChart 1.39 (the latest one).
97         # (Let setup.py choose the latest one, and we should check we can remove pychart from
98         # our tree.)
99         # http://download.gna.org/pychart/
100           'pychart',
101           'pydot',
102           'pytz',
103           'reportlab',
104           'caldav',
105           'pyyaml',
106           'pywebdav',
107           'feedparser',
108           'simplejson >= 2.0',
109           'vatnumber', # required by base_vat module
110       ],
111       extras_require = {
112           'SSL' : ['pyopenssl'],
113       },
114       **py2exe_keywords
115 )
116