Remove almost identical copies of methods already defined in distutils#4996
Merged
Remove almost identical copies of methods already defined in distutils#4996
distutils#4996Conversation
distutils
Contributor
Author
|
Possibly what happened is that in #1180 there was a subtle difference: it was using However, with the move away from Python 2, the method returned to |
2d1e62d to
7ad574d
Compare
Member
|
Yeah, there's a lot of code that can be consolidated once we can drop support for distutils from stdlib (which is approximately now, although I need to finish the deprecation/removal). Happy to see this incremental progress. Thanks! |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.Commandthat 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)