diff options
| author | Anderson Bravalheri <andersonbravalheri@gmail.com> | 2022-06-13 10:31:01 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-06-13 10:31:01 +0100 |
| commit | 8f31d52401a09df3e372279be7509a56b024042a (patch) | |
| tree | 4a054370a508140232131a3aec73a2b6ae413ab4 /setuptools/command | |
| parent | 424c7ae8f5b281549113c6251da17789ee68bd36 (diff) | |
| parent | 6c8fe78bd98adac3796b9b01983be5af270637ec (diff) | |
| download | python-setuptools-git-8f31d52401a09df3e372279be7509a56b024042a.tar.gz | |
Add setuptools.command.build (#3256)
Diffstat (limited to 'setuptools/command')
| -rw-r--r-- | setuptools/command/build.py | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/setuptools/command/build.py b/setuptools/command/build.py new file mode 100644 index 00000000..7ab60ce6 --- /dev/null +++ b/setuptools/command/build.py @@ -0,0 +1,24 @@ +from distutils.command.build import build as _build +import warnings + +from setuptools import SetuptoolsDeprecationWarning + + +_ORIGINAL_SUBCOMMANDS = {"build_py", "build_clib", "build_ext", "build_scripts"} + + +class build(_build): + # copy to avoid sharing the object with parent class + sub_commands = _build.sub_commands[:] + + 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`. + """ + warnings.warn(msg, SetuptoolsDeprecationWarning) + self.sub_commands = _build.sub_commands + super().run() |
