[Twisted-Python] sub options in twisted applications

glyph at divmod.com glyph at divmod.com
Tue Jun 13 10:36:21 EDT 2006

On Tue, 13 Jun 2006 06:52:16 -0200, Manlio Perillo <manlio_perillo at libero.it> wrote:
>glyph at divmod.com ha scritto:

>> Why is your application so special that it can't
>> be installed in the same place as every other python application?  Why
>> shouldn't the regular Python interpreter be able to 'import' your modules?

>Mailman, as an example, does not install itself in site-package...
>GNOME applications written in Python do not install in site-package (non
> 100% sure).

This is really a configuration decision that gets mixed up with an application's packaging.

Some GNOME applications do live in site-packages by default; for example, gnome-blog.  Some, like Quod Libet, are only in their own installation directory because they don't use their own namespace (and this is arguably a bug).  Some, like Straw, have no real reason.

Mailman puts itself into a non-site-packages directory because it wants to be able to install its own versions of the 'email' and 'codecs' packages, regardless of what other versions of those bits of software you have on your system.

Although I'm not a huge fan of the "egg" format as it stands, it does solve the particular problem of per-application version dependencies a bit better than these ad-hoc decisions made on behalf of each application in a platform-specific way.

On a platform like Debian where the package manager is verifying that your package versions match, the additional support is unnecessary unless you have applications which explicitly depend on different, incompatible versions of the same library.

In short: your application should at least be *able* to install itself in site-packages on systems where the package versions line up properly.  In the case where they don't, setting PYTHONPATH in a startup script is perfectly acceptable.

None of this, you'll notice, has anything to do with .tac files :).  If your application requires a particular version of Twisted, for example, the 'twistd' script which your startup script invokes will need to be specifically selected as well; you can't run whatever random twistd is on your PATH and then require a specific version of twistd in the .tac, so it's too late to start manipulating your sys.path there.

More information about the Twisted-Python mailing list