[Twisted-Python] Packaging a Twisted app as an Egg

Hi All, Apologies if this has been covered before. I am looking to package a twisted application that relies on twistd as an egg but I am concerned as to how twistd will be aware of the my package. How do I make twistd aware of my application if it is packaged as an egg? Is this possible? Do I just create my own stub to twistd that takes care of ensuring that twisted/plugins/myapp.py is in Python's path? Thanks a lot, Matt Matthew Glubb Technical Partner email: matthew.glubb@madebykite.com phone: 44 (0) 7715 754017 skype: mglubb Kite http://madebykite.com -- GPG: 96FF DE0E 0B7B 37F0 7F8D C54C E285 3D8F 5625 9244

On Apr 4, 2008, at 12:35 PM, Matthew Glubb wrote:
I'm not sure if this solves your problem (because I don't know why the twistd script doesn't already succeed at importing twisted from the egg), but one option is to use the setuptools "console scripts" hook. Get the Twisted 8 source code and apply the following patch. Then whenever you install this patched version of twisted, it will install a twistd that imports the associated version of Twisted, even from an egg. As an added bonus, it will make a twistd executable for the local platform, including Windows, although I haven't tested that behavior. Regards, Zooko Index: setup.py =================================================================== --- setup.py (revision 23203) +++ setup.py (working copy) @@ -86,6 +86,7 @@ setup_args['install_requires'] = requirements setup_args['include_package_data'] = True setup_args['zip_safe'] = False + setup_args['entry_points'] = { 'console_scripts': [ 'twistd = twisted.scripts.twistd:run' ] } setup(**setup_args)

On Apr 4, 2008, at 12:35 PM, Matthew Glubb wrote:
I'm not sure if this solves your problem (because I don't know why the twistd script doesn't already succeed at importing twisted from the egg), but one option is to use the setuptools "console scripts" hook. Get the Twisted 8 source code and apply the following patch. Then whenever you install this patched version of twisted, it will install a twistd that imports the associated version of Twisted, even from an egg. As an added bonus, it will make a twistd executable for the local platform, including Windows, although I haven't tested that behavior. Regards, Zooko Index: setup.py =================================================================== --- setup.py (revision 23203) +++ setup.py (working copy) @@ -86,6 +86,7 @@ setup_args['install_requires'] = requirements setup_args['include_package_data'] = True setup_args['zip_safe'] = False + setup_args['entry_points'] = { 'console_scripts': [ 'twistd = twisted.scripts.twistd:run' ] } setup(**setup_args)
participants (2)
-
Matthew Glubb
-
zooko