default plugin path

Robert Collins robertc at robertcollins.net
Tue Jan 27 03:04:07 GMT 2009


On Mon, 2009-01-26 at 21:43 -0500, Aaron Bentley wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Robert Collins wrote:
> >>> Any objections?
> >> I object.  I don't think that is the right setting.  I don't think there
> >> *is* a right setting that applies to all bzrlib clients.  Explicit
> >> better than implicit.  Resist the temptation to guess.
> > 
> > I've never needed to alter the path. And any client that wants a
> > specific path *can* alter it.
> 
> I have.  Both BundleBuggy and Launchpad have been bitten because bzrlib
> is loading plugins from the system location.
> 
> >> I don't think clients should have to undo these settings.  I don't see a
> >> need for this change, since you get the default path anyway if you call
> >> load_plugins.
> > 
> > I don't want to call load_plugins. I want to 'import
> > bzrlib.plugins.FOO'.
> 
> That's too much magic.
> 
> > That used to be - for a *long* time, so clearly not breaking bzrlib
> > clients::
> > import bzrlib.plugins.FOO
> > 
> > now it is
> > import bzrlib.plugin
> > bzrlib.plugin.set_plugins_path()
> > import bzrlib.plugins.FOO
> 
> No, it's
> import bzrlib.plugin
> bzrlib.plugin.load_plugins()

I *do not* want to load all plugins.

> > which is a dead chicken.
> 
> If you mean it's voodoo, I disagree.  It's reasonably easy to understand.

Its easy to understand but its replicating logic that in the common case
isn't needed.

> > What harmful effect will setting the path have?
> 
> It will cause bzrlib clients to load bzr plugins from the system path,
> which will be incompatible with their local version of bzrlib.

If I put a patch forward that doesn't spuriously add the system python
to the path (there is a bug in the path setting at the moment affecting
normal bzr as well as bzr clients), what harmful effects would setting
the path by default at module load have?

> Launchpad and Bundle Buggy have both been hit by bad default plugin
> paths, even though Launchpad tried to control the plugin path.

I know that - but I'm not proposing to *load plugins*, only to set the
path. And both can set it to whatever they like *anyway*.

-Rob
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20090127/11d3a8fd/attachment.pgp 


More information about the bazaar mailing list