/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: Breezy landing bot
  • Author(s): Jelmer Vernooij
  • Date: 2018-11-16 19:38:57 UTC
  • mfrom: (7143.16.21 even-more-cleanups)
  • Revision ID: breezy.the.bot@gmail.com-20181116193857-bs5oma2655sp55qu
Fix another dozen flake8 errors.

Merged from https://code.launchpad.net/~jelmer/brz/even-more-cleanups/+merge/358931

Show diffs side-by-side

added added

removed removed

Lines of Context:
75
75
# that are part of BREEZY here.
76
76
BREEZY = {}
77
77
 
78
 
PKG_DATA = {# install files from selftest suite
79
 
            'package_data': {'breezy': ['doc/api/*.txt',
80
 
                                        'tests/test_patches_data/*',
81
 
                                        'help_topics/en/*.txt',
82
 
                                        'tests/ssl_certs/ca.crt',
83
 
                                        'tests/ssl_certs/server_without_pass.key',
84
 
                                        'tests/ssl_certs/server_with_pass.key',
85
 
                                        'tests/ssl_certs/server.crt',
86
 
                                       ]},
87
 
           }
 
78
PKG_DATA = {
 
79
    # install files from selftest suite
 
80
    'package_data': {'breezy': ['doc/api/*.txt',
 
81
                                'tests/test_patches_data/*',
 
82
                                'help_topics/en/*.txt',
 
83
                                'tests/ssl_certs/ca.crt',
 
84
                                'tests/ssl_certs/server_without_pass.key',
 
85
                                'tests/ssl_certs/server_with_pass.key',
 
86
                                'tests/ssl_certs/server.crt',
 
87
                                ]},
 
88
    }
88
89
I18N_FILES = []
89
90
for filepath in glob.glob("breezy/locale/*/LC_MESSAGES/*.mo"):
90
91
    langfile = filepath[len("breezy/locale/"):]
106
107
            if not package_path:
107
108
                package_name = 'breezy'
108
109
            else:
109
 
                package_name = ('breezy.' +
110
 
                            package_path.replace('/', '.').replace('\\', '.'))
 
110
                package_name = (
 
111
                    'breezy.' +
 
112
                    package_path.replace('/', '.').replace('\\', '.'))
111
113
            packages.append(package_name)
112
114
    return sorted(packages)
113
115
 
170
172
    """
171
173
 
172
174
    sub_commands = build.sub_commands + [
173
 
            ('build_mo', lambda _: True),
174
 
            ]
 
175
        ('build_mo', lambda _: True),
 
176
        ]
175
177
 
176
178
    def run(self):
177
179
        build.run(self)
290
292
            source = [c_name]
291
293
    source.extend(extra_source)
292
294
    include_dirs = ['breezy']
293
 
    ext_modules.append(Extension(module_name, source,
294
 
        define_macros=define_macros, libraries=libraries,
295
 
        include_dirs=include_dirs))
 
295
    ext_modules.append(
 
296
        Extension(
 
297
            module_name, source, define_macros=define_macros,
 
298
            libraries=libraries, include_dirs=include_dirs))
296
299
 
297
300
 
298
301
add_cython_extension('breezy._simple_set_pyx')
302
305
add_cython_extension('breezy._bencode_pyx')
303
306
add_cython_extension('breezy._chunks_to_lines_pyx')
304
307
add_cython_extension('breezy.bzr._groupcompress_pyx',
305
 
                    extra_source=['breezy/bzr/diff-delta.c'])
 
308
                     extra_source=['breezy/bzr/diff-delta.c'])
306
309
add_cython_extension('breezy.bzr._knit_load_data_pyx')
307
310
add_cython_extension('breezy._known_graph_pyx')
308
311
add_cython_extension('breezy._rio_pyx')
309
312
if sys.platform == 'win32':
310
313
    add_cython_extension('breezy.bzr._dirstate_helpers_pyx',
311
 
                        libraries=['Ws2_32'])
 
314
                         libraries=['Ws2_32'])
312
315
    add_cython_extension('breezy._walkdirs_win32')
313
316
else:
314
317
    add_cython_extension('breezy.bzr._dirstate_helpers_pyx')
358
361
    # First always brz's icon and its in the root of the brz tree.
359
362
    icos.append(('', 'brz.ico'))
360
363
    for root, dirs, files in os.walk(ico_root):
361
 
        icos.extend([(ico_root, os.path.join(root, f)[len(ico_root)+1:])
 
364
        icos.extend([(ico_root, os.path.join(root, f)[len(ico_root) + 1:])
362
365
                     for f in files if f.endswith('.ico')])
363
366
    # allocate an icon ID for each file and the full path to the ico
364
367
    icon_resources = [(rid, os.path.join(ico_dir, ico_name))
371
374
                 for rid, (_, f) in enumerate(icos)]
372
375
    ico_map = dict(map_items)
373
376
    # Create a new resource type of 'ICON_MAP', and use ID=1
374
 
    other_resources = [ ("ICON_MAP", 1, pickle.dumps(ico_map))]
 
377
    other_resources = [("ICON_MAP", 1, pickle.dumps(ico_map))]
375
378
 
376
379
    excludes.extend("""pywin pywin.dialogs pywin.dialogs.list
