~openerp-community/openobject-server/fix-1130010-toxml-escape-quot

1864 by pap(openerp)
Changed encoding to coding ref: PEP: 0263
1
# -*- coding: utf-8 -*-
809 by stw
add Copyright and GPL license into the Header of Python files
2
##############################################################################
1920 by NCH(openerp)
Added mako in setup.py
3
#
1766.1.12 by Naresh Choksy
Bugfix:373230
4
#    OpenERP, Open Source Management Solution
1958.1.30 by Stephane Wirtel
[FIX] Change the year of the copyright
5
#    Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
1230 by Christophe Simonis
passing in GPL-3
6
#
7
#    This program is free software: you can redistribute it and/or modify
1861 by PSO(OpenERP)
Changed licencing
8
#    it under the terms of the GNU Affero General Public License as
9
#    published by the Free Software Foundation, either version 3 of the
10
#    License, or (at your option) any later version.
1230 by Christophe Simonis
passing in GPL-3
11
#
12
#    This program is distributed in the hope that it will be useful,
13
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
14
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
1861 by PSO(OpenERP)
Changed licencing
15
#    GNU Affero General Public License for more details.
1230 by Christophe Simonis
passing in GPL-3
16
#
1861 by PSO(OpenERP)
Changed licencing
17
#    You should have received a copy of the GNU Affero General Public License
1920 by NCH(openerp)
Added mako in setup.py
18
#    along with this program.  If not, see <http://www.gnu.org/licenses/>.
1230 by Christophe Simonis
passing in GPL-3
19
#
20
##############################################################################
1229 by Christophe Simonis
improvement
21
3659 by Antony Lesuisse
[IMP] directory cleanups, moved historical cruft into history
22
import glob, os, re, setuptools, sys
4357.2.77 by Christophe Simonis
[FIX] setup.py
23
from os.path import join
1 by pinky
New trunk
24
3659 by Antony Lesuisse
[IMP] directory cleanups, moved historical cruft into history
25
# List all data files
26
def data():
4357.2.77 by Christophe Simonis
[FIX] setup.py
27
    r = {}
3659 by Antony Lesuisse
[IMP] directory cleanups, moved historical cruft into history
28
    for root, dirnames, filenames in os.walk('openerp'):
29
        for filename in filenames:
4357.2.77 by Christophe Simonis
[FIX] setup.py
30
            if not re.match(r'.*(\.pyc|\.pyo|\~)$', filename):
31
                r.setdefault(root, []).append(os.path.join(root, filename))
32
3893 by Vo Minh Thu
[FIX] packaging: some changes for windows packaging.
33
    if os.name == 'nt':
4357.2.77 by Christophe Simonis
[FIX] setup.py
34
        r["Microsoft.VC90.CRT"] = glob.glob('C:\Microsoft.VC90.CRT\*.*')
4642.1.1 by Christophe Simonis
[FIX] correct setup.py
35
4357.2.76 by Christophe Simonis
[FIX] setup.py: add pytz data files on windows
36
        import babel
4743.1.132 by Vo Minh Thu
[FIX] setup.py (windows): add some babel files not automatically included by py2exe.
37
        # Add data, but also some .py files py2exe won't include automatically.
38
        # TODO This should probably go under `packages`, instead of `data`,
39
        # but this will work fine (especially since we don't use the ZIP file
40
        # approach).
41
        r["babel/localedata"] = glob.glob(os.path.join(os.path.dirname(babel.__file__), "localedata", '*'))
42
        others = ['global.dat', 'numbers.py', 'support.py']
43
        r["babel"] = map(lambda f: os.path.join(os.path.dirname(babel.__file__), f), others)
44
        others = ['frontend.py', 'mofile.py']
45
        r["babel/messages"] = map(lambda f: os.path.join(os.path.dirname(babel.__file__), "messages", f), others)
4642.1.1 by Christophe Simonis
[FIX] correct setup.py
46
4357.2.76 by Christophe Simonis
[FIX] setup.py: add pytz data files on windows
47
        import pytz
4357.2.77 by Christophe Simonis
[FIX] setup.py
48
        tzdir = os.path.dirname(pytz.__file__)
49
        for root, _, filenames in os.walk(os.path.join(tzdir, "zoneinfo")):
4357.2.79 by Christophe Simonis
[FIX] correct path for pytz datafiles
50
            base = os.path.join('pytz', root[len(tzdir) + 1:])
4357.2.77 by Christophe Simonis
[FIX] setup.py
51
            r[base] = [os.path.join(root, f) for f in filenames]
52
4743.6.2 by Christophe Simonis
[FIX] setup.py: correct windows install
53
        import docutils
54
        dudir = os.path.dirname(docutils.__file__)
55
        for root, _, filenames in os.walk(dudir):
56
            base = os.path.join('docutils', root[len(dudir) + 1:])
57
            r[base] = [os.path.join(root, f) for f in filenames if not f.endswith(('.py', '.pyc', '.pyo'))]
58
4357.2.77 by Christophe Simonis
[FIX] setup.py
59
    return r.items()
3659 by Antony Lesuisse
[IMP] directory cleanups, moved historical cruft into history
60
61
def gen_manifest():
62
    file_list="\n".join(data())
63
    open('MANIFEST','w').write(file_list)
64
3893 by Vo Minh Thu
[FIX] packaging: some changes for windows packaging.
65
if os.name == 'nt':
66
    sys.path.append("C:\Microsoft.VC90.CRT")
67
3691.1.3 by Antony Lesuisse
[IMP] packaging timestamp support
68
def py2exe_options():
69
    if os.name == 'nt':
70
        import py2exe
71
        return {
3884 by Vo Minh Thu
[FIX] setup.py: pixmaps/ was renamed in install/ at revno: 3659,
72
            "console" : [ { "script": "openerp-server", "icon_resources": [(1, join("install","openerp-icon.ico"))], }],
3691.1.3 by Antony Lesuisse
[IMP] packaging timestamp support
73
            'options' : {
74
                "py2exe": {
75
                    "skip_archive": 1,
4743.1.143 by Vo Minh Thu
[FIX] py2exe: keep the code unoptimized (i.e. no -Ox).
76
                    "optimize": 0, # keep the assert running, because the integrated tests rely on them.
3691.1.3 by Antony Lesuisse
[IMP] packaging timestamp support
77
                    "dist_dir": 'dist',
4734 by Antony Lesuisse
packaging jinja2
78
                    "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", ],
3691.1.3 by Antony Lesuisse
[IMP] packaging timestamp support
79
                    "excludes" : ["Tkconstants","Tkinter","tcl"],
80
                }
81
            }
82
        }
83
    else:
84
        return {}
