Skip to content

Commit

Permalink
Remove compatibility shims for Setuptools.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaraco committed Aug 1, 2022
1 parent f15fb39 commit c0a4ea6
Showing 1 changed file with 10 additions and 21 deletions.
31 changes: 10 additions & 21 deletions distutils/command/bdist.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,6 @@ 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):
return


class bdist(Command):

description = "create a built (binary) distribution"
Expand Down Expand Up @@ -71,23 +65,18 @@ class bdist(Command):
default_format = {'posix': 'gztar', 'nt': 'zip'}

# Define commands in preferred order for the --help-formats option
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"),
}
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"),
)

# for compatibility until Setuptools references only format_commands

This comment has been minimized.

Copy link
@StefanD986

StefanD986 Aug 3, 2022

@jaraco Removing this broke setuptools-cythonize:

File "D:\win_temp\pip-build-env-avucl34u\overlay\Lib\site-packages\setuptools_cythonize.py", line 166, in set_default_wheel_format
   cls.format_command['wheel'] = ('bdist_wheel', "Python .whl file")
AttributeError: type object 'CythonizeBdist' has no attribute 'format_command'

I also filed an issue on their project, but maybe other setuptools extensions are affected by this.

format_command = format_commands

def initialize_options(self):
self.bdist_base = None
self.plat_name = None
Expand Down

0 comments on commit c0a4ea6

Please sign in to comment.