mirror of
https://github.com/virt-manager/virt-manager.git
synced 2026-08-04 18:33:33 -05:00
setup: Plan for newer setuptools providing distutils back compat
setuptools still doesn't natively provide some infrastructure we need, but newer versions will keep 'import distutils' working until those issues are addressed. I think we need to reorder imports to take advantage of it though. It silences some deprecation warnings at least Signed-off-by: Cole Robinson <crobinso@redhat.com>
This commit is contained in:
@@ -17,16 +17,21 @@ import shutil
|
||||
import sysconfig
|
||||
import subprocess
|
||||
|
||||
# distutils will be deprecated in python 3.12 in favor of setuptools,
|
||||
# but as of this writing there's standard no setuptools way to extend the
|
||||
# 'build' or 'build_scripts' commands which are the only standard
|
||||
# commands we trigger.
|
||||
import distutils.command.build
|
||||
|
||||
import setuptools
|
||||
import setuptools.command.install
|
||||
import setuptools.command.install_egg_info
|
||||
|
||||
|
||||
# distutils will be deprecated in python 3.12 in favor of setuptools,
|
||||
# but as of this writing there's standard no setuptools way to extend the
|
||||
# 'build' commands which are the only standard commands we trigger.
|
||||
# https://github.com/pypa/setuptools/issues/2591
|
||||
#
|
||||
# Newer setuptools will transparently support 'import distutils' though.
|
||||
# That can be overridden with SETUPTOOLS_USE_DISTUTILS env variable
|
||||
import distutils.command.build # pylint: disable=wrong-import-order
|
||||
|
||||
|
||||
SYSPREFIX = sysconfig.get_config_var("prefix")
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user