[Distutils] Multi-version import support for wheel files

Antoine Pitrou antoine at python.org
Mon Aug 26 16:44:29 CEST 2013


PJ Eby <pje <at> telecommunity.com> writes:
> 
> That is all easy_install does: add a naming convention for the
> directories, and automate the sys.path manipulation.
> 
> Buildout does the same thing, it just writes the sys.path manipulation
> into the scripts statically, instead of using pkg_resources at
> runtime.
> 
> So the notion of "cost" doesn't make any sense.  Tools like
> easy_install and buildout *reduce* the management cost, they don't add
> anything to core Python.
> 
> (Now, if you're talking about the .pth files from easy_install, those
> are something that I added because people complained about having to
> use require(), and wanted to have a default version available in the
> interpreter.)

Pre-3.3, there is a non-negligible runtime cost per sys.path entry, because
each import tries importing multiple filenames for each sys.path entry.
Post-3.3, things should be better (thanks to the directory contents cache),
but there's still a computational overhead for each sys.path entry.

So, yes, easy_install adding sys.path entries *by default* using .pth files
is clearly not costless.  pip doesn't have this problem AFAIK (it doesn't create
.pth files).

Regards

Antoine.




More information about the Distutils-SIG mailing list