~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to setup.py

  • Committer: Alexander Belchenko
  • Date: 2008-02-06 14:39:31 UTC
  • mto: This revision was merged to the branch mainline in revision 3231.
  • Revision ID: bialix@ukr.net-20080206143931-d6opyuqsg4tvxd7q
custom module finder to find additional dependencies for built-in plugins (to bundle additional packages and modules into bzr.exe's library.zip)

Show diffs side-by-side

added added

removed removed

Lines of Context:
302
302
            module = 'bzrlib'
303
303
        includes.append(module)
304
304
 
305
 
    additional_packages =  []
 
305
    additional_packages = set()
306
306
    if sys.version.startswith('2.4'):
307
307
        # adding elementtree package
308
 
        additional_packages.append('elementtree')
 
308
        additional_packages.add('elementtree')
309
309
    elif sys.version.startswith('2.5'):
310
 
        additional_packages.append('xml.etree')
 
310
        additional_packages.add('xml.etree')
311
311
    else:
312
312
        import warnings
313
313
        warnings.warn('Unknown Python version.\n'
314
314
                      'Please check setup.py script for compatibility.')
315
315
    # email package from std python library use lazy import,
316
316
    # so we need to explicitly add all package
317
 
    additional_packages.append('email')
 
317
    additional_packages.add('email')
318
318
 
319
319
    # text files for help topis
320
320
    text_topics = glob.glob('bzrlib/help_topics/en/*.txt')
331
331
                continue
332
332
            x.append(os.path.join(root, i))
333
333
        if x:
334
 
            target_dir = root[len('bzrlib/'):]
 
334
            target_dir = root[len('bzrlib/'):]  # install to 'plugins/...'
335
335
            plugins_files.append((target_dir, x))
 
336
    # find modules for built-in plugins
 
337
    import tools.package_mf
 
338
    mf = tools.package_mf.CustomModuleFinder()
 
339
    mf.run_package('bzrlib/plugins')
 
340
    packs, mods = mf.get_result()
 
341
    additional_packages.update(packs)
336
342
 
337
 
    options_list = {"py2exe": {"packages": packages + additional_packages,
338
 
                               "includes": includes,
 
343
    options_list = {"py2exe": {"packages": packages + list(additional_packages),
 
344
                               "includes": includes + mods,
339
345
                               "excludes": ["Tkinter", "medusa", "tools"],
340
346
                               "dist_dir": "win32_bzr.exe",
341
347
                              },