85
86
execfile(join(os.path.dirname(__file__), 'openerp', 'release.py'))
87
4542 by Antony Lesuisse
[IMP] improve experience on for openerp developers on windows, notes in setup.py and fix some imports
88
# Notes for OpenERP developer on windows:
89
#
90
# To setup a windows developer evironement install python2.7 then pip and use
91
# "pip install <depencey>" for every dependency listed below.
92
#
93
# Dependecies that requires DLLs are not installable with pip install, for
94
# them we added comments with links where you can find the installers.
95
#
96
# OpenERP on windows also require the pywin32, the binary can be found at
97
# http://pywin32.sf.net
98
#
99
# Both python2.7 32bits and 64bits are known to work.
100
3659 by Antony Lesuisse
[IMP] directory cleanups, moved historical cruft into history
101
setuptools.setup(
3691.1.2 by Antony Lesuisse
[IMP] packaging rename into openerp
102
      name             = 'openerp',
1 by pinky
New trunk
103
      version          = version,
314 by ced
SERVER: improve setup
104
      description      = description,
1 by pinky
New trunk
105
      long_description = long_desc,
314 by ced
SERVER: improve setup
106
      url              = url,
107
      author           = author,
108
      author_email     = author_email,
1 by pinky
New trunk
109
      classifiers      = filter(None, classifiers.split("\n")),
314 by ced
SERVER: improve setup
110
      license          = license,
3359.2.9 by Vo Minh Thu
[REF] renamed openerp-server.py to openerp-server.
111
      scripts          = ['openerp-server'],
3659 by Antony Lesuisse
[IMP] directory cleanups, moved historical cruft into history
112
      data_files       = data(),
113
      packages         = setuptools.find_packages(),
4016.1.1 by Florent Xicluna
[FIX] the embedded pychart library is not used.
114
      dependency_links = ['http://download.gna.org/pychart/'],
3659 by Antony Lesuisse
[IMP] directory cleanups, moved historical cruft into history
115
      #include_package_data = True,
2918 by Stephane Wirtel
[FIX] Update the setup.py to solve some problems
116
      install_requires = [
4542 by Antony Lesuisse
[IMP] improve experience on for openerp developers on windows, notes in setup.py and fix some imports
117
          'pychart', # not on pypi, use: pip install http://download.gna.org/pychart/PyChart-1.39.tar.gz
3692.1.1 by Antony Lesuisse
[FIX] missing deps babel and openid
118
          'babel',
4359 by Vo Minh Thu
[FIX] setup.py: added docutils dependency introduced at revision 4341.3.1.
119
          'docutils',
3691.1.6 by Antony Lesuisse
[IMP] packaging depends
120
          'feedparser',
3694 by Antony Lesuisse
missing deps gdata
121
          'gdata',
4871 by Vo Minh Thu
[FIX] setup.py: added gevent and gevent-psycopg2 dependencies.
122
          'gevent',
123
          'gevent-psycopg2',
4682.1.1 by Raphael Collet
[IMP] setup.py: add dependency on jinja2
124
          'Jinja2',
4676 by Xavier Morel
[FIX] unpin LXML as 3.0 official has been released
125
          'lxml', # windows binary http://www.lfd.uci.edu/~gohlke/pythonlibs/
3691.1.6 by Antony Lesuisse
[IMP] packaging depends
126
          'mako',
4651 by Antony Lesuisse
[IMP] cli first command testjs
127
          'mock',
4542 by Antony Lesuisse
[IMP] improve experience on for openerp developers on windows, notes in setup.py and fix some imports
128
          'PIL', # windows binary http://www.lfd.uci.edu/~gohlke/pythonlibs/
129
          'psutil', # windows binary code.google.com/p/psutil/downloads/list
4743.1.97 by Olivier Dony
[FIX] setup.py: bump up min required psycopg2 version for 7.0, because 2.2 is actually required
130
          'psycopg2 >= 2.2',
2918 by Stephane Wirtel
[FIX] Update the setup.py to solve some problems
131
          'pydot',
4834 by Vo Minh Thu
[FIX] setup.py: pyparsing >= 2.0.0 works only with Python 3.
132
          'pyparsing < 2',
3855 by Xavier Morel
[FIX] dependencies: don't grab dateutil >= 2.0, it's the Python3 version and incompatible with P2
133
          'python-dateutil < 2',
4542 by Antony Lesuisse
[IMP] improve experience on for openerp developers on windows, notes in setup.py and fix some imports
134
          'python-ldap', # optional
3692.1.2 by Antony Lesuisse
[FIX] missing deps typo openid
135
          'python-openid',
2918 by Stephane Wirtel
[FIX] Update the setup.py to solve some problems
136
          'pytz',
3691.1.6 by Antony Lesuisse
[IMP] packaging depends
137
          'pywebdav',
138
          'pyyaml',
4542 by Antony Lesuisse
[IMP] improve experience on for openerp developers on windows, notes in setup.py and fix some imports
139
          'reportlab', # windows binary pypi.python.org/pypi/reportlab
3691.1.6 by Antony Lesuisse
[IMP] packaging depends
140
          'simplejson',
4665 by Antony Lesuisse
[FIX] deps for debian stable, python 2.6
141
          'unittest2',
3732 by Antony Lesuisse
[IMP] debian missing deps
142
          'vatnumber',
3696 by Antony Lesuisse
missing deps vobject
143
          'vobject',
3691.1.6 by Antony Lesuisse
[IMP] packaging depends
144
          'werkzeug',
3959 by Antony Lesuisse
[FIX] add depends on xlwt
145
          'xlwt',
2918 by Stephane Wirtel
[FIX] Update the setup.py to solve some problems
146
      ],
3359.2.3 by Vo Minh Thu
[IMP] setup.py: cleaning
147
      extras_require = {
2309.1.1 by Stephane Wirtel
[IMP] Rewrite the setup.py file to use the setuptools package
148
          'SSL' : ['pyopenssl'],
3359.2.3 by Vo Minh Thu
[IMP] setup.py: cleaning
149
      },
4408.2.1 by Xavier Morel
[ADD] big bit on new import: pretty much everything but o2m
150
      tests_require = ['unittest2'],
3691.1.3 by Antony Lesuisse
[IMP] packaging timestamp support
151
      **py2exe_options()
2309.1.1 by Stephane Wirtel
[IMP] Rewrite the setup.py file to use the setuptools package
152
)
1 by pinky
New trunk
153
3822.1.1 by Numerigraphe - Lionel Sausin
[IMP] Added missing vim mode lines
154
155
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: