From ed9f33f2f968062679d083b776ba479c04d6ddb4 Mon Sep 17 00:00:00 2001 From: Laurent Bachelier Date: Mon, 24 Dec 2018 19:45:28 +0100 Subject: [PATCH] setup: Under Python 3, prefer Python 3 Qt --- setup.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 437d596049..a38217c7d3 100755 --- a/setup.py +++ b/setup.py @@ -30,6 +30,9 @@ from setuptools import find_packages, setup +PY3 = sys.version_info.major >= 3 + + class BuildQt(Command): description = 'build Qt applications' user_options = [] @@ -43,7 +46,14 @@ def finalize_options(self): def run(self): self.announce('Building Qt applications...', WARN) make = self.find_executable('make', ('gmake', 'make')) - pyuic5 = self.find_executable('pyuic5', ('python2-pyuic5', 'pyuic5-python2.7', 'pyuic5')) + if PY3: + pyuic5 = self.find_executable( + 'pyuic5', + ('python2-pyuic5', 'pyuic5-python2.7', 'pyuic5')) + else: + pyuic5 = self.find_executable( + 'pyuic5', + ('python3-pyuic5', 'pyuic5-python3.7', 'pyuic5-python3.6', 'pyuic5-python3.5', 'pyuic5')) if not pyuic5 or not make: print('Install missing component(s) (see above) or disable Qt applications (with --no-qt).', file=sys.stderr) -- GitLab