~openerp/openobject-server/web-dashboard

« back to all changes in this revision

Viewing changes to setup.py

  • Committer: Stephane Wirtel
  • Date: 2010-10-18 22:01:04 UTC
  • Revision ID: stephane@openerp.com-20101018220104-8voqsqm6my8n10tr
[FIX] Update the setup.py to solve some problems

Show diffs side-by-side

added added

removed removed

Lines of Context:
26
26
#   adapted by Nicolas Évrard <nicoe@altern.org>
27
27
#
28
28
 
29
 
import imp
30
29
import sys
31
30
import os
32
31
from os.path import join, isfile, basename
33
32
import glob
34
33
 
35
 
from setuptools import setup, find_packages
 
34
from pprint import pprint as pp
 
35
 
 
36
from setuptools import setup as official_setup, find_packages
36
37
from setuptools.command.install import install
37
38
from distutils.sysconfig import get_python_lib
38
39
 
92
93
    '''Build list of data files to be installed'''
93
94
    files = []
94
95
    if os.name == 'nt':
95
 
        for root, _, names in os.walk(join('bin','addons')):
96
 
            files.append((root, [join(root, name) for name in names]))
 
96
        os.chdir('bin')
 
97
        for (dp, dn, names) in os.walk('addons'):
 
98
            files.append((dp, map(lambda x: join('bin', dp, x), names)))
 
99
        os.chdir('..')
 
100
        #for root, _, names in os.walk(join('bin','addons')):
 
101
        #    files.append((root, [join(root, name) for name in names]))
97
102
        for root, _, names in os.walk('doc'):
98
103
            files.append((root, [join(root, name) for name in names]))
99
 
        for root, _, names in os.walk('pixmaps'):
100
 
            files.append((root, [join(root, name) for name in names]))
 
104
        #for root, _, names in os.walk('pixmaps'):
 
105
        #    files.append((root, [join(root, name) for name in names]))
101
106
        files.append(('.', [join('bin', 'import_xml.rng'),
102
107
                            join('bin', 'server.pkey'),
103
108
                            join('bin', 'server.cert')]))
179
184
    }
180
185
}
181
186
 
 
187
def setup(**kwargs):
 
188
    #pp(kwargs)
 
189
    return official_setup(**kwargs)
 
190
 
182
191
setup(name             = name,
183
192
      version          = version,
184
193
      description      = description,
194
203
      },
195
204
      scripts          = ['openerp-server'],
196
205
      packages = [
197
 
          '.'.join(['openerp-server'] + package.split('.')[1:]) for package in find_packages()
 
206
          '.'.join(['openerp-server'] + package.split('.')[1:])
 
207
          for package in find_packages()
198
208
      ],
 
209
      include_package_data = True,
 
210
      package_data = {
 
211
          '': ['*.yml', '*.xml', '*.po', '*.pot', '*.csv'],
 
212
      },
199
213
      package_dir      = find_package_dirs(),
200
214
      console = [
201
215
          {
204
218
          }
205
219
      ],
206
220
      options = options,
207
 
      install_requires = ['lxml',
208
 
                          'mako',
209
 
                          'python-dateutil',
210
 
                          'psycopg2',
211
 
                          'pychart',
212
 
                          'pydot',
213
 
                          'pytz',
214
 
                          'reportlab',
215
 
                          'caldav',
216
 
                          'pyyaml',
217
 
                          'sqlalchemy',
218
 
                          'django',
219
 
                          'pywebdav'
220
 
                          'cx_Oracle',
221
 
                          'mysqldb',
222
 
                          'feedparser',
223
 
                          'bsddb3',
224
 
                          'egenix-mx-base'],
 
221
      install_requires = [
 
222
          'lxml',
 
223
          'mako',
 
224
          'python-dateutil',
 
225
          'psycopg2',
 
226
          'pychart',
 
227
          'pydot',
 
228
          'pytz',
 
229
          'reportlab',
 
230
          'caldav',
 
231
          'pyyaml',
 
232
          #'django',
 
233
          'pywebdav'
 
234
          #'cx_Oracle',
 
235
          #'mysqldb',
 
236
          'feedparser',
 
237
          #'bsddb3',
 
238
          'egenix-mx-base'
 
239
      ],
225
240
      extras_require={
226
241
          'SSL' : ['pyopenssl'],
227
242
      }
228
243
)
229
244
 
230
 
if has_py2exe:
231
 
  # Sometime between pytz-2008a and pytz-2008i common_timezones started to
232
 
  # include only names of zones with a corresponding data file in zoneinfo.
233
 
  # pytz installs the zoneinfo directory tree in the same directory
234
 
  # as the pytz/__init__.py file. These data files are loaded using
235
 
  # pkg_resources.resource_stream. py2exe does not copy this to library.zip so
236
 
  # resource_stream can't find the files and common_timezones is empty when
237
 
  # read in the py2exe executable.
238
 
  # This manually copies zoneinfo into the zip. See also
239
 
  # http://code.google.com/p/googletransitdatafeed/issues/detail?id=121
240
 
  import pytz
241
 
  import zipfile
242
 
  # Make sure the layout of pytz hasn't changed
243
 
  assert (pytz.__file__.endswith('__init__.pyc') or
244
 
          pytz.__file__.endswith('__init__.py')), pytz.__file__
245
 
  zoneinfo_dir = join(os.path.dirname(pytz.__file__), 'zoneinfo')
246
 
  # '..\\Lib\\pytz\\__init__.py' -> '..\\Lib'
247
 
  disk_basedir = os.path.dirname(os.path.dirname(pytz.__file__))
248
 
  zipfile_path = join(options['py2exe']['dist_dir'], 'library.zip')
249
 
  z = zipfile.ZipFile(zipfile_path, 'a')
250
 
  for absdir, directories, filenames in os.walk(zoneinfo_dir):
251
 
    assert absdir.startswith(disk_basedir), (absdir, disk_basedir)
252
 
    zip_dir = absdir[len(disk_basedir):]
253
 
    for f in filenames:
254
 
      z.write(join(absdir, f), join(zip_dir, f))
255
 
  z.close()
256