diff options
author | Jason R. Coombs <jaraco@jaraco.com> | 2022-08-03 10:44:28 -0400 |
---|---|---|
committer | Jason R. Coombs <jaraco@jaraco.com> | 2022-08-03 10:44:28 -0400 |
commit | 2161891268537a5da847b5e3f129fe579f173629 (patch) | |
tree | 0a574174f2a843c4777c9162da8f084ecb36bcd0 /setuptools/_distutils/command | |
parent | d90cf84e4890036adae403d25c8bb4ee97841bbf (diff) | |
parent | 274758f1c02048d295efdbc13d2f88d9923547f8 (diff) | |
download | python-setuptools-git-2161891268537a5da847b5e3f129fe579f173629.tar.gz |
Merge https://github.com/pypa/distutils into bugfix/format-commands-regr
Diffstat (limited to 'setuptools/_distutils/command')
-rw-r--r-- | setuptools/_distutils/command/bdist.py | 37 |
1 files changed, 27 insertions, 10 deletions
diff --git a/setuptools/_distutils/command/bdist.py b/setuptools/_distutils/command/bdist.py index 4af1b8e6..c9fdbf13 100644 --- a/setuptools/_distutils/command/bdist.py +++ b/setuptools/_distutils/command/bdist.py @@ -4,6 +4,8 @@ Implements the Distutils 'bdist' command (create a built [binary] distribution).""" import os +import warnings + from distutils.core import Command from distutils.errors import DistutilsPlatformError, DistutilsOptionError from distutils.util import get_platform @@ -20,6 +22,16 @@ def show_formats(): pretty_printer.print_help("List of available distribution formats:") +class ListCompat(dict): + # adapter to allow for Setuptools compatibility in format_commands + def append(self, item): + warnings.warn( + """format_commands is now a dict. append is deprecated.""", + DeprecationWarning, + stacklevel=2, + ) + + class bdist(Command): description = "create a built (binary) distribution" @@ -65,18 +77,23 @@ class bdist(Command): default_format = {'posix': 'gztar', 'nt': 'zip'} # Define commands in preferred order for the --help-formats option - format_commands = dict( - rpm=('bdist_rpm', "RPM distribution"), - gztar=('bdist_dumb', "gzip'ed tar file"), - bztar=('bdist_dumb', "bzip2'ed tar file"), - xztar=('bdist_dumb', "xz'ed tar file"), - ztar=('bdist_dumb', "compressed tar file"), - tar=('bdist_dumb', "tar file"), - wininst=('bdist_wininst', "Windows executable installer"), - zip=('bdist_dumb', "ZIP file"), - msi=('bdist_msi', "Microsoft Installer"), + format_commands = ListCompat( + { + 'rpm': ('bdist_rpm', "RPM distribution"), + 'gztar': ('bdist_dumb', "gzip'ed tar file"), + 'bztar': ('bdist_dumb', "bzip2'ed tar file"), + 'xztar': ('bdist_dumb', "xz'ed tar file"), + 'ztar': ('bdist_dumb', "compressed tar file"), + 'tar': ('bdist_dumb', "tar file"), + 'wininst': ('bdist_wininst', "Windows executable installer"), + 'zip': ('bdist_dumb', "ZIP file"), + 'msi': ('bdist_msi', "Microsoft Installer"), + } ) + # for compatibility until consumers only reference format_commands + format_command = format_commands + def initialize_options(self): self.bdist_base = None self.plat_name = None |