[Distutils] Using Wheel with zipimport

Paul Moore p.f.moore at gmail.com
Wed Jan 29 12:59:58 CET 2014


On 29 January 2014 11:41, Donald Stufft <donald at stufft.io> wrote:
>
> On Jan 29, 2014, at 4:23 AM, Paul Moore <p.f.moore at gmail.com> wrote:
>
>> As I recall, it was in the original version of the PEP/spec and it was
>> always an intended feature. The wheel file for the wheel project
>> itself is (deliberately) runnable as a zip file, so that you can
>> bootstrap into the wheel world using the "wheel install" command.
>
> I just read every version of the PEP that has ever existed in Mercurial
> and no version besides Nick's most recent contains any text about
> the importability of Wheels besides that one of the differences of
> Wheel and Egg is that Wheel is an installation format and Egg is
> importable.

Apologies. It was something Daniel pointed out a few times very early
on - I hadn't realised it wasn't in the spec directly.

What is in the spec - which effectively constrains the format to
*allowing* (rather than encouraging) direct import - are the facts
that wheels are zip format, and that one of purelib/platlib is at the
root. The concept of separating "unpack" and "spread" and the comment
"Although a specialized installer is recommended, a wheel file may be
installed by simply unpacking into site-packages" doesn't leave any
room for wheels *not* to be importable in the majority of pure-python,
no package data, cases.

Debating how we present this in later versions of the wheel spec is
fine. But deliberately making wheels not importable would break
backward compatibility in a way that would have other, likely more
serious, implications.

Nevertheless, I understand your concerns, and I think we should be
very careful not to let people get the impression that this is in any
way similar to "importable eggs", which had a very bad press.

Paul


More information about the Distutils-SIG mailing list