[Distutils] PEP439 and backward compat / easy_install / distlib

Daniel Holth dholth at gmail.com
Mon Mar 25 18:23:47 CET 2013

On Mon, Mar 25, 2013 at 12:50 PM, Nick Coghlan <ncoghlan at gmail.com> wrote:
> On Mon, Mar 25, 2013 at 9:42 AM, Marcus Smith <qwcode at gmail.com> wrote:
>>> The *only* case this approach doesn't immediately cover is a project that:
>>> 1. Doesn't publish a pre-built wheel for the current platform (or egg,
>>> assuming pip gains support for those, perhaps by implicitly converting
>>> them to wheels)
>>> 2. Doesn't publish 2.0 metadata with "Setup-Requires-Dist: setuptools"
>>> 3. imports setuptools in its setup.py file
>> so that's most everything on pypi right now in the short and medium term.
>>> This can be handled in pip, by using the AST module to scan for
>>> setuptools imports in setup.py (or else by checking for a setuptools
>>> related ImportError after trying to run it).
>> so you're asking pip to get this working soon, right?  like before
>> python3.4, so this PEP can go in?
> Our messages crossed in flight - I realised I'm fine with assuming a
> setuptools dependency for eggs and all sdist's without 2.0+ metadata,
> it's only the idea of installing setuptools as a dependency of
> bootstrapping pip itself that I'm not happy with. That means pip only
> needs to support two configurations:
> 1. No setuptools, can only install from wheel files and sdists with
> 2.0+ metadata
> 2. Has setuptools, can also install from sdists with legacy metadata and eggs
> By default, installing setuptools when necessary should be automatic,
> but advanced users should be able to ask that it instead be treated as
> an error if no wheel is available to satisfy an installation request
> or dependency (so they don't inadvertently install setuptools on their
> production systems if they don't want to).
> To make this work, we'll need to get wheels published on PyPI for
> setuptools before 3.4, as well as ensuring pip doesn't require
> setuptools to install from wheel files.
> Cheers,
> Nick.

My vision for the setuptools deprecation process is that distutils
rides into the sunset with it. In this future eventually bugs in
setuptools will be solved by porting setup.py to one of (X, Y, Z)
which haven't necessarily been invented yet.

Like Marcus said, pip itself only uses pkg_resources which we can
bundle and eventually replace with a shim backed by distlib (Vinay has
tried this already). Only the individual distributions' "setup.py"
subprocesses (are forced to) import setuptools. The --only-wheel
option should be easy.

It is going to be problematic to try to find and download legacy eggs
correctly and automatically since they don't for example tell you
whether they are wide Unicode. Those problems and more would apply to
automatically downloading and converting bdist_wininst .exe installers
which aren't even named consistently.

More information about the Distutils-SIG mailing list