[Twisted-Python] How to configure setup.py for a twistd TAP app

Jean-Paul Calderone exarkun at divmod.com
Thu Dec 20 07:30:11 MST 2007


On Thu, 20 Dec 2007 18:23:44 +1100, Chris Miles <miles.chris at gmail.com> wrote:
>
> [snip]
>
>Thanks Jean-Paul, that worked great, with both distutils.core.setup  and 
>twisted.python.dist.setup.  When I used the latter I didn't need  to 
>regenerate the plugin cache, twistd picked up the new command  immediately 
>after install.  Is this the advantage of  twisted.python.dist.setup ?

Not quite.  twisted.python.dist is an internal module, not part of Twisted's
public API.  Notice this line in its docstring:

    API Stability: Unstable. Don't use it outside of Twisted.

>
>The technique also (mostly) worked using setuptools.setup.  twistd  picks up 
>the new command, but spits out a UserWarning due to the  appearance of the 
>duplicate twisted package within the egg directory.
>
>/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site- 
>packages/zope.interface-3.3.0.1-py2.4-macosx-10.3-fat.egg/zope/ 
>__init__.py:3: UserWarning: Module twisted was already imported from / 
>Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site- 
>packages/twisted/__init__.pyc, but /Library/Frameworks/ 
>Python.framework/Versions/2.4/lib/python2.4/site-packages/ 
>myproject-0.0.0-py2.4.egg is being added to sys.path
>   import pkg_resources
>Usage: twistd [options]
>...
>
>I'd like to use setuptools, if possible, due to my project's  dependencies 
>on other setuptools-managed packages, but I can live  without it if it's not 
>fully compatible with Twisted application  plugins.

I'm not really sure what the above warning signifies, whether it indicates
a real problem, or what would be necessary to fix it if so.  I know that
setuptools does a number of things which aren't compatible with distutils
and the assumptions of Twisted, though.

Jean-Paul




More information about the Twisted-Python mailing list