From 8261e3dcf732645fa5a9be0d4efe761b51656f6b Mon Sep 17 00:00:00 2001
From: Giovanni Bussi <giovanni.bussi@gmail.com>
Date: Fri, 30 Nov 2018 09:42:36 +0100
Subject: [PATCH] distutils -> setuptools

---
 configure       | 15 +++++++++------
 configure.ac    | 13 ++++++++-----
 python/setup.py |  2 +-
 3 files changed, 18 insertions(+), 12 deletions(-)

diff --git a/configure b/configure
index ad51997a1..113b119d9 100755
--- a/configure
+++ b/configure
@@ -8760,15 +8760,18 @@ done
   then
     { $as_echo "$as_me:${as_lineno-$LINENO}: Python executable is $PYTHON_BIN" >&5
 $as_echo "$as_me: Python executable is $PYTHON_BIN" >&6;}
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking support for required python modules (distutils, cython, numpy, subprocess, os)" >&5
-$as_echo_n "checking support for required python modules (distutils, cython, numpy, subprocess, os)... " >&6; }
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking support for required python modules (setuptools, cython, numpy, subprocess, os, shutil)" >&5
+$as_echo_n "checking support for required python modules (setuptools, cython, numpy, subprocess, os, shutil)... " >&6; }
 testimport="
-from distutils.core import setup
-from distutils.extension import Extension
-from Cython.Build import cythonize
-import numpy
+from setuptools import setup
+from setuptools import Extension
 import subprocess
 import os
+import os.path
+import sys
+from shutil import copyfile
+import numpy
+from Cython.Build import cythonize
 "
     if echo "$testimport" | "$PYTHON_BIN" 1>/dev/null 2>/dev/null;  then
        { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
diff --git a/configure.ac b/configure.ac
index aaa860a43..73a717ce7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -760,14 +760,17 @@ if test $python == true  ; then
   if test -n "$PYTHON_BIN"
   then
     AC_MSG_NOTICE([Python executable is $PYTHON_BIN])
-    AC_MSG_CHECKING([support for required python modules (distutils, cython, numpy, subprocess, os)])
+    AC_MSG_CHECKING([support for required python modules (setuptools, cython, numpy, subprocess, os, shutil)])
 testimport="
-from distutils.core import setup
-from distutils.extension import Extension
-from Cython.Build import cythonize
-import numpy
+from setuptools import setup
+from setuptools import Extension
 import subprocess
 import os
+import os.path
+import sys
+from shutil import copyfile
+import numpy
+from Cython.Build import cythonize
 "
     if echo "$testimport" | "$PYTHON_BIN" 1>/dev/null 2>/dev/null;  then
        AC_MSG_RESULT([yes])
diff --git a/python/setup.py b/python/setup.py
index 6d9fdae9a..eb414cecd 100644
--- a/python/setup.py
+++ b/python/setup.py
@@ -23,7 +23,7 @@
 # This python routine builds an interface between plumed and python using cython
 #
 from setuptools import setup
-from distutils.extension import Extension
+from setuptools import Extension
 import subprocess
 import os
 import os.path
-- 
GitLab