From 946d2e10a47028e48c4d945066d92de2dbeda695 Mon Sep 17 00:00:00 2001 From: Conor MacBride Date: Fri, 24 Dec 2021 15:30:00 +0000 Subject: [PATCH 1/2] Distutils to Setuptools Signed-off-by: Conor MacBride --- setup.py | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/setup.py b/setup.py index 44b76b4..f789c8e 100755 --- a/setup.py +++ b/setup.py @@ -2,22 +2,18 @@ import os from setuptools import setup, Extension -from distutils.command.build_ext import build_ext +from setuptools.command.build_ext import build_ext class build_ext(build_ext): - def build_extension(self, ext): - self._ctypes = isinstance(ext, CTypes) - return super().build_extension(ext) - def get_export_symbols(self, ext): - if self._ctypes: + if isinstance(ext, CTypes): return ext.export_symbols return super().get_export_symbols(ext) def get_ext_filename(self, ext_name): - if self._ctypes: + if isinstance(self.ext_map[ext_name], CTypes): # Ensure that the extension ends in ".so" # Modified version of parent method from distutils.sysconfig import get_config_var From 2c6aabaffd3a94fbd27221148489ebbb6ade8fb8 Mon Sep 17 00:00:00 2001 From: Conor MacBride Date: Fri, 24 Dec 2021 15:35:37 +0000 Subject: [PATCH 2/2] Migrate get_config_var Signed-off-by: Conor MacBride --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index f789c8e..6a44aeb 100755 --- a/setup.py +++ b/setup.py @@ -16,7 +16,7 @@ def get_ext_filename(self, ext_name): if isinstance(self.ext_map[ext_name], CTypes): # Ensure that the extension ends in ".so" # Modified version of parent method - from distutils.sysconfig import get_config_var + from setuptools.command.build_ext import get_config_var ext_suffix = get_config_var('EXT_SUFFIX') expanded_suffix = ext_suffix.split('.') expanded_suffix[-1] = "so"