From 274758f1c02048d295efdbc13d2f88d9923547f8 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Wed, 3 Aug 2022 10:43:39 -0400 Subject: [PATCH] Mark use of format_commands.append as deprecated. Ref anxuae/setuptools-cythonize#8. --- distutils/command/bdist.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/distutils/command/bdist.py b/distutils/command/bdist.py index 53f13214..c9fdbf13 100644 --- a/distutils/command/bdist.py +++ b/distutils/command/bdist.py @@ -4,6 +4,8 @@ distribution).""" import os +import warnings + from distutils.core import Command from distutils.errors import DistutilsPlatformError, DistutilsOptionError from distutils.util import get_platform @@ -23,7 +25,11 @@ def show_formats(): class ListCompat(dict): # adapter to allow for Setuptools compatibility in format_commands def append(self, item): - return + warnings.warn( + """format_commands is now a dict. append is deprecated.""", + DeprecationWarning, + stacklevel=2, + ) class bdist(Command): @@ -85,7 +91,7 @@ class bdist(Command): } ) - # for compatibility until Setuptools references only format_commands + # for compatibility until consumers only reference format_commands format_command = format_commands def initialize_options(self):