You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Setuptools recently changed its vendoring method to address the criticism regarding the proliferation of _vendor directories and multiple copies of the same files being distributed in the same wheel/sdist: pypa/setuptools#4455.
That change however do not address the existence of setuptools/_distutils/_vendor and therefore do not close the original issue 100%. I think there is not much point in distutils maintaining its own vendoring system, so this PR proposes simply removing it, and relying on the dependencies that come installed with setuptools.
In pypa/setuptools#4594, we also got a report regarding external tools expecting setuptools/_distutils/_vendor/*.dist-info folders to behave in a certain way (despite it being a private directory and not added to sys.path). Although that issue is not really a bug in setuptools (in my opinion), simply removing distutils/_vendor would also help with that.
The diffcov errors are weird, probably there due to the broken main brought about by a nitpicky change in ruff import sorting, which is now fixed in 7ee6a6e.
Thank you very much for the review and improvements @jaraco.
Adding this comment pushes me a little closer to releasing distutils as its own package (with a caveat that it's not meant to be installed anywhere), and then including it as a vendored package in Setuptools (just like any other, with its dependencies). I'm not prepared to do that yet, but it's more tempting now that distutils has dependencies.
There is another approach as well which is to "just let setuptools do its thing" and remove this concern from distutils (instead, just do a weaker/simpler canonicalization that does not require 3rd party packages1).
Currently setuptools patches DistutilsMetadata because there is no mechanism for using a subclass when setuptools.dist.Distribution is instantiated... So for now we are stuck with this approach, and therefore adding dependencies to distutils has little pay off (patching is necessary anyway).
In the future we either start moving code from setuptools to distutils to remove the need for patching, or add a method that allows using DistutilsMetadata subclasses when instantiating setuptools.dist.Distribution2.
Footnotes
We can safely assume that by the stage that we need the canonicalization, name and version have already been validated, so we could use some regex for the alpha|beta|rc => a|b|c and .|- => _ replacements. ↩
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Setuptools recently changed its vendoring method to address the criticism regarding the proliferation of
_vendordirectories and multiple copies of the same files being distributed in the same wheel/sdist: pypa/setuptools#4455.That change however do not address the existence of
setuptools/_distutils/_vendorand therefore do not close the original issue 100%. I think there is not much point indistutilsmaintaining its own vendoring system, so this PR proposes simply removing it, and relying on the dependencies that come installed with setuptools.In pypa/setuptools#4594, we also got a report regarding external tools expecting
setuptools/_distutils/_vendor/*.dist-infofolders to behave in a certain way (despite it being a private directory and not added tosys.path). Although that issue is not really a bug in setuptools (in my opinion), simply removingdistutils/_vendorwould also help with that.