
On Tue, 2022-05-10 at 09:53 +0200, Victor Stinner wrote:
Hi,
Two years ago, PEP 632 "Deprecate distutils module" was accepted: the distutils package was deprecated in Python 3.10 and scheduled for removal in Python 3.12. Questions.
* Is the Python ecosystem ready for the distutils removal? How many projects are expected to be broken by this removal?
In Gentoo, I have decided to handle migration from `setup.py install` to PEP517 backends and distutils replacement simultaneously. That is, existing packages that still use the legacy codepath have =stdlib distutils forced, and =local distutils are used when they are updated to use PEP517 build. So far we're nearing updating 40% of Python packages in Gentoo. From my porting experience, I can't think of any major issue caused by replacing stdlib distutils with the setuptools version. IIRC the only problem I recall was that the "local" version installs .egg-info as a directory (like setuptools does) while "stdlib" version installs it as a file. This could mean trouble when the same version of the package is rebuilt with the other distutils version but I don't know how that impacts other package managers. So far, much more trouble is caused by PEP517 backends and wheels, though admittedly this is primarily a problem with setup.py allowing very deep customization and people using it to do pretty much anything. Therefore, from Gentoo's perspective, there should be no major problem with removing distutils from stdlib in Python 3.12. Admittedly, distributions are in the more convenient position here since we can easily patch packages should we find any breakage, while users of pypi are generally stuck with the published versions. -- Best regards, Michał Górny