~openerp-dev/openobject-client-web/trunk-bug-1156592-priyanka

3714.1.10 by Xavier Morel
[IMP] bundle media files in py2exe archives, or try to anyway, and bundle addons directory as well
1
import os
2
import re
3058 by Amit Mendapara
[FIX] Fixed setup.py
3
import sys
4
5
from setuptools import setup
6
3761 by Xavier Morel
[FIX] first pass on fixing the web client's packaging
7
execfile(os.path.join("openobject", "release.py"))
3 by Amit Mendapara
* Merging local source on tinyerp svn server.
8
3714.1.3 by Xavier Morel
[IMP] try to introduce py2exe in the core setup.py file
9
version_dash_incompatible = False
3065 by Amit Mendapara
[FIX] Fixed the setup.py script (pip, easy_install issue of installing data files).
10
if 'bdist_rpm' in sys.argv:
3714.1.3 by Xavier Morel
[IMP] try to introduce py2exe in the core setup.py file
11
    version_dash_incompatible = True
12
try:
13
    import py2exe
3714.1.10 by Xavier Morel
[IMP] bundle media files in py2exe archives, or try to anyway, and bundle addons directory as well
14
    from py2exe_utils import opts
3714.1.3 by Xavier Morel
[IMP] try to introduce py2exe in the core setup.py file
15
    version_dash_incompatible = True
16
except ImportError:
3714.1.10 by Xavier Morel
[IMP] bundle media files in py2exe archives, or try to anyway, and bundle addons directory as well
17
    opts = {}
3714.1.3 by Xavier Morel
[IMP] try to introduce py2exe in the core setup.py file
18
if version_dash_incompatible:
3714.1.19 by Xavier Morel
[IMP] manage openobject's static files as data files so it's possible for cherrypy and mako to get at them even in a py2exe environment, once the pathfinding is fixed.
19
    version = version.split('-')[0]
2031.1.5 by Amit Mendapara
* Restructured data files.
20
3714.1.11 by Xavier Morel
[IMP] bundle docs in py2exe dist as well as in sdist, remove win32 directory from sdist (for now anyway)
21
FILE_PATTERNS = \
22
    r'.+\.(py|cfg|po|pot|mo|txt|rst|gif|png|jpg|ico|mako|html|js|css|htc|swf)$'
3714.1.31 by Xavier Morel
[IMP] simplify find_data_file (yagni dammit), remove Python 2.5-incompatible relpath call in the process
23
def find_data_files(source, patterns=FILE_PATTERNS):
3714.1.11 by Xavier Morel
[IMP] bundle docs in py2exe dist as well as in sdist, remove win32 directory from sdist (for now anyway)
24
    file_matcher = re.compile(patterns, re.I)
3714.1.10 by Xavier Morel
[IMP] bundle media files in py2exe archives, or try to anyway, and bundle addons directory as well
25
    out = []
26
    for base, _, files in os.walk(source):
27
        cur_files = []
28
        for f in files:
3714.1.11 by Xavier Morel
[IMP] bundle docs in py2exe dist as well as in sdist, remove win32 directory from sdist (for now anyway)
29
            if file_matcher.match(f):
3714.1.31 by Xavier Morel
[IMP] simplify find_data_file (yagni dammit), remove Python 2.5-incompatible relpath call in the process
30
                cur_files.append(os.path.join(base, f))
3714.1.10 by Xavier Morel
[IMP] bundle media files in py2exe archives, or try to anyway, and bundle addons directory as well
31
        if cur_files:
32
            out.append(
3714.1.31 by Xavier Morel
[IMP] simplify find_data_file (yagni dammit), remove Python 2.5-incompatible relpath call in the process
33
                (base, cur_files))
3714.1.10 by Xavier Morel
[IMP] bundle media files in py2exe archives, or try to anyway, and bundle addons directory as well
34
35
    return out
