-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Statically alias distutils-stubs to setuptools._distutils #4704
base: main
Are you sure you want to change the base?
Statically alias distutils-stubs to setuptools._distutils #4704
Conversation
setuptools/__init__.py
Outdated
@@ -228,7 +223,7 @@ def reinitialize_command( | |||
) -> _Command: | |||
cmd = _Command.reinitialize_command(self, command, reinit_subcommands) | |||
vars(cmd).update(kw) | |||
return cmd | |||
return cmd # pyright: ignore[reportReturnType] # pypa/distutils#307 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ref.: pypa/distutils#307
1733d12
to
f950ecc
Compare
47321db
to
7085815
Compare
7085815
to
e66c7ae
Compare
I've added a comment at the top of geenrated files to make it clear that they are generated and how to regenerate them. |
] + install.new_commands # type: ignore[operator] | ||
# TODO: Type sub_commands/new_commands to avoid variance issues in pypa/distutils (like python/typeshed#11951) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
negative_opt: ClassVar[dict[str, str]] = {} | ||
# TODO: Mark class-level mutables as ClassVars in pypa/distutils (like python/typeshed#12403) | ||
negative_opt: ClassVar[dict[str, str]] = {} # type: ignore[misc] | ||
|
||
README_EXTENSIONS = ['', '.rst', '.txt', '.md'] | ||
READMES = tuple('README{0}'.format(ext) for ext in README_EXTENSIONS) | ||
# TODO: Mark some class-level tuples as as not fixed-length pypa/distutils (like python/typeshed#12403) | ||
READMES = tuple('README{0}'.format(ext) for ext in README_EXTENSIONS) # type: ignore[assignment] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Summary of changes
Closes #4689
This is an alternative to #4691. This makes type-checkers and editors see
distutils
as basically an alias tosetuptools.
Advantage:
Disadvantage:
Pull Request Checklist
newsfragments/
. (no need until this is shipped with setuptools)(See documentation for details)