def _hacked_write_toplevel_names(cmd, basename, filename):
    pkgs = dict.fromkeys([_top_level_package(k) for k in cmd.distribution.
        iter_distribution_names() if _top_level_package(k) != 'twisted'])
cmd.write_file('top-level names', filename, '\n'.join(pkgs) + '\n')
egg_info.write_toplevel_names = _hacked_write_toplevel_names
setup(name='MyPackage', version='1.0', description=
    'You can do anything with MyPackage, anything at all.', url=
    'http://example.com/', author='John Doe', author_email=
    'jdoe@example.com', packages=['mypackage', 'twisted.plugins'])
How do I write a setup.py for a twistd/twisted plugin that works with setuptools, distribute, etc?