[Distutils] Using Wheel with zipimport

Donald Stufft donald at stufft.io
Wed Jan 29 00:14:08 CET 2014


I noticed yesterday that Nick made a commit to PEP427 that Wheels were designed
to be compatible with zipimport so that you could directly add them to
sys.path (http://hg.python.org/peps/rev/811e34eda04c). I was not aware that
this was the case, and had thought otherwise, and have been telling people that
although Wheels could technically be used that way that doing so was considered
unsupported.

I think we need to reconsider this. I cannot stress how badly an idea I think
it is for Wheels to concern itself with the ability to add the Wheel to
sys.path and import it. One of the major problems with Egg was that it confused
the difference between a distribution format and a runtime installation format.
I believe that if we have this as a supported option, that ultimately it will
lead towards the same kind of problems that Egg had trying to fulfill two roles
at once.

Further more it won't even work accurately for all Wheels (as Nick's edit says)
so we require that people wanting to do this figure out if their Wheel can or
can not be added to the sys.path (which isn't as simple as looking at the tags
because a platform specific Wheel may only contain optional C modules).

If a single file importable item for a project is something that end users
want, then an additional format should be developed that does not concern
itself with the ability to unpack and install the project and instead solves
the problems that come with trying to stick arbitrary things in a zipped file
and import them.

So yea, I think that the goals of an importable format and an distribution
format are not completely overlapped, and if Wheel tries to be both, then both
sides of that will suffer with a less useful and less suitable 

-----------------
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/20140128/711a043b/attachment.sig>


More information about the Distutils-SIG mailing list