377
380
                       win32ui crawler.Crawler""".split())
387
390
 
388
391
    # Make a windows version which is the same except for the base name.
389
392
    tbzrcachew = tbzrcache.copy()
390
 
    tbzrcachew["dest_base"]="tbzrcachew"
 
393
    tbzrcachew["dest_base"] = "tbzrcachew"
391
394
    gui_targets.append(tbzrcachew)
392
395
 
393
396
    # ditto for the tbzrcommand tool
398
401
    )
399
402
    console_targets.append(tbzrcommand)
400
403
    tbzrcommandw = tbzrcommand.copy()
401
 
    tbzrcommandw["dest_base"]="tbzrcommandw"
 
404
    tbzrcommandw["dest_base"] = "tbzrcommandw"
402
405
    gui_targets.append(tbzrcommandw)
403
 
    
 
406
 
404
407
    # A utility to see python output from both C++ and Python based shell
405
408
    # extensions
406
409
    tracer = dict(script=os.path.join(tbzr_root, "scripts", "tbzrtrace.py"))
484
487
        for root, dirs, files in os.walk('doc'):
485
488
            r = []
486
489
            for f in files:
487
 
                if (os.path.splitext(f)[1] in ('.html','.css','.png','.pdf')
488
 
                    or f == 'quick-start-summary.svg'):
 
490
                if (os.path.splitext(f)[1] in ('.html', '.css', '.png', '.pdf')
 
491
                        or f == 'quick-start-summary.svg'):
489
492
                    r.append(os.path.join(root, f))
490
493
            if r:
491
494
                relative = root[4:]
497
500
        return docs
498
501
 
499
502
    # python's distutils-based win32 installer
500
 
    ARGS = {'scripts': [ 'brz', 'tools/win32/brz-win32-bdist-postinstall.py'],
 
503
    ARGS = {'scripts': ['brz', 'tools/win32/brz-win32-bdist-postinstall.py'],
501
504
            'ext_modules': ext_modules,
502
505
            # help pages
503
506
            'data_files': find_docs(),
504
507
            # for building cython extensions
505
508
            'cmdclass': command_classes,
506
 
           }
 
509
            }
507
510
 
508
511
    ARGS.update(META_INFO)
509
512
    ARGS.update(BREEZY)
560
563
 
561
564
    target = py2exe.build_exe.Target(script = "brz",
562
565
                                     dest_base = "brz",
563
 
                                     icon_resources = [(0,'brz.ico')],
 
566
                                     icon_resources = [(0, 'brz.ico')],
564
567
                                     name = META_INFO['name'],
565
568
                                     version = version_str,
566
569
                                     description = META_INFO['description'],
568
571
                                     copyright = "(c) Canonical Ltd, 2005-2010",
569
572
                                     company_name = "Canonical Ltd.",
570
573
                                     comments = META_INFO['description'],
571
 
                                    )
 
574
                                     )
572
575
    gui_target = copy.copy(target)
573
576
    gui_target.dest_base = "bzrw"
574
577
 
697
700
        # at build time.  Also to stdout so it appears in the log
698
701
        for f in (sys.stderr, sys.stdout):
699
702
            f.write("Skipping TBZR binaries - "
700
 
                "please set TBZR to a directory to enable\n")
 
703
                    "please set TBZR to a directory to enable\n")
701
704
 
702
705
    # MSWSOCK.dll is a system-specific library, which py2exe accidentally pulls
703
706
    # in on Vista.
713
716
                               "dist_dir": "win32_bzr.exe",
714
717
                               "optimize": 2,
715
718
                               "custom_boot_script":
716
 
                                        "tools/win32/py2exe_boot_common.py",
717
 
                              },
718
 
                   }
 
719
                                   "tools/win32/py2exe_boot_common.py",
 
720
                               },
 
721
                    }
719
722
 
720
723
    # We want the libaray.zip to have optimize = 2, but the exe to have
721
724
    # optimize = 1, so that .py files that get compilied at run time
756
759
            'data_files': DATA_FILES,
757
760
            'cmdclass': command_classes,
758
761
            'ext_modules': ext_modules,
759
 
           }
 
762
            }
760
763
 
761
764
    ARGS.update(META_INFO)
762
765
    ARGS.update(BREEZY)