Plugins in Trac 0.9

24 August 2005

We're planning to release a beta of Trac 0.9 any day now. Probably the most important enhancement - in my opinion - is the introduction of the plugin architecture (which I've blogged about before). That's subjective of course; others may find the improved ticket query interface, the support for PostgreSQL or the enhanced Subversion support more interesting. Or any of a huge number of other improvements and bug fixes.

This release has taken way too long, of course. It's almost a year now since we released version 0.8. We are hoping though that the introduction of the plugin architecture will allow for shorter release cycles in the future.

The Trac Web-Admin Plugin

Screenshot of plugin administrationOne example for this is the plugin for web-based administration, an often requested Feature. Trac currently only allows administration using the command-line tool trac-admin. This is okay if you have shell access (and skills), and pretty nice for automation. But project managers aren't always also skilled system administrators, so a web-based administration interface has been planned for a very long time.

Screenshot of permissions managementSo, the good news is that the development of such an interface has started a couple of weeks ago. But the exciting part is that this functionality is developed separately from the core system. This means that the release cycle is decoupled from that of the core, so that updates to the web-admin plugin can be released more frequently. Eventually, we might look into moving some of the core components into plugins, too.

Screenshot of ticket priority administrationThe plugin system is based on “Python Eggs”. If you want to provide a plugin, you have to use setuptools to package it as an egg. If you want to use plugins, you'll have to have setuptools installed to load the plugins.

Both Python Eggs and setuptools are a pretty exciting recent development in the Python landscape in my opinion, so let me send out a big “thank you” to Phillip J. Eby for his impressive work in this area.

What's Next (for Plugin Developers)

Python Eggs have gained support for “entry points”. We'll use that mechanism as soon as there's an official release of setuptools 0.6. Entry points would replace the current use of a trac_plugin.txt file in the egg metadata. Also, we'll probably remove support for plugins not packaged as eggs.

It's also important to note that the API for plugins cannot be considered stable right now. So if you develop a plugin for Trac 0.9, you can't expect it to run unmodified in Trac 0.10 or 1.0 (whatever the next release ends up being called). That's the privilege of having a version number below 1.0… and you wondered why so many projects never reach 1.0 ;-).

And if you're looking for plugins, Alec Thomas has set up a Trac Hacks, a site for sharing extensions and modifications to Trac. You can already find plugins for discussion forums and user account management there. And of course, my own project Bitten is also packaged as a plugin egg.