[Distutils] How to handle launcher script importability?

Donald Stufft donald at stufft.io
Wed Aug 21 06:17:25 CEST 2013


On Aug 20, 2013, at 8:57 PM, Vinay Sajip <vinay_sajip at yahoo.co.uk> wrote:

> Thomas Heller <theller <at> ctypes.org> writes:
> 
>> Ok, now I understand.  But the zipfile could contain a loader-module
>> for each extension which does something like this (this example extracts
>> and loads 'bz2.pyd'):
> 
> In distlib, I've built on top of the zipfile support to allow C extensions
> to be available. Ordinary zipfiles contain no metadata indicating the
> extensions available, but wheels built with distil do. The wheel handling
> code in distlib takes advantage of this. The Wheel.mount() API [1] takes
> care of this (adding the wheel to sys.path, extracting the extensions to a
> user-specific directory and using an import hook to call imp.load_dynamic
> when required, so that both Python modules and extensions are available for
> import). It seems to work, though when I introduced the Wheel.mount() API I
> was told that it was very dangerous, and the sky would fall, or something :-)
> 
> Regards,
> 
> Vinay Sajip
> 
> [1] http://distlib.readthedocs.org/en/latest/tutorial.html#mounting-wheels
> 
> 
> _______________________________________________
> Distutils-SIG maillist  -  Distutils-SIG at python.org
> http://mail.python.org/mailman/listinfo/distutils-sig

Mounting Wheels seems like a bad idea, it was one of the things Daniel
explicitly removed (since Wheels are basically cleaned up eggs). Adding
it back in ex post facto seems like it's an idea that's going down the wrong
track.

If Wheels are to be importable it should be enshrined in the PEP not an
adhoc feature of one possible implementation.

-----------------
Donald Stufft
PGP: 0x6E3CBCE93372DCFA // 7C6B 7C5D 5E2B 6356 A926 F04F 6E3C BCE9 3372 DCFA

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://mail.python.org/pipermail/distutils-sig/attachments/20130821/ac89d469/attachment.sig>


More information about the Distutils-SIG mailing list