]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
build: only support python3 binary
authorDaniel P. Berrangé <berrange@redhat.com>
Tue, 3 Dec 2019 16:29:12 +0000 (16:29 +0000)
committerDaniel P. Berrangé <berrange@redhat.com>
Wed, 4 Dec 2019 13:13:01 +0000 (13:13 +0000)
python2 will be end of life by the time of the next
libvirt release. All our supported build targets, including
CentOS7, have a python3 build available.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
21 files changed:
configure.ac
libvirt.spec.in
scripts/apibuild.py
scripts/augeas-gentest.py
scripts/check-aclperms.py
scripts/check-aclrules.py
scripts/check-driverimpls.py
scripts/check-drivername.py
scripts/check-symfile.py
scripts/check-symsorting.py
scripts/dtrace2systemtap.py
scripts/esx_vi_generator.py
scripts/genpolkit.py
scripts/gensystemtap.py
scripts/header-ifdef.py
scripts/hyperv_wmi_generator.py
scripts/minimize-po.py
scripts/mock-noinline.py
scripts/prohibit-duplicate-header.py
scripts/reformat-news.py
tests/cputestdata/cpu-gather.sh

index 76d28d2f67d4bcbbe29c5425ccf0063455c8ad14..2e5af075eab7a632868fdfdbaa69f1072b429e84 100644 (file)
@@ -701,9 +701,9 @@ if test "$with_linux" = "yes"; then
 fi
 
 dnl Allow perl/python overrides
-AC_PATH_PROGS([PYTHON], [python3 python2 python])
+AC_PATH_PROGS([PYTHON], [python3])
 if test -z "$PYTHON"; then
-    AC_MSG_ERROR(['python3', 'python2' or 'python' binary is required to build libvirt])
+    AC_MSG_ERROR(['python3' binary is required to build libvirt])
 fi
 AC_PATH_PROG([FLAKE8], [flake8])
 if test -z "$FLAKE8"; then
index 4c6161a26fae9cff5f2b027fec8b7b0a365847c1..72ed2fd96bb190c5e3b7442386fc35220fcc1cc0 100644 (file)
 
 %define with_bash_completion  0%{!?_without_bash_completion:1}
 
-# Use Python 3 when possible, Python 2 otherwise
-%if 0%{?fedora} || 0%{?rhel} > 7
-    %define python python3
-%else
-    %define python python2
-%endif
-
-
 %if %{with_qemu} || %{with_lxc}
 # numad is used to manage the CPU and memory placement dynamically,
 # it's not available on many non-x86 architectures.
@@ -281,7 +273,7 @@ BuildRequires: perl-interpreter
 %else
 BuildRequires: perl
 %endif
-BuildRequires: %{python}
+BuildRequires: python3
 BuildRequires: systemd-units
 %if %{with_libxl}
 BuildRequires: xen-devel
index 5a0224c1c6df5071f7e08c7ce24b0628ed4e95d2..2f7314b379a7ba98dbe95a831fa420796e604053 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 #
 # This is the API builder, it parses the C sources and build the
 # API formal description in XML.
@@ -8,8 +8,6 @@
 # daniel@veillard.com
 #
 
-from __future__ import print_function
-
 import os
 import sys
 import glob
index 60e12fb77e92b4e0dfc727a004034b11bcffef87..8976785caded3ce99c2a5365487a491e6ce6a929 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 #
 # Copyright (C) 2012-2019 Red Hat, Inc.
 #
@@ -19,8 +19,6 @@
 # License along with this library.  If not, see
 # <http://www.gnu.org/licenses/>.
 
-from __future__ import print_function
-
 import re
 import sys
 
index b1084a3758ec49f37c3a34db1c01cceb1dda3a43..67de0efabd789a5817ec4da0b76a353364f12037 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 #
 # Copyright (C) 2013-2019 Red Hat, Inc.
 #
@@ -21,8 +21,6 @@
 # a lot of auto-generation of code, so when these don't match
 # problems occur, preventing auth from succeeding at all.
 
-from __future__ import print_function
-
 import re
 import sys
 
index 5a7d2754107b2d54e22999a02f8e456cdd4920e5..a1fa473174481fdc8146ee2f1df6e9477c8fee7d 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 #
 # Copyright (C) 2013-2019 Red Hat, Inc.
 #
@@ -32,8 +32,6 @@
 # detected EnsureACL call recorded.
 #
 
-from __future__ import print_function
-
 import re
 import sys
 
index bc3f16a8161a4cc66b8d1b558d26a93a1b63c750..8289b8051ec438009ab3d2ef7797904b8dedbf1a 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 #
 # Copyright (C) 2013-2019 Red Hat, Inc.
 #
@@ -17,8 +17,6 @@
 # <http://www.gnu.org/licenses/>.
 #
 
-from __future__ import print_function
-
 import re
 import sys
 
index ba77a6d48d1ebf20c911f136acae3c3fe1732bbe..39eff836c7ef68af974309731156b09455751a7e 100644 (file)
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 #
 # Copyright (C) 2013-2019 Red Hat, Inc.
 #
@@ -17,8 +17,6 @@
 # <http://www.gnu.org/licenses/>.
 #
 
-from __future__ import print_function
-
 import re
 import sys
 
index 7aeb047d890be0b05c506c538faa6e371d840789..0f6e780df0d0831a5e899af794a2fa0c6a3b47eb 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 #
 # Copyright (C) 2012-2019 Red Hat, Inc.
 #
@@ -16,8 +16,6 @@
 # License along with this library.  If not, see
 # <http://www.gnu.org/licenses/>.
 
-from __future__ import print_function
-
 import re
 import subprocess
 import sys
index 006c42f1b335deb3ab64988d0d8bc0ce55a2d621..e5a69df20a7ff470ae1cd1d3936920ec0f9ae8cb 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 
 # Copyright (C) 2012-2019 Red Hat, Inc.
 #
@@ -16,8 +16,6 @@
 # License along with this library.  If not, see
 # <http://www.gnu.org/licenses/>.
 
-from __future__ import print_function
-
 import os.path
 import re
 import sys
index d6bf1f8d1fe766c658805d8c4c8f0b0d663ed968..506db9c5033dfc40ef257280feb47b35fb7f5f33 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 #
 # Copyright (C) 2011-2019 Red Hat, Inc.
 #
@@ -23,8 +23,6 @@
 #  python dtrace2systemtap.py probes.d > libvirt_probes.stp
 #
 
-from __future__ import print_function
-
 import re
 import sys
 
index 2f685c0898a9a65a52055c315e7e3a959d40cf22..048f5dde9ee613da0601a68b7317757ad8790fe9 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 
 #
 # esx_vi_generator.py: generates most of the SOAP type mapping code
@@ -22,8 +22,6 @@
 # <http://www.gnu.org/licenses/>.
 #
 
-from __future__ import print_function
-
 import sys
 import os
 import os.path
index 230d920f705a467afc004fa5bd97355d9fe267ca..8845ea44e02a4594762cc8de98c07d178fe470fc 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 #
 # Copyright (C) 2012-2019 Red Hat, Inc.
 #
@@ -17,8 +17,6 @@
 # <http://www.gnu.org/licenses/>.
 #
 
-from __future__ import print_function
-
 import re
 import sys
 
index 7b391cc91130b504f61a17cd6b44a3409fcdfc74..ad808e30331f2847c941f6450999e9c9a08b81f2 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 #
 # Copyright (C) 2011-2019 Red Hat, Inc.
 #
@@ -22,8 +22,6 @@
 #   python gensystemtap.py */*.x > libvirt_functions.stp
 #
 
-from __future__ import print_function
-
 import re
 import sys
 
index d5ec7b45fecb63f93804824aa91b1fb905d85c88..e668875f1885916c6dbbd0f686de331e46eb6791 100644 (file)
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 #
 # Copyright (C) 2018-2019 Red Hat, Inc.
 #
@@ -44,8 +44,6 @@
 # ....content....
 # #endif /* SYMBOL */
 
-from __future__ import print_function
-
 import os.path
 import re
 import sys
index 3001f222f791b7caab5ee9e7dcc460da1b3831f9..736eabd598c1ecdc5685f406ed2660907c17f6b1 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 
 #
 # hyperv_wmi_generator.py: generates most of the WMI type mapping code
@@ -20,8 +20,6 @@
 # <http://www.gnu.org/licenses/>.
 #
 
-from __future__ import print_function
-
 import sys
 import os
 import os.path
index d548b427e920860ac6688aba3c051b8f79f1d609..c3052297212e7416fd94866af3b3e5348a41b503 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 #
 # Copyright (C) 2018-2019 Red Hat, Inc.
 #
@@ -16,8 +16,6 @@
 # License along with this library.  If not, see
 # <http://www.gnu.org/licenses/>.
 
-from __future__ import print_function
-
 import re
 import sys
 
index b338c5f0978ae07336dec12439bc2ce8ec6e7165..4fc60c0be3ec7c54156d550dfa305d0d7cc55de8 100644 (file)
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 #
 # Copyright (C) 2017-2019 Red Hat, Inc.
 #
@@ -16,8 +16,6 @@
 # License along with this library.  If not, see
 # <http://www.gnu.org/licenses/>.
 
-from __future__ import print_function
-
 import re
 import sys
 
index 420311ccefc8dc2ea059c93a979b29d5b9373817..33a91ddbc57d0b8104be290f68f8b8207d6b0655 100644 (file)
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 #
 # Copyright (C) 2016-2019 Red Hat, Inc.
 #
@@ -16,8 +16,6 @@
 # License along with this library.  If not, see
 # <http://www.gnu.org/licenses/>.
 
-from __future__ import print_function
-
 import re
 import sys
 
index a06f945c0265c352603c9237e68d86a8c596e79d..7bc752d821df10ebb99a2d8970916aeda9c018f9 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 
 # reformat-news.py: Reformat the NEWS file properly
 #
@@ -18,8 +18,6 @@
 # License along with this library.  If not, see
 # <http://www.gnu.org/licenses/>.
 
-from __future__ import print_function
-
 import sys
 
 COLUMNS = 80
index cefd1b0d0d1689c291807e6691eb5d7b1a68d522..79e3fddf22c1669120bb62b38014078eac4539fd 100755 (executable)
@@ -9,9 +9,7 @@ grep 'model name' /proc/cpuinfo | head -n1
 cpuid -1r
 echo
 
-for python in python3 python2; do
-    $python <<EOF
-from __future__ import print_function
+python3 <<EOF
 from struct import pack, unpack
 from fcntl import ioctl
 import sys, errno
@@ -51,11 +49,6 @@ except IOError as e:
     pass
 EOF
 
-    if [[ $? -eq 0 ]]; then
-        break
-    fi
-done
-
 qemu=qemu-system-x86_64
 for cmd in /usr/bin/$qemu /usr/bin/qemu-kvm /usr/libexec/qemu-kvm; do
     if [[ -x $cmd ]]; then