aboutsummaryrefslogtreecommitdiffstats
path: root/build_scripts/options.py
diff options
context:
space:
mode:
authorCristián Maureira-Fredes <Cristian.Maureira-Fredes@qt.io>2021-09-02 13:44:17 +0200
committerCristián Maureira-Fredes <Cristian.Maureira-Fredes@qt.io>2021-11-26 14:03:25 +0100
commit95a5bb9dd3b5d3fa86f2ed0868e2b821256a6028 (patch)
tree9c5bb000231bf05937f3a5eeda71126b5aa07ac5 /build_scripts/options.py
parentc8fa81de801f09219ef883b72112424baf7c583a (diff)
Move from distutils to setuptools
This is motivated by the deprecation of distutils, and removal in future versions https://github.com/pypa/packaging-problems/issues/127 Pick-to: 6.2 Change-Id: I16448b69f98df6dc1d9a904b69eb69ed5f1093f5 Reviewed-by: Christian Tismer <tismer@stackless.com>
Diffstat (limited to 'build_scripts/options.py')
-rw-r--r--build_scripts/options.py16
1 files changed, 11 insertions, 5 deletions
diff --git a/build_scripts/options.py b/build_scripts/options.py
index 068bd62ab..ff1260586 100644
--- a/build_scripts/options.py
+++ b/build_scripts/options.py
@@ -37,8 +37,14 @@
##
#############################################################################
-import distutils.log as log
-from distutils.spawn import find_executable
+try:
+ from setuptools._distutils import log
+except ModuleNotFoundError:
+ # This is motivated by our CI using an old version of setuptools
+ # so then the coin_build_instructions.py script is executed, and
+ # import from this file, it was failing.
+ from distutils import log
+from shutil import which
import sys
import os
import warnings
@@ -334,7 +340,7 @@ class DistUtilsCommandMixin(object):
def _determine_defaults_and_check(self):
if not self.cmake:
- self.cmake = find_executable("cmake")
+ self.cmake = which("cmake")
if not self.cmake:
log.error("cmake could not be found.")
return False
@@ -343,14 +349,14 @@ class DistUtilsCommandMixin(object):
return False
if not self.qtpaths:
- self.qtpaths = find_executable("qtpaths")
+ self.qtpaths = which("qtpaths")
if not self.qtpaths:
self.qtpaths = find_executable("qtpaths6")
if self.qmake:
self.has_qmake_option = True
else:
- self.qmake = find_executable("qmake")
+ self.qmake = which("qmake")
if not self.qmake:
self.qmake = find_executable("qmake6")
if not self.qmake: