[merge] look for plugins in arch-independent site directory (was Re: Bundling more plugins into bzrtools)
Robert Collins
robertc at robertcollins.net
Fri Feb 15 07:17:48 GMT 2008
On Thu, 2008-02-14 at 22:08 -0800, Toshio Kuratomi wrote:
> Martin Pool wrote:
> >> > But
> >> > better would be a fairly trivial patch to bzrlib.plugin to
> >> > add /usr/lib/pythonX.Y/site-packages/bzrlib/plugins to the default
> >> > path.
> >> >
> >>
> >>
> >> Excellent! Patch against 1.2rc1 and tested with bzr-1.1 attached.
> >
> > bb:tweak
> >
> > Please be consistent with the rest of that file and don't use
> > camelCaps variables.
> >
> Done. Patch attached.
>
> > Will distutils always be available? istr that it was previously only
> > available in the python-dev package. But on Hardy it is in python2.4
> > and 2.5.
> >
> > Actually maybe it was just that setup.py often wanted to read
> > something from python-dev. Either way, we should check this is true
> > on other OSs, or guard the import statement.
>
> I can tell you that it is part of the main python package in Fedora. I
> can also tell you that on Fedora using setup.py without python-devel
> doesn't work because python uses a Makefile as a source of data for the
> install command. (Test that by running: python
> /usr/lib/python2.5/distutils/tests/test_install.py )
>
> But that problem doesn't interfere with
> distutils.sysconfig.get_python_lib() so I don't know if there's a
> different problem in Ubuntu/Debian or if you're thinking that this
> problem has a wider scope than it does.
I'm pretty sure distutils isn't always installed in some places
so I suggest:
@@ -105,6 +107,10 @@ def set_plugins_path():
path = map(_strip_trailing_sep, path)
# search the plugin path before the bzrlib installed dir
path.append(os.path.dirname(_mod_plugins.__file__))
+ # search the arch independent path if we can determine it
+ try:
+ from distutils.sysconfig import get_python_lib
+ archless_path = osutils.pathjoin(get_python_lib(), 'bzrlib',
+ 'plugins')
+ if archless_path not in path:
+ path.append(archless_path)
_mod_plugins.__path__ = path
Or, alternatively, calculate the right path during setup.py's execution.
-Rob
--
GPG key available at: <http://www.robertcollins.net/keys.txt>.
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20080215/9e2e10f0/attachment.pgp
More information about the bazaar
mailing list