14

As a follow-up to How do I write a setup.py for a twistd/twisted plugin that works with setuptools, distribute, etc?, how does one make a debian package for a twisted plugin?

Assuming the setup.py is properly written, using cdbs/python-central/dh_python2 should just work, but I haven't had much luck so far.

The trick with those tools is that they basically run 'python setup.py install --root=' and then package up whatever ends up in '', so perhaps once the previous question is properly answered, then this question becomes moot?

Anyone here has successfully packaged a twisted plugin for debian?

Community
  • 1
  • 1
Sidnei
  • 531
  • 4
  • 8

2 Answers2

3

Apparently the issue is with 'python-support', which is plain broken when it comes to twisted plugins.

This message from Ubuntu's Matthias Klose explains the issue and offers a solution:

packaging of twisted plugins with python-support is broken by design. Even python policy mentions explicitly that you should use the same packaging helper for packages sharing the same python namespace.

You should use dh_python2 for that, or (deprecated) build with dh_pycentral using `include-links'.

-- Matthias Klose

Sidnei
  • 531
  • 4
  • 8
  • 2
    Your first sentence is somewhat misleading; python-support is only "plain broken when it comes to twisted plugins" because the Twisted packages use dh_python2, not because of some intrinsic shortcoming of python-support. More generally, if you are installing python modules into another package's namespace, you need to use the same packaging helper as that package uses, otherwise the files won't end up in the right place. – mithrandi Sep 03 '11 at 21:15
  • Is this true for Debian as well as Ubuntu? What versions of each? – Glyph Sep 04 '11 at 18:08
1

Argh, I've tried to do this and failed. I think it's possible depending on which Debian/Ubuntu releases you want to target, and how much effort you want to put in.

There are two approaches:

  1. Have your package stick the plugin file in twisted/plugins/ in the twisted tree. This is a pain because Twisted is packaged using different methods in different releases (python-support in Lucid vs dh_python2 in Natty IIRC) and (roughly speaking) your package needs to be packaged the same way as Twisted is to make this work.
  2. Have a twisted/plugins/ directory installed alongside your code. Then, IIRC, the problem becomes having the forest of symlinks that gets created include the twisted directory (as it's not a package).
Glyph
  • 31,152
  • 11
  • 87
  • 129
mwhudson
  • 131
  • 1
  • 8
  • I don't understand these options terribly well. Can you offer more technical details as to how one has a package "stick" the plugin file in "the twisted tree"? How does one know where the twisted tree is, given the different places that Twisted might be installed by different releases? – Glyph Sep 10 '11 at 06:03