summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnderson Bravalheri <andersonbravalheri@gmail.com>2023-03-06 20:08:05 +0000
committerAnderson Bravalheri <andersonbravalheri@gmail.com>2023-03-07 21:06:26 +0000
commitc255f063ba1273f6f26d2f55bdec78f2c10e00b4 (patch)
tree7cd5769e0032e855948784fac445406200dcc221
parentc14e9d4d76b9921fa480dd6cbb4c23be11e6ce5f (diff)
downloadpython-setuptools-git-c255f063ba1273f6f26d2f55bdec78f2c10e00b4.tar.gz
Use new warnings in 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..8152658d 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(
+ "Directly 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()