[Distutils] PEP 439 and pip bootstrap updated

Paul Moore p.f.moore at gmail.com
Thu Jul 11 15:33:16 CEST 2013

On 11 July 2013 13:49, Brett Cannon <brett at python.org> wrote:

> The dead-simple, extremely elegant solution (starting in Python 3.4) is to
> make pip a namespace package in the stdlib with nothing more than a
> __main__.py file that installs pip; no checking if it's installed and then
> running it, etc, just blindly install pip. Then, if you install pip as a
> regular package, it takes precedence and what's in the stdlib is completely
> ignored (this helps with any possible staleness with the stdlib's bootstrap
> script vs. what's in pip, etc.). You don't even need to change the
> __main__.py in pip as it stands today since namespace packages only work if
> no regular package is found.

Wow - that is exceptionally cool. I had never realised namespace packages
would work like this.

> This also means pip3 literally becomes ``import runpy;
> runpy.run_module('pip')``, so that is even easier to maintain (assuming
> pip's bin/ stub isn't already doing that because of backwards-compatibility
> concerns or something with __main__.py or runpy not existing far enough
> back, otherwise it should =).

The pip executable script/wrapper currently uses setuptools entry points
and wrapper scripts. I'm not a fan of those, so I'd be happy to see the
change you suggest, but OTOH they have been like that since long before I
was involved with pip, and I have no idea if there are reasons they need to
stay that way.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/distutils-sig/attachments/20130711/da7ee547/attachment.html>

More information about the Distutils-SIG mailing list