[Distutils] PEP439 and backward compat / easy_install / distlib

PJ Eby pje at telecommunity.com
Mon Mar 25 19:16:50 CET 2013


On Mon, Mar 25, 2013 at 1:23 PM, Daniel Holth <dholth at gmail.com> wrote:
> 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.

However, given that this problem exists now, and that this is strictly
a transitional feature, all you really need to do is make reasonably
similar choices to easy_install.

It might be worth looking at the actual stats, but my impression is
that most eggs on PyPI are either for Windows or aren't
platform-specific at all.

Also, as far as detecting the need for setuptools, I think that can be
done just by noticing whether the PKG-INFO included in an sdist is
metadata 2.0 or not.  If it is, then setuptools should be explicitly
declared as a build-time dependency, otherwise it's not needed.  If
it's an older metadata version, then you probably need setuptools.

If for political reasons you want to not provide setuptools even in
that case (since there are packages that don't use it), you could just
throw in an import hook that notices when you're trying to import
something from setuptools and handles the install.  But ISTM the
simplest case is just to look for (the absence of) 2.0 metadata.

(Of course, that kind of assumes that the 2.0 standard includes build
metadata and procedures, and that we know what a new-style sdist looks
like in this scheme.)


More information about the Distutils-SIG mailing list