36
3 by Amit Mendapara
* Merging local source on tinyerp svn server.
37
setup(
3714.1.19 by Xavier Morel
[IMP] manage openobject's static files as data files so it's possible for cherrypy and mako to get at them even in a py2exe environment, once the pathfinding is fixed.
38
    name=name,
39
    version=version,
40
    description=description,
41
    long_description=long_description,
42
    author=author,
43
    author_email=author_email,
44
    url=url,
45
    download_url=download_url,
46
    license=license,
3317 by Amit Mendapara
[FIX] win32 installer
47
    install_requires=[
4454.1.76 by Xavier Morel
[FIX] CherryPy requirement to 3.1.2 as there are apparently issues with 3.2 that we have to resolve
48
        "CherryPy == 3.1.2",
2379 by ame (Tiny/Axelor)
* Updated setup.py
49
        "Mako >= 0.2.4",
50
        "Babel >= 0.9.4",
51
        "FormEncode >= 1.2.2",
52
        "simplejson >= 2.0.9",
3532.1.1 by Xavier Morel
[FIX] add direct dependency on pytz, remove dependency on pyparsing (doesn't seem directly used so transitive dependency?)
53
        "python-dateutil >= 1.4.1",
54
        "pytz >= 2009j"
3 by Amit Mendapara
* Merging local source on tinyerp svn server.
55
    ],
3058 by Amit Mendapara
[FIX] Fixed setup.py
56
    zip_safe=False,
57
    packages=[
3714.1.2 by Xavier Morel
[IMP] attempt to make setup.py and MANIFEST.in more 'normal' (as per distutils/packaging guidelines) and more logical
58
        'openobject',
59
        'openobject.admin',
60
        'openobject.admin.i18n',
61
        'openobject.controllers',
62
        'openobject.i18n',
4680 by Olivier Dony
[FIX] setup.py: missing rpc package (suggested by Charles McCreary)
63
        'openobject.rpc',
3714.1.2 by Xavier Morel
[IMP] attempt to make setup.py and MANIFEST.in more 'normal' (as per distutils/packaging guidelines) and more logical
64
        'openobject.test',
65
        'openobject.tools',
66
        'openobject.widgets'
67
    ],
3058 by Amit Mendapara
[FIX] Fixed setup.py
68
    classifiers=[
2280 by ame (Tiny/Axelor)
* Updated egg dev status to stable.
69
        'Development Status :: 5 - Production/Stable',
3 by Amit Mendapara
* Merging local source on tinyerp svn server.
70
        'Operating System :: OS Independent',
71
        'Programming Language :: Python',
2676 by ame (Tiny/Axelor)
[UPD] PyPI info.
72
        'Environment :: Web Environment',
73
        'Topic :: Office/Business :: Financial',
2280 by ame (Tiny/Axelor)
* Updated egg dev status to stable.
74
        ],
3714.1.6 by Xavier Morel
[IMP] use the release module directly rather than exec'ing it
75
    scripts=['scripts/openerp-web'],
4601.1.9 by Xavier Morel
[FIX] openerp-web.cfg was moved back to the package root, remember to add it as module data in the packaging
76
    data_files=(['openerp-web.cfg']
77
              + find_data_files('addons/openerp')
3714.1.10 by Xavier Morel
[IMP] bundle media files in py2exe archives, or try to anyway, and bundle addons directory as well
78
              + find_data_files('addons/view_calendar')
79
              + find_data_files('addons/view_diagram')
80
              + find_data_files('addons/view_graph')
81
              + find_data_files('addons/widget_ckeditor')
3714.1.11 by Xavier Morel
[IMP] bundle docs in py2exe dist as well as in sdist, remove win32 directory from sdist (for now anyway)
82
              + find_data_files('doc', patterns='')
3714.1.19 by Xavier Morel
[IMP] manage openobject's static files as data files so it's possible for cherrypy and mako to get at them even in a py2exe environment, once the pathfinding is fixed.
83
              + find_data_files('openobject', patterns=r'.+\.(cfg|css|js|mako|gif|png|jpg|ico)')
3714.1.27 by Xavier Morel
[FIX] packaging of babel locale data
84
              + opts.pop('data_files', [])
3714.1.19 by Xavier Morel
[IMP] manage openobject's static files as data files so it's possible for cherrypy and mako to get at them even in a py2exe environment, once the pathfinding is fixed.
85
    ),
3714.1.10 by Xavier Morel
[IMP] bundle media files in py2exe archives, or try to anyway, and bundle addons directory as well
86
    **opts
3058 by Amit Mendapara
[FIX] Fixed setup.py
87
)
4688.1.1 by Numerigraphe - Lionel Sausin
[IMP] Added missing vim mode lines
88
89
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: