diff options
| author | Anderson Bravalheri <andersonbravalheri@gmail.com> | 2023-04-20 14:24:08 +0100 |
|---|---|---|
| committer | Anderson Bravalheri <andersonbravalheri@gmail.com> | 2023-04-20 14:24:08 +0100 |
| commit | 73b5c62939cd2ef039da9d5f784083fa956ef4a1 (patch) | |
| tree | c24848a7a4c705362a9c076f2c7b16aec8d752c7 /setuptools/command/build.py | |
| parent | 000efbfae1e79d0a9fa9b16b55c4f5a2e90a64dd (diff) | |
| parent | 54da8b6d69b7333424eff305218a10d9605a7e36 (diff) | |
| download | python-setuptools-git-73b5c62939cd2ef039da9d5f784083fa956ef4a1.tar.gz | |
Overhaul for better visibility of warnings (#3849)
Diffstat (limited to 'setuptools/command/build.py')
| -rw-r--r-- | setuptools/command/build.py | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/setuptools/command/build.py b/setuptools/command/build.py index fa3c99ef..0f1d688e 100644 --- a/setuptools/command/build.py +++ b/setuptools/command/build.py @@ -1,9 +1,8 @@ import sys -import warnings from typing import TYPE_CHECKING, List, Dict from distutils.command.build import build as _build -from setuptools import SetuptoolsDeprecationWarning +from ..warnings import SetuptoolsDeprecationWarning if sys.version_info >= (3, 8): from typing import Protocol @@ -23,12 +22,16 @@ class build(_build): def get_sub_commands(self): subcommands = {cmd[0] for cmd in _build.sub_commands} if subcommands - _ORIGINAL_SUBCOMMANDS: - msg = """ - It seems that you are using `distutils.command.build` to add - new subcommands. Using `distutils` directly is considered deprecated, - please use `setuptools.command.build`. - """ - warnings.warn(msg, SetuptoolsDeprecationWarning) + SetuptoolsDeprecationWarning.emit( + "Direct usage of `distutils` commands", + """ + It seems that you are using `distutils.command.build` to add + new subcommands. Using `distutils` directly is considered deprecated, + please use `setuptools.command.build`. + """, + due_date=(2023, 12, 13), # Warning introduced in 13 Jun 2022. + see_url="https://peps.python.org/pep-0632/", + ) self.sub_commands = _build.sub_commands return super().get_sub_commands() |
