~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to setup.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2008-02-23 14:10:21 UTC
  • mfrom: (3193.7.12 plugins.for.bzr.exe)
  • Revision ID: pqm@pqm.ubuntu.com-20080223141021-zgxlzjmg5c0hym5n
(bialix) bzr.exe: move builtin plugins out of library.zip

Show diffs side-by-side

added added

removed removed

Lines of Context:
265
265
    setup(**ARGS)
266
266
 
267
267
elif 'py2exe' in sys.argv:
 
268
    import glob
268
269
    # py2exe setup
269
270
    import py2exe
270
271
 
292
293
                                     comments = META_INFO['description'],
293
294
                                    )
294
295
 
295
 
    additional_packages =  []
 
296
    packages = BZRLIB['packages']
 
297
    packages.remove('bzrlib')
 
298
    packages = [i for i in packages if not i.startswith('bzrlib.plugins')]
 
299
    includes = []
 
300
    for i in glob.glob('bzrlib\\*.py'):
 
301
        module = i[:-3].replace('\\', '.')
 
302
        if module.endswith('__init__'):
 
303
            module = module[:-len('__init__')]
 
304
        includes.append(module)
 
305
 
 
306
    additional_packages = set()
296
307
    if sys.version.startswith('2.4'):
297
308
        # adding elementtree package
298
 
        additional_packages.append('elementtree')
 
309
        additional_packages.add('elementtree')
299
310
    elif sys.version.startswith('2.5'):
300
 
        additional_packages.append('xml.etree')
 
311
        additional_packages.add('xml.etree')
301
312
    else:
302
313
        import warnings
303
314
        warnings.warn('Unknown Python version.\n'
304
315
                      'Please check setup.py script for compatibility.')
305
316
    # email package from std python library use lazy import,
306
317
    # so we need to explicitly add all package
307
 
    additional_packages.append('email')
 
318
    additional_packages.add('email')
308
319
 
309
320
    # text files for help topis
310
 
    import glob
311
321
    text_topics = glob.glob('bzrlib/help_topics/en/*.txt')
312
 
 
313
 
    options_list = {"py2exe": {"packages": BZRLIB['packages'] +
314
 
                                           additional_packages,
 
322
    topics_files = [('lib/help_topics/en', text_topics)]
 
323
 
 
324
    # built-in plugins
 
325
    plugins_files = []
 
326
    for root, dirs, files in os.walk('bzrlib/plugins'):
 
327
        x = []
 
328
        for i in files:
 
329
            if not i.endswith('.py'):
 
330
                continue
 
331
            if i == '__init__.py' and root == 'bzrlib/plugins':
 
332
                continue
 
333
            x.append(os.path.join(root, i))
 
334
        if x:
 
335
            target_dir = root[len('bzrlib/'):]  # install to 'plugins/...'
 
336
            plugins_files.append((target_dir, x))
 
337
    # find modules for built-in plugins
 
338
    import tools.package_mf
 
339
    mf = tools.package_mf.CustomModuleFinder()
 
340
    mf.run_package('bzrlib/plugins')
 
341
    packs, mods = mf.get_result()
 
342
    additional_packages.update(packs)
 
343
 
 
344
    options_list = {"py2exe": {"packages": packages + list(additional_packages),
 
345
                               "includes": includes + mods,
315
346
                               "excludes": ["Tkinter", "medusa", "tools"],
316
347
                               "dist_dir": "win32_bzr.exe",
317
348
                              },
321
352
                   'tools/win32/bzr_postinstall.py',
322
353
                  ],
323
354
          zipfile='lib/library.zip',
324
 
          data_files=[('lib/help_topics/en', text_topics)],
 
355
          data_files=topics_files + plugins_files,
325
356
          )
326
357
 
327
358
else: