How to install Python modules needed by plugins?

John Arbash Meinel john at arbash-meinel.com
Wed Mar 9 09:09:46 UTC 2011


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 3/9/2011 10:08 AM, Alexander Belchenko wrote:
> Eli Zaretskii пишет:
>> Finally, I tried to add python-fastimport to lib/library.zip:
>>
>>   cd python-fastimport
>>   zip -r "C:\Program Files\Bazaar\lib\library.zip" fastimport
>>
>> And that worked!  So the conclusion of this seems to be:
>>
>>   To install an extra Python module on Windows for bzr installed with
>>   a stand-alone installer, add the Python module's main directory,
>>   with all the files in it, to library.zip.
>>
>> (Children, don't try that at home without backing up the original
>> library.zip first!)
> 
> Yep, that's what you need, though it's ugly and that's why I don't
> recommend go this way. bzr-fastimport should be patched to allow
> fastimport library installed into fastimport plugin directory, as we did
> in the past for qbzr plugin and pyqt/qt libs.
> 
> But patching every very plugin is not the best idea, because it requires
> extra work for windows maintainers. Maybe we just need to bundle
> everything and kitchen sink into standalone installer.
> 
> After almost 5 years of standalone installer went to the wild I'm still
> not sure what's the best.
> 

I think tweaking the standalone installer to include another path in the
default sys.path would be reasonable.

Something like:

C:\Program Files\Bazaar\site-packages

I don't know if it can easily be done as part of bzr-windows-installers.
But certainly we could put in 'bzr':

 if sys.frozen and sys.platform == 'windows':
   sys.path.append(os.path.join(os.path.dirname(sys.executable),
                                'site-packages'))

What do you think?

John
=:->
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk13Q9oACgkQJdeBCYSNAANz2gCfUXeNv6MJHbzNmFyjLSAEwNPc
1EcAmwdu0+EUe7X7jYEmHNHx2rt1LXet
=OZ7E
-----END PGP SIGNATURE-----



More information about the bazaar mailing list