[Distutils] PEP439 and backward compat / easy_install / distlib

Daniel Holth dholth at gmail.com
Tue Mar 26 13:27:17 CET 2013

On Mar 26, 2013 7:26 AM, "Ronald Oussoren" <ronaldoussoren at mac.com> wrote:
> On 26 Mar, 2013, at 12:06, Daniel Holth <dholth at gmail.com> wrote:
> >
> > On Mar 26, 2013 5:28 AM, "Ronald Oussoren" <ronaldoussoren at mac.com>
> > >
> > >
> > > On 25 Mar, 2013, at 19:16, PJ Eby <pje at telecommunity.com> wrote:
> > > >
> > > >
> > > > Also, as far as detecting the need for setuptools, I think that can
> > > > 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.
> > >
> > > Is it even necessary to automaticly install setuptools?
Setuptools-using package are supposed to use  ez_setup.py, or
distribute_setup.py for distribute, to ensure that the setuptools package
is available during setup.  Although I must admit that I have no idea how
many packages still do this instead of assuming that users will have
installed setuptools anyway.
> > >
> > > Ronald
> > >
> >
> > We really really really want to get rid of ez_setup. It is considered
by many to be the example of something that should not happen as a side
effect of running a build script.
> That can't be helped with the current tool versions, distutils in current
release of python doesn't support setup-requires and hence the only way to
use setuptools is by using ez_setup.py.  Ez_setup.py will still have to be
present for python 2.7 users that want to use "python setup.py ...", and
hence can be assumed to be present for now.  I'm all for adding support for
metadata 2.0 to the stdlib for Python 3.4, that way ez_setup.py can be
phased out in the long run.
> >
> > When packages no longer have to install themselves, they can just
mention setup-requires and the installer grabs the necessary setuptools.
> >
> That can only be done for sdists with 2.0 metadata, sdists for older
versions don't have a setup-requires in their metadata.  This is not just
for installing, if you want to use setuptools in your setup.py you'll have
to make sure it is installed in your setup.py, and with the current version
of the packaging tools this means you have to use something like
ez_setup.py or tell users to install setuptools themselves.

Yes, which is why we propose to assume Setup-Requires-Dist: setuptools if
Metadata-Version < 2.0. Then a no-op ez_setup.py can be added to
sys.modules before setup.py runs and the installer will have a lot more
control over that side effect.

These improved installers will target both 2.7 and 3.4. I do understand
that some people feel it is harder to say "manually download the installer
and then install what you want" rather than "manually download and install
the package you want".

> And with some luck a large subset of packages will ship wheels in the
future, that way the installer doesn't even have to look at sdists.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/distutils-sig/attachments/20130326/c87d0281/attachment-0001.html>

More information about the Distutils-SIG mailing list