[REL] Release 7.0
[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
25
26 # List all data files
27 def data():
28     r = {}
29     for root, dirnames, filenames in os.walk('openerp'):
30         for filename in filenames:
31             if not re.match(r'.*(\.pyc|\.pyo|\~)$', filename):
32                 r.setdefault(root, []).append(os.path.join(root, filename))
33
34     if os.name == 'nt':
35         r["Microsoft.VC90.CRT"] = glob.glob('C:\Microsoft.VC90.CRT\*.*')
36
37         import babel
38         r["localedata"] = glob.glob(os.path.join(os.path.dirname(babel.__file__), "localedata", '*'))
39
40         import pytz
41         tzdir = os.path.dirname(pytz.__file__)
42         for root, _, filenames in os.walk(os.path.join(tzdir, "zoneinfo")):
43             base = os.path.join('pytz', root[len(tzdir) + 1:])
44             r[base] = [os.path.join(root, f) for f in filenames]
45
46         import docutils
47         dudir = os.path.dirname(docutils.__file__)
48         for root, _, filenames in os.walk(dudir):
49             base = os.path.join('docutils', root[len(dudir) + 1:])
50             r[base] = [os.path.join(root, f) for f in filenames if not f.endswith(('.py', '.pyc', '.pyo'))]
51
52     return r.items()
53
54 def gen_manifest():
55     file_list="\n".join(data())
56     open('MANIFEST','w').write(file_list)
57
58 if os.name == 'nt':
59     sys.path.append("C:\Microsoft.VC90.CRT")
60
61 def py2exe_options():
62     if os.name == 'nt':
63         import py2exe
64         return {
65             "console" : [ { "script": "openerp-server", "icon_resources": [(1, join("install","openerp-icon.ico"))], }],
66             'options' : {
67                 "py2exe": {
68                     "skip_archive": 1,
69                     "optimize": 2,
70                     "dist_dir": 'dist',
71                     "packages": [ "DAV", "HTMLParser", "PIL", "asynchat", "asyncore", "commands", "dateutil", "decimal", "docutils", "email", "encodings", "imaplib", "jinja2", "lxml", "lxml._elementpath", "lxml.builder", "lxml.etree", "lxml.objectify", "mako", "openerp", "poplib", "pychart", "pydot", "pyparsing", "pytz", "reportlab", "select", "simplejson", "smtplib", "uuid", "vatnumber", "vobject", "xml", "xml.dom", "yaml", ],
72                     "excludes" : ["Tkconstants","Tkinter","tcl"],
73                 }
74             }
75         }
76     else:
77         return {}
78
79 execfile(join(os.path.dirname(__file__), 'openerp', 'release.py'))
80
81 # Notes for OpenERP developer on windows:
82 #
83 # To setup a windows developer evironement install python2.7 then pip and use
84 # "pip install <depencey>" for every dependency listed below.
85 #
86 # Dependecies that requires DLLs are not installable with pip install, for
87 # them we added comments with links where you can find the installers.
88 #
89 # OpenERP on windows also require the pywin32, the binary can be found at
90 # http://pywin32.sf.net
91 #
92 # Both python2.7 32bits and 64bits are known to work.
93
94 setuptools.setup(
95       name             = 'openerp',
96       version          = version,
97       description      = description,
98       long_description = long_desc,
99       url              = url,
100       author           = author,
101       author_email     = author_email,
102       classifiers      = filter(None, classifiers.split("\n")),
103       license          = license,
104       scripts          = ['openerp-server'],
105       data_files       = data(),
106       packages         = setuptools.find_packages(),
107       dependency_links = ['http://download.gna.org/pychart/'],
108       #include_package_data = True,
109       install_requires = [
110           'pychart', # not on pypi, use: pip install http://download.gna.org/pychart/PyChart-1.39.tar.gz
111           'babel',
112           'docutils',
113           'feedparser',
114           'gdata',
115           'Jinja2',
116           'lxml', # windows binary http://www.lfd.uci.edu/~gohlke/pythonlibs/
117           'mako',
118           'mock',
119           'PIL', # windows binary http://www.lfd.uci.edu/~gohlke/pythonlibs/
120           'psutil', # windows binary code.google.com/p/psutil/downloads/list
121           'psycopg2',
122           'pydot',
123           'python-dateutil < 2',
124           'python-ldap', # optional
125           'python-openid',
126           'pytz',
127           'pywebdav',
128           'pyyaml',
129           'reportlab', # windows binary pypi.python.org/pypi/reportlab
130           'simplejson',
131           'unittest2',
132           'vatnumber',
133           'vobject',
134           'werkzeug',
135           'xlwt',
136       ],
137       extras_require = {
138           'SSL' : ['pyopenssl'],
139       },
140       tests_require = ['unittest2'],
141       **py2exe_options()
142 )
143
144
145 # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: