[Distutils] Importable wheels using distlib/distil

Jim Fulton jim at zope.com
Wed Mar 27 22:06:38 CET 2013


On Wed, Mar 27, 2013 at 4:50 PM, Vinay Sajip <vinay_sajip at yahoo.co.uk> wrote:
> Jim Fulton <jim <at> zope.com> writes:
>
>> It's a trap!
>>
>> At least on Unix systems:
>>
>> - Extensions in zip files that get magically extracted to a user's
>>   home directory lead to tragic deployment failures for services that
>>   run as special users.
>
> I can see how it would lead to problems, but the home directory location is
> just as a proof of concept - the cache doesn't need to be in any private place.

Anywhere you extract them is likely going to lead to access control
or security issues and generally cause pain, IMO.

>
>> - Zip files are a pain in the ass during development or debugging.
>
> Of course, but wheels are for deployment, not development, and this is one
> possibility for deployment (several people have mentioned wanting to sometimes
> just add wheels to sys.path rather than installing them, which got me thinking
> about this functionality).

I expect to use wheels during development just like I use eggs
now. Not for development of the wheel/egg, but for development of
something that uses it. You're in pdb and you land in a zipped
egg/wheel that the package under development invoked and now
you're screwed.

>
>> - Zip files are slower to import from (at least in my experience)
>
> It's just another option for a user of wheels. Caveat emptor, and all that.

It's been tried with eggs. This is not new ground. Encouraging
people to do this is going to cause pain and resentment.

I think one of the reasons there's so much (IMO mostly irrational)
hate for eggs is that people think you can only used zipped eggs,
and zipped eggs cause pain and agony.

>
>> It would be far better IMO to just unzip the wheel and put that in
>> your path.  (I'm hoping that wheels used this way are a suitable
>> replacement for eggs.)
>
> Well that's tantamount to installing the wheel,

Not really. If you just unzip the wheel and add it to your path,
you can stop using it by just removing from your path. If you
install the wheel, it's contents will be poured into site-packages
(and other places).    It's much heavier than just adding the
wheel (zipped or unzipped) to your path.

> which is fine. I was thinking
> along the line of egg replacement

Me too.

> - AFAIK eggs allow you to import extensions
> from zip in a similar fashion.

Importing from zipped eggs has proved itself to be an
anti pattern.

Buildout (as of buildout 2) always unzips eggs. It can
then generate scripts with just the packages they need
by adding (unzipped) eggs to sys.path.  Various plugin
systems (including buildout itself with extensions and recipes)
do this dynamically at run time. It's very useful.

Jim

-- 
Jim Fulton
http://www.linkedin.com/in/jimfulton


More information about the Distutils-SIG mailing list