[Distutils] What is the official position on distutils?

Nick Coghlan ncoghlan at gmail.com
Tue Aug 30 13:24:28 EDT 2016

On 30 August 2016 at 23:44, Paul Moore <p.f.moore at gmail.com> wrote:
> On 30 August 2016 at 13:38, Antoine Pitrou <solipsis at pitrou.net> wrote:
>> On Tue, 30 Aug 2016 13:34:22 +0100
>> Paul Moore <p.f.moore at gmail.com> wrote:
>>> From what I know, anyone who is actually hacking into the internal
>>> APIs to that level tends to use only distutils (probably because as
>>> you say, setuptools is even worse) and therefore falls into my
>>> category of "people affected by distutils changes who won't mind if a
>>> change is made to setuptools".
>> Except when, as you point out, pip injects setuptools nilly-willy when
>> running setup.py?
> I'm confused. People who hack into distutils internals can't cope with
> having setuptools injected (because their hacks conflict with
> setuptools' hacks). That's my understanding of the situation, but it's
> based mainly on what I've seen of people saying "Don't break my
> APIs!!!" when distutils changes have been proposed in the past. The
> projects involved are already outside of the current
> pip/setuptools/wheel infrastructure (they have their own install
> processes, they don't host on PyPI, they are not pip-installable or
> whatever). So injecting setuptools isn't relevant, because they are
> outside that particular ecosystem.

No, this isn't the case - if you want to reliably generate wheels (as
bdist_wheel doesn't work with plain distutils), and if you want the
installdb metadata to always be generated, then you need to use pip
and its forced setuptools injection in order to get plain distutils
projects to behave the way you want.

This means that other setup.py helper projects like numpy.distutils
need to be setuptools-tolerant so they can support folks using pip
rather than calling setup.py directly.

That consequence further means that there's isn't substantially lower
risk in only changing setuptools without changing distutils - in fact,
by introducing a further unhelpful discrepancy between the two, it
increases the risk of code that works with plain distutils on 3.6+
breaking when setuptools is injected.


Nick Coghlan   |   ncoghlan at gmail.com   |   Brisbane, Australia

More information about the Distutils-SIG mailing list