/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to setup.py

  • Committer: Aaron Bentley
  • Date: 2008-02-24 16:42:13 UTC
  • mfrom: (3234 +trunk)
  • mto: This revision was merged to the branch mainline in revision 3235.
  • Revision ID: aaron@aaronbentley.com-20080224164213-eza1lzru5bwuwmmj
Merge with bzr.dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
237
237
        for root, dirs, files in os.walk('doc'):
238
238
            r = []
239
239
            for f in files:
240
 
                if os.path.splitext(f)[1] in ('.html','.css','.png','.pdf'):
 
240
                if (os.path.splitext(f)[1] in ('.html','.css','.png','.pdf')
 
241
                    or f == 'quick-start-summary.svg'):
241
242
                    r.append(os.path.join(root, f))
242
243
            if r:
243
244
                relative = root[4:]
264
265
    setup(**ARGS)
265
266
 
266
267
elif 'py2exe' in sys.argv:
 
268
    import glob
267
269
    # py2exe setup
268
270
    import py2exe
269
271
 
291
293
                                     comments = META_INFO['description'],
292
294
                                    )
293
295
 
294
 
    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()
295
307
    if sys.version.startswith('2.4'):
296
308
        # adding elementtree package
297
 
        additional_packages.append('elementtree')
 
309
        additional_packages.add('elementtree')
298
310
    elif sys.version.startswith('2.5'):
299
 
        additional_packages.append('xml.etree')
 
311
        additional_packages.add('xml.etree')
300
312
    else:
301
313
        import warnings
302
314
        warnings.warn('Unknown Python version.\n'
303
315
                      'Please check setup.py script for compatibility.')
304
316
    # email package from std python library use lazy import,
305
317
    # so we need to explicitly add all package
306
 
    additional_packages.append('email')
 
318
    additional_packages.add('email')
307
319
 
308
320
    # text files for help topis
309
 
    import glob
310
321
    text_topics = glob.glob('bzrlib/help_topics/en/*.txt')
311
 
 
312
 
    options_list = {"py2exe": {"packages": BZRLIB['packages'] +
313
 
                                           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,
314
346
                               "excludes": ["Tkinter", "medusa", "tools"],
315
347
                               "dist_dir": "win32_bzr.exe",
316
348
                              },
320
352
                   'tools/win32/bzr_postinstall.py',
321
353
                  ],
322
354
          zipfile='lib/library.zip',
323
 
          data_files=[('lib/help_topics/en', text_topics)],
 
355
          data_files=topics_files + plugins_files,
324
356
          )
325
357
 
326
358
else: