<div dir="ltr"><div><div><div><div><div>Hi,<br><br><br></div>How are you supposed to write a setup.py that installs twistd plugins?<br><br></div>I have this piece of tribal knowledge:<br><br>----<br>from setuptools.command import egg_info<br>

<br>def _top_level(name):<br>    return name.split('.', 1)[0]<br><br>def _hacked_write_toplevel_names(cmd, basename, filename):<br>    names = map(_top_level, cmd.distribution.iter_distribution_names())<br>    pkgs = dict.fromkeys(set(names) - set(["twisted"]))<br>

    cmd.write_file("top-level names", filename, '\n'.join(pkgs) + '\n')<br><br>egg_info.write_toplevel_names = _hacked_write_toplevel_names<br>---<br><br></div>But I don't actually know what's actually required, and I don't actually know where this is documented (if at all). Plus, it looks pretty unsanitary, and appears to introduce a dependency to setuptools.<br>

<br></div>So, how am I supposed to do this?<br><br></div>Thanks in advance<br>lvh<br></div>