On 17 Dec, 2012, at 23:29, Ned Deily <[email protected]> wrote:
> In article
> <CALGmxELrdvrMnQ0HnQnogu3d-6g3CPsXUsbkp=en1uufxxf...@mail.gmail.com>,
> Chris Barker - NOAA Federal <[email protected]> wrote:
>>>
>
>> It seems binary egg installation should be pretty easy, and it doesn't
>> look like the pip folks are opposed to the idea, so maybe we could add
>> that to pip, if distribute builds them properly anyway.
>
> It's not trivially easy or it probably would have been done before.
> IIRC, Setuptools/Distribute has to do some behind the scenes
> platform-specific tricks to ensure that dynamic loads of the extension
> modules work, certainly for zipped binary eggs.
AFAIK It doesn't use platform-specific tricks, but always the same one: a
binary egg with an extension contains both the C shared library for the
extension ("sqlite.so") and a python loader with the same name ("sqlite.py").
The loader will extract the extension from the binary egg into a temporary
directory (using the pkg_resources API) and then uses the imp module to
actually load the extension.
Py2exe contains a DLL loader that can load extensions directly from a zipfile,
but as far as I know setuptools doesn't do that.
> To a large extent, it's
> the tricks that setuptools uses (this and the manipulation of sys.path)
> to support various use cases that has given setuptools/Distribute a bad
> rep. pip makes some important simplifying assumptions; not supporting
> binary eggs is one of them.
Supporting binary eggs for installation should be fairly easy, as you basicly
just have to unzip them and move the the EGG-INFO to the right location. You'd
end up with a directory that contains both .so files for extensions and .py
files for the loader that's needed to load the extension from an egg file but
that additional python file is harmless due to the search order of __import__:
when a directory contains both an extension and a python file for the same
module __import__ uses the extension.
Ronald
>
> --
> Ned Deily,
> [email protected]
>
> _______________________________________________
> Pythonmac-SIG maillist - [email protected]
> http://mail.python.org/mailman/listinfo/pythonmac-sig
> unsubscribe: http://mail.python.org/mailman/options/Pythonmac-SIG
_______________________________________________
Pythonmac-SIG maillist - [email protected]
http://mail.python.org/mailman/listinfo/pythonmac-sig
unsubscribe: http://mail.python.org/mailman/options/Pythonmac-SIG