Remove almost identical copies of methods already defined in distutils
#4996
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.
Summary of changes
There are 2 methods defined for
setuptools.Command
that just look like copies of the ones defined indistutils.cmd.Command
(except for formatting, rust auto-fixes). They seem to have been introduced in #1180.https://www.diffchecker.com/w6na9oHI/
I am struggling to see the reason why we need to re-define them, unless the code was there just for backward compatibility with old Python versions (i.e. fixes were backported into
distutils
).I can see however that this code exists since before Python 3.6...
It definetelly exists in the stdlib in 3.9 (minimum version supported by setuptools):
https://github.com/python/cpython/blob/3.9/Lib/distutils/cmd.py#L207-L215
https://github.com/python/cpython/blob/3.9/Lib/distutils/cmd.py#L223-L242
This PR tries to remove this code duplication.
If there is a reason for the duplication we should see regression tests failing.
Closes
Pull Request Checklist
newsfragments/
.(See documentation for details)