From 565294d79fc8d9061ebd5f2fa801a0717505cfa5 Mon Sep 17 00:00:00 2001 From: Sandy Zhang Date: Sat, 11 Sep 2021 00:14:28 +0000 Subject: [PATCH] Remove duplicate build_ext class and get_ext_filename method --- python/setup.py | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/python/setup.py b/python/setup.py index 31f5406078..33d74203c3 100755 --- a/python/setup.py +++ b/python/setup.py @@ -157,21 +157,6 @@ class build_py(_build_py): return [(pkg, mod, fil) for (pkg, mod, fil) in modules if not any(fnmatch.fnmatchcase(fil, pat=pat) for pat in exclude)] -class build_ext(_build_ext): - def get_ext_filename(self, ext_name): - # since python3.5, python extensions' shared libraries use a suffix that corresponds to the value - # of sysconfig.get_config_var('EXT_SUFFIX') and contains info about the architecture the library targets. - # E.g. on x64 linux the suffix is ".cpython-XYZ-x86_64-linux-gnu.so" - # When crosscompiling python wheels, we need to be able to override this suffix - # so that the resulting file name matches the target architecture and we end up with a well-formed - # wheel. - filename = _build_ext.get_ext_filename(self, ext_name) - orig_ext_suffix = sysconfig.get_config_var("EXT_SUFFIX") - new_ext_suffix = os.getenv("PROTOCOL_BUFFERS_OVERRIDE_EXT_SUFFIX") - if new_ext_suffix and filename.endswith(orig_ext_suffix): - filename = filename[:-len(orig_ext_suffix)] + new_ext_suffix - return filename - class build_ext(_build_ext): def get_ext_filename(self, ext_name):