Rant: Python Plugin Systems

A plugin system should allow plugin authors to install their plugins using distutils.

The One True Way(tm) for writing a plugin system is this:

Have a configuration file. In the configuration file name python modules. The system exposing the plugin interface then dynamicly imports the named modules. The modules then have the opportunity to plug themselves into provided hooks.

There is no other way.

If you are scanning for python files in a directory, you are doing it wrong. Why? Plugin authors have to write their own system installation code. Distutils won’t do it.

If you are scanning for modules in a package directory, you are even more wrong. Why? See previous.

If you disagree, you are wrongest. Why? Because. You are wrong.


Explore posts in the same categories: General

7 Comments on “Rant: Python Plugin Systems”

  1. Or, just use Ruby instead… then you can rant about gems instead :-)

  2. Andrew Says:

    Darrin, how do you go almost three months without writing and then write something and get 41 comments? Where did all those people come from? It seems they would have given up on your blog several months ago! Amazing!

  3. Heh. I submitted it to reddit.

  4. Jeff Licquia Says:

    I thought I felt my ears burning. :-)

  5. Smartpm does the same thing you did in picax.

  6. Kameron Says:

    What I want to do on my blog, is every few hours take the oldest post and move it to the
    front of the queue, all automatically. Anyone know if there is a plugin that can do this or
    a simple way to set up another plugin to do this (use my own feed perhaps)?

  7. Vance Freire Says:

    Arrogancy at its worst, just because it doesn’t follow one way of doing things doesn’t mean its wrong. Idiotic and juvenile to think so.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: