PEP 632 - Deprecate distutils module

distutils has a bunch of stuff in it that is not related to your build backend.

I realize that all of this is out of the specified scope of the PEP, but that I’m a strong -1 on this PEP unless the scope is expanded to include a plan for what to do.

Alternatively, I recommend modifying the PEP to no longer mention setuptools, since it’s irrelevant. The extent of the PEP can thus be, “We will deprecate distutils in Python 3.10 and remove it in Python 3.12. All current users must find an alternative.” Personally, I don’t think that’s very satisfying.

I don’t think it’s fair to say, “They’re not documented except for a legacy page saying they’re moving to setuptools” when my point is they are not moving to setuptools. “Setuptools provides the distutils module” is an intermediate step to a better future and I’d consider it a worse and more confusing outcome than the current situation if it happened indefinitely, TBH.

I think by “aggressively deprecate” I meant that we would make it very clear that you should never declare a dependency on setuptools to get access to these functions — they’ll be removed there before they get removed from CPython.

I’m talking about how, structurally, distutils gets maintained. In all the currently-proposed scenarios, we’re looking at distutils coming in via a 3rd party PyPI package. I believe the plan (though it’s not laid out here), is to then deprecate distutils both in CPython and in the 3rd party package, with the goal that in X years, nothing will support import distutils.

And no, random people can’t add a distutils package to PyPI because it’s “Open Source” — or at least they shouldn’t be able to, since standard library module names are reserved to prevent squatting.

In any case, I’m a strong -1 on this PEP as it stands. I think the concerns that led people to say that we should write a PEP for this are completely un-addressed, notably this, which echoes other things I’ve seen:

PEP or not, what we need is an overall migration plan so that we can explain to people why what we’re doing is not some horribly destructive thing for the ecosystem and to give them the ability to plan for future changes. “We’ll be removing distutils using the normal deprecation process, setuptools might support some parts of it I guess, but that’s up to them” is not that. It’s a huge migration likely to impact large swathes of the ecosystem, I think it deserves a design review.

1 Like