-
-
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
Add setuptools.command.build #3256
Conversation
In order to override distutils.command.build on downstream projects it is good to have a setuptools specific command which allows downstream projects to avoid importing distutils.
Thank you very much @isuruf, sorry for the confusion with the extra commits, I was trying to fix the error with I am OK with this change, but I will let the other maintainers have a look because I don't know if there are other implications. |
Ping on this |
Thank you very much @isuruf and sorry for the delay. Should we add any protection/migration warnings for the case an user was previously relying on For example, how about something like: _ORIGINAL_SUBCOMMANDS = {"build_py", "build_clib", "build_ext", "build_scripts"}
class build(_build):
sub_commands = _build.sub_commands[:] # copy to avoid sharing the object with parent class
def run(self):
subcommands = {cmd[0] for cmd in _build.sub_commands}
if subcommands - _ORIGINAL_SUBCOMMANDS:
msg = """
It seems that you are using `distutils.command.build.build` to add new subcommands.
Using `distutils` directly is considered deprecated, please use `setuptools.command.build`.
"""
warning.warns(msg, SetuptoolsDeprecationWarning)
self.subcommands = _build.sub_commands
super().run()
... What do you think? |
Makes sense to me. There's a small typo in the line before last. |
I can do that later today, but if you would like to go ahead and work on it, that would be great (since I would have to spend some time to create a simple test case). |
Original author: Anderson Bravalheri
Hi @isuruf, I tried to fix the tests failing in the CI. |
Summary of changes
In order to override distutils.command.build on downstream projects
it is good to have a setuptools specific command which allows
downstream projects to avoid importing distutils.
Closes
Pull Request Checklist
changelog.d/
.(See documentation for details)