summaryrefslogtreecommitdiff
path: root/setuptools/command/build.py
diff options
context:
space:
mode:
Diffstat (limited to 'setuptools/command/build.py')
-rw-r--r--setuptools/command/build.py19
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()