[Twisted-Python] distutils and twisted

Steve Waterbury waterbug at beeblebrox.gsfc.nasa.gov
Wed Nov 6 10:21:47 EST 2002

Alexandre Fayolle wrote:

> What's the prefered way to use distutils to package a twisted plugin.
> The key question being, how do you install the plugins.tml file ? Is
> there any distutils extensions available ?

At last, a question I can answer!  (I'm a Twisted application 
developer, not a Twisted guru ... :^)  

Put your plugins.tml into the top dir of your application, e.g.:

     /plugins.tml    <---

... and make sure that myapp is in your PYTHONPATH.  
Then if your plugins.tml looks something like this:

register("Myapp Tap Builder",
         description="""My Application""",

... then mktap will create a myapp.tap file in the 
dir where you run it.  

For your setup.py, something like this should work 
(note data_files ... :^):

from distutils.core import setup

setup (name = "My Application",
       version = "0.0",
       description = "Blah blah",
       author = "Moi",
       author_email = "moi at world",
       maintainer = "admin",
       maintainer_email = 'admin at here',
       url = "http://spam.world/eggs",
       licence = "MIT",
       long_description = """\
My application does NOT suck!""",
       packages = ['myapp', 
       data_files = [('lib/python2.2/site-packages/myapp', ['myapp/plugins.tml'])

-- Steve.

More information about the Twisted-Python mailing list