[Distutils] Extracting distutils into setuptools

xoviat xoviat at gmail.com
Wed Sep 27 12:36:37 EDT 2017


/cc  @jaraco

2017-09-27 11:34 GMT-05:00 xoviat <xoviat at gmail.com>:

> So since PEP 517 is going into setuptools anyway, we can
> sys.path.insert(0, NEW_DISTUTILS_LOCATION) and then import distutils in the
> interface before setup.py is loaded. Seems simple enough.
>
> 2017-09-27 11:27 GMT-05:00 Nick Coghlan <ncoghlan at gmail.com>:
>
>> On 27 September 2017 at 23:35, Donald Stufft <donald at stufft.io> wrote:
>> > I suspect this might be difficult, but I haven’t actually tried it. Our
>> > trick (and really setup tools itself relies on this too) is that
>> setuptools
>> > monkey patches distutils at runtime to make distutils into setuptools.
>> It
>> > only has to patch a few bits and pieces right now, but I suspect that if
>> > this happened it’d have to monkey patch the entire namespace. It would
>> > probably also break people who mix and match imports from setuptools and
>> > distutils.
>>
>> Right, my assumption was that pip would need to ensure that setuptools
>> took over the distutils namespace before any of the code in setup.py
>> ran, so that any monkeypatches and state modifications in other code
>> would all take place in the setuptools provided copy, and the standard
>> library's copy would never even get loaded.
>>
>> However, I don't think that's a new requirement: I believe you already
>> need to do that, since the first line might be "from distutils import
>> setup".
>>
>> Cheers,
>> Nick.
>>
>> --
>> Nick Coghlan   |   ncoghlan at gmail.com   |   Brisbane, Australia
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/distutils-sig/attachments/20170927/a4e4e2a1/attachment.html>


More information about the Distutils-SIG mailing list