From 04a3cb1e888bf3638c509df52deaa43cf5f26094 Mon Sep 17 00:00:00 2001 From: Edmund Blomley Date: Thu, 8 Aug 2024 09:40:30 +0200 Subject: [PATCH 1/2] Replace `distutils.sysconfig` by native `sysconfig`. --- makehelper.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/makehelper.py b/makehelper.py index ef36d63..57e4bce 100644 --- a/makehelper.py +++ b/makehelper.py @@ -26,9 +26,9 @@ pass out = open(sys.argv[1], 'w') -from distutils.sysconfig import get_config_var, get_python_inc +from sysconfig import get_config_var, get_path, get_python_version -incdirs = [get_python_inc()] +incdirs = [get_path("include")] libdir = get_config_var('LIBDIR') or '' have_np='NO' @@ -42,10 +42,10 @@ print('TARGET_CFLAGS +=',get_config_var('BASECFLAGS'), file=out) print('TARGET_CXXFLAGS +=',get_config_var('BASECFLAGS'), file=out) -print('PY_VER :=',get_config_var('VERSION'), file=out) +print('PY_VER :=',get_python_version(), file=out) ldver = get_config_var('LDVERSION') if ldver is None: - ldver = get_config_var('VERSION') + ldver = get_python_version() if get_config_var('Py_DEBUG'): ldver = ldver+'_d' print('PY_LD_VER :=',ldver, file=out) From 797945553e638c0f930ba0470c243d4430bf7ce8 Mon Sep 17 00:00:00 2001 From: Edmund Blomley Date: Thu, 8 Aug 2024 09:43:16 +0200 Subject: [PATCH 2/2] Replace deprecated `numpy.disutils`. --- makehelper.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/makehelper.py b/makehelper.py index 57e4bce..4fb7eb1 100644 --- a/makehelper.py +++ b/makehelper.py @@ -33,8 +33,9 @@ have_np='NO' try: - from numpy.distutils.misc_util import get_numpy_include_dirs - incdirs = get_numpy_include_dirs()+incdirs + from numpy import get_include + numpy_dir = [get_include()] + incdirs = numpy_dir+incdirs have_np='YES' except ImportError: pass