Python distutils is deprecated and is going to be removed in Python
3.12. Add support for setuptools.
Setuptools in Python 3.11 complains:
SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
Keep using setup.py anyway to build the C extension.
Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
Signed-off-by: Javi Merino <javi.merino@cloud.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
-from distutils.core import setup, Extension
-from distutils.ccompiler import new_compiler
+# Prefer setuptools, fall back to distutils
+try:
+ from setuptools import setup, Extension
+except ImportError:
+ from distutils.core import setup, Extension
import os
import sys
-
-from distutils.core import setup, Extension
+# Prefer setuptools, fall back to distutils
+try:
+ from setuptools import setup, Extension
+except ImportError:
+ from distutils.core import setup, Extension
import os, sys
XEN_ROOT = "